Skip to content

Use request claims for delegated tokens in Cedar - #6440

Open
lorenzozanee wants to merge 1 commit into
stacklok:mainfrom
lorenzozanee:fix/cedar-delegated-token-fallback
Open

Use request claims for delegated tokens in Cedar#6440
lorenzozanee wants to merge 1 commit into
stacklok:mainfrom
lorenzozanee:fix/cedar-delegated-token-fallback

Conversation

@lorenzozanee

Copy link
Copy Markdown
Contributor

Summary

Delegated tokens minted via RFC 8693 have no upstream session and were denied by Cedar when primaryUpstreamProvider is set, even for permissive policies. Fall back to the request token's claims in that case, mirroring the existing opaque-token handling, so delegation can be evaluated.

Fixes #6424

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

API Compatibility

  • This PR does not break the v1beta1 API, OR the api-break-allowed label is applied and the migration guidance is described above.

Changes

File Change
pkg/authz/authorizers/cedar/core.go Fall back to request claims when the upstream token is missing
pkg/authz/authorizers/cedar/core_test.go Update expectations and add delegated-token coverage

Does this introduce a user-facing change?

Yes. Delegated flows now authorize correctly when Cedar uses a primary upstream provider; otherwise behavior is unchanged.

When Cedar is configured with a primaryUpstreamProvider (auto-derived
from the sole upstream), RFC 8693 delegated tokens have no
UpstreamTokens entry and resolveClaims failed closed before policy
evaluation. Fall back to the request token claims so delegation
remains usable, mirroring the existing opaque-token fallback.

Fixes stacklok#6424

Signed-off-by: lorenzozanee <wyz0707@proton.me>
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.

RFC 8693 delegated tokens are denied all tools when Cedar authz uses an upstream provider as its primary claim source

1 participant