Repository navigation
fix: scope management routes to the signed in owner and resolve client ips through trustedProxy - #196
Merged
Merged
Conversation
…lient ip through the trusted proxy helper
…teway and session helpers
Contributor
|
Thanks for your first pull request. CI will run shortly. If the change touches package source, please add a changeset with |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.


Scopes the adapter management routes to the signed in owner and stops the adapters, gateway and session helpers from trusting forwarded headers on their own.
What changes
/agents,/delegations,/audit,/dashboard,POST /authorize): with the default session guard, a signed in user only acts on their own agents, delegations and audit rows. Another user's resource returns 404, a mismatched owner on create returns 403. A customauthenticateresolver is an explicit trust decision and is unchanged. Applies to hono, express, fastify, nestjs, nextjs, nuxt, sveltekit, astro, solidstart and tanstack.resolveClientIp. Forwarded headers are ignored unlesstrustedProxy(trustedProxyCountortrustedHeader) is set. Without it anipAllowlistconstraint denies, because the IP is unknown.trustedProxy(--trusted-proxy-count,--trusted-header).@glinr/theauth >=0.7.1, because they callguard.resolveandguard.clientIp.Upgrade notes (also in the changesets)
authenticateresolver that checks admin rights.trustedProxyoripAllowlistconstraints will deny.CF-Connecting-IPunconditionally:trustedProxy: { trustedHeader: "cf-connecting-ip" }keeps it.Verified
Not verified
Follow ups, not in this PR