-
Couldn't load subscription status.
- Fork 24
feat(authz): defer to request auth as decision/entitlements entity #2789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9b47caf
feat(authz): defer to request auth as decision/entitlements entity
jakedoublev cb56620
new proto field
jakedoublev 46d9810
protovalidate
jakedoublev 22355fb
update ADR with more security considerations
jakedoublev dac3504
Merge remote-tracking branch 'origin' into feat/DSPX-1739-req-auth
jakedoublev 9daa783
use with request token to be idiomatic per PR feedback
jakedoublev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| status: 'proposed' | ||
| date: '2025-10-07' | ||
| tags: | ||
| - authorization | ||
| driver: '@jakedoublev' | ||
| consulted: | ||
| - '@jrschumacher' | ||
| - '@c-r33d' | ||
| --- | ||
| # Allow Authz GetDecision/GetEntitlements requests to derive entity from request authorization token JWT | ||
|
|
||
| ## Context and Problem Statement | ||
|
|
||
| Today, Authorization endpoints require entity specification on the request body, including one of a | ||
| `Token` option, a `RegisteredResourceFQN` option, or an `EntityChain` option. | ||
|
|
||
| In our SDKs, we prefer client-side interceptors to populate auth state within authenticated requests. | ||
|
|
||
| When adding SDK support for a TDF `.Obligations()` method, it was realized we would need to add auth logic inside | ||
| each SDK method itself (not their interceptors) to retrieve a valid access token and set it to a `GetDecision` request | ||
| body as a `Token` entity. We had not exposed the ability serverside to check the request authorization token _as_ the entity | ||
| in a decision/entitlements request, and would need to do more work clientside as a result. | ||
|
|
||
| ## Decision Drivers | ||
|
|
||
| * Reduced SDK logic: | ||
| - avoids roundtripping for an access token from the idP twice (once to auth the request, once to place in the body) | ||
| - avoids complexity in the interceptors (check if we've already retrieved a token first, etc.) | ||
| * Improved DX/UX: | ||
| - effectively GetMyEntitlements, GetMyDecision | ||
| * Security: | ||
| - fewer access tokens retrieved by an SDK instance | ||
| - no changes to casbin RBAC route authz policy | ||
| - any users permitted to make GetDecision/GetEntitlement queries will only get to check their own tokens more easily (inherently more secure than ability to check someone else's) | ||
| - tokens have already been available to in-process services, and this work builds upon that feature | ||
| - no security footguns when decisioning/entitling as the request auth usage is _explicit_ not _implicit_ | ||
|
|
||
| Note: platform security controls safeguarding request access tokens as platform-level resources (should an IPC PEP | ||
| be allowed to touch an access token) is considered out of scope | ||
|
|
||
| ## Considered Options | ||
|
|
||
| * **Option 1**: Get an Access Token outside the interceptor from the OAuth token source for request body entity _and_ another within the interceptor (two tokens retrieved) | ||
| * **Option 2**: Get an Access Token outside the interceptor from the OAuth token source for request body entity _and_ reuse within interceptor (one token retrieved) | ||
| * **Option 3**: Improve Authz endpoints to allow explicitly using the auth header token as the entity | ||
|
|
||
| ## Decision Outcome | ||
|
|
||
| Chosen option: **Option 3**: Improve Authz endpoints to allow explicitly using the auth header token as the entity | ||
|
|
||
| ### Consequences | ||
|
|
||
| * 🟩 **Good**, because better API UX/DX for use cases where a PEP auth == user auth | ||
| * 🟩 **Good**, because keeps token handling logic in SDKs centralized | ||
| * 🟩 **Good**, because simplified Obligations decision check flow | ||
| * 🟩 **Good**, because explicit flag on request avoids footguns in super-privileged PEPs | ||
| * 🟨 **Neutral**, because more complexity in a oneof proto, but there are 4 types of entities/entity sources | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.