Skip to content

MD-2438 Add MOS API key forwarding - #34

Merged
JFL110 merged 1 commit into
mainfrom
feature/md-2438-add-all-mos-api-endpoints-to-mos-endpoints-forwarding-from
Aug 24, 2026
Merged

JFL110 merged 1 commit into
mainfrom
feature/md-2438-add-all-mos-api-endpoints-to-mos-endpoints-forwarding-from

Conversation

@JFL110

@JFL110 JFL110 commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

to be merged after BE changes

Copilot AI balanced review requested due to automatic review settings August 20, 2026 12:25
@changeset-bot

changeset-bot Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89b4faa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@monetizationos/proxy Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds permission-downgraded API-key and request-context forwarding for MOS API routes.

Changes:

  • Uses PublicBearer authentication for MOS API requests.
  • Adds identity and client metadata headers to custom endpoints.
  • Adds three authenticated API routes and expanded tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.changeset/thick-icons-greet.md Documents the minor release.
src/MOSProxy.ts Passes metadata providers to custom endpoints.
src/MOSProxyBuilder.ts Registers additional MOS API routes.
src/stages/customEndpoint.ts Forwards key, identity, and client metadata.
src/stages/mosAuthenticatedApi.ts Uses PublicBearer authorization.
test/MOSProxy.spec.ts Tests authenticated routes and authorization.
test/stages/customEndpoint.spec.ts Tests custom-endpoint forwarding headers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .changeset/thick-icons-greet.md Outdated
@JFL110
JFL110 force-pushed the feature/md-2438-add-all-mos-api-endpoints-to-mos-endpoints-forwarding-from branch from 429ad4e to 89b4faa Compare August 20, 2026 12:33

@heinvde-mos heinvde-mos left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things that I'm unsure of to be honest, thought I'd flag it for incase.

const apiRequest = new Request(target, request)
setMosProxyHeaders(apiRequest.headers)
apiRequest.headers.set('x-mos-key', `PublicBearer ${config.mosSecretKey}`)
apiRequest.headers.set('x-mos-endpoint-request-context', JSON.stringify({ identity, clientMetadata }))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And maybe user agent? Middleware might use it. The authenticatedApi thing gets it from request.headers.get('User-Agent').

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user agent, and all the other headers, will be as-is from the original request :)

Comment thread src/stages/mosAuthenticatedApi.ts
@JFL110
JFL110 merged commit 5e0ccbc into main Aug 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants