@remotion/studio-protocol: Add internal license key method - #10029
Merged
Conversation
Contributor
samohovets
force-pushed
the
studio-protocol-license-key
branch
from
July 31, 2026 14:34
19c1ee1 to
2f186cd
Compare
samohovets
marked this pull request as ready for review
July 31, 2026 14:57
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
license-key.ts— validates public license keys against therm_pub_format pattern.set-license-key-in-studio.ts— client-side function that discovers Studios, filters bysetLicenseKeycapability, selects the most recently focused writable target, and POSTs the license key.install-in-studio.ts— exported previously private symbols (discoverStudios,fetchWithTimeout,hasLegacyStudio,isAbortError,isStudioProtocolDescriptor,studioProtocolProbePorts,focusedStudioMaxAge, etc.) for reuse by the license key flow; addedStudioProtocolLicenseKeyTargettype and optionallicenseKeyTarget/setLicenseKeyfields to the descriptor.handle-discovery.ts— discovery now issues both install targets and license key targets (the latter only forremotion.proorigins); refactoredgetLiveInstallableTargetintogetLiveStudioTarget+isInstallableTargetto support project-level targets without composition requirements.handle-license-key.ts— server-side POST handler at/api/studio-protocol/license-keythat validates origin, parses the request body with Zod, validates the license key, consumes the single-use target, and writes the config file via the existing AST-safe transformation.origin-policy.ts— extracted sharedparseOrigin/isLoopbackHttphelpers; addedgetAllowedLicenseKeyOrigin(narrower allowlist:remotion.pro,www.remotion.pro, loopback); addedlicenseKeyparam to CORS functions for per-endpoint origin policy.element-install-state.ts— addedpurposefield (install-element|set-license-key) toStudioProtocolTarget;consumeStudioProtocolTargetvalidates purpose match, addsreadOnlycheck, and skips composition-level checks forset-license-keypurpose.update-public-license.ts— extractedsetPublicLicenseKeyInConfigFilefor reuse by the license key handler.routes.ts— wired/api/studio-protocol/license-keywith proper CORS/OPTIONS per-endpoint handling.set-license-key-in-studio.test.ts— client-side unit tests covering target selection, origin rejection, key validation, and structured error mapping.element-install-state.test.ts— restructured with a sharedupdateTargethelper; added tests for purpose-bound token reuse prevention and read-only invalidation for license key targets.studio-protocol-routes.test.ts— integration test exercising CORS preflight, untrusted origin response, valid key setting with config file mutation, invalid key rejection, token double-use, and no-config-file error.
DeepSeek Pro (free via Pullfrog for OSS) (Claude Opus not used — the program covers this model; add its provider key to run your pick) | 𝕏
samohovets
force-pushed
the
studio-protocol-license-key
branch
from
July 31, 2026 15:09
2f186cd to
dfdda42
Compare
samohovets
force-pushed
the
studio-protocol-license-key
branch
from
July 31, 2026 15:32
dfdda42 to
4396c81
Compare
samohovets
force-pushed
the
studio-protocol-license-key
branch
from
July 31, 2026 16:31
4396c81 to
556d504
Compare
samohovets
force-pushed
the
studio-protocol-license-key
branch
from
July 31, 2026 16:32
556d504 to
a386bc7
Compare
@remotion/studio-protocol: Add license key method@remotion/studio-protocol: Add internal license key method
samohovets
force-pushed
the
studio-protocol-license-key
branch
from
August 1, 2026 09:23
a386bc7 to
6d81fdb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
setLicenseKeyInStudio()capability toStudioProtocolInternalsThe capability is intentionally not part of the public top-level API because only Remotion-controlled origins may invoke it.
Wording updates are in the stacked follow-up PR #10030.
Security
The mutation is restricted to
remotion.pro,www.remotion.pro, and loopback HTTP origins. It accepts only publicrm_pub_keys. Targets are short-lived, single-use, origin-bound, and purpose-bound.Testing
bun test packages/studio-protocol/src/testbun test packages/studio-server/src/test/studio-protocol-routes.test.tsbun test packages/studio-server/src/test/element-install-state.test.ts packages/studio-server/src/test/update-public-license.test.tsbun run buildbun run stylecheck