Skip to content

Allow JWTs without scopes claims - #51

Merged
dawid-nowak merged 1 commit into
mainfrom
user/luca/allow-missing-scopes
Jul 2, 2026
Merged

Allow JWTs without scopes claims#51
dawid-nowak merged 1 commit into
mainfrom
user/luca/allow-missing-scopes

Conversation

@lucarlig

@lucarlig lucarlig commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Problem

The dataplane currently rejects otherwise valid JWTs when the token has no scopes claim. ContextForge control-plane tokens do not require this claim, and the dataplane uses the token subject to load runtime config from Redis rather than using scopes for authorization today. This makes stock control-plane/admin tokens fail against dataplane MCP routes with 401 responses.

Summary

  • make ContextForgeClaims.scopes optional
  • preserve missing scopes as None for future policy handling
  • add auth-layer regression coverage for JWTs without scopes

Validation

  • cargo test -p contextforge-gateway-rs-lib layers::claims_id
  • cargo test -p contextforge-gateway-rs-lib -- --test-threads=1
  • cargo fmt --check
  • cargo clippy -p contextforge-gateway-rs-lib --all-targets -- -D warnings

Signed-off-by: lucarlig <luca.carlig@ibm.com>
@lucarlig
lucarlig marked this pull request as ready for review July 2, 2026 14:09
@lucarlig
lucarlig requested a review from dawid-nowak July 2, 2026 14:11
@dawid-nowak
dawid-nowak merged commit 9be32df into main Jul 2, 2026
7 checks passed
@lucarlig lucarlig self-assigned this Jul 6, 2026
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.

2 participants