Repository navigation
Conversation
|
The CI is failing due to missing or moved vars from the |
|
The issue comes from the combination of the cryptojwt and cryptography versions installed. https://cryptography.io/en/latest/changelog/#v47-0-0
and the fix that is included in the latest (v1.11.0) cryptojwt version: https://github.com/IdentityPython/JWTConnect-Python-CryptoJWT/pull/194/changes |
|
However, v1.11.0 declares requires-python: >=3.10 — there's no released cryptojwt version that has this fix and still supports 3.8/3.9 (v1.10.0, the last one that does, predates the fix). So picking up the fix means bumping to cryptojwt>=1.11.0 and dropping Python 3.8/3.9 from this repo's CI matrix — which lines up with both already being past their own upstream EOL. |
|
I think we can drop both Python versions (3.8 and 3.9). |
2bd72f9 to
9de42d2
Compare
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Add RFC 8707 resource indicator support across the authorization, access_token and client_credentials endpoints: an opt-in enable_resource_indicators flag, per-endpoint and per-client resource_indicators policy configuration, and the validate_resource_indicators_policy default policy function.
…ce policies Add the enable_audience_policies/audience_policies hook used across authorization, token and introspection endpoints to compute or restrict the final aud beyond what resource indicators alone determine. Also repairs the test suite broken by this and the preceding resource-indicators commit (bumps requirements-dev.txt, adjusts client_credentials.py and introspection.py).
A client's add_claims.always/by_scope entries could be explicit None
rather than absent, which .get(key, {}) doesn't treat as missing.
…ement id_token minting was deleting client_id from kwargs before building the token payload. Keep it, and align introspection's audience enforcement check accordingly.
…tion Previously the client_id-presence check only ran in the elif branch, so it was skipped entirely whenever authn_info was empty and no client_authn_method was configured for the endpoint - silently accepting an authentication result with no client_id. Run it unconditionally instead.
ea4676c to
093e6ec
Compare
…dicator applies
RFC 9068 Section 3 requires a default resource indicator in aud when
no "resource" parameter is sent - client_credentials was omitting
aud entirely in that case, and separately leaking an unvalidated
"resource" value into aud whenever resource indicators were disabled.
Both fixed: fall back to [client_id] when nothing trusted a resource
into the token, and only trust "resource" into aud when something
actually had the chance to validate or reject it - either
resource_indicators, or an audience policy. Trusting it is not the
same as deleting it from the request: an audience-policy function may
read request.get("resource") directly (rather than the "audience"
argument it's also given), so the field has to stay visible to it even
when resource_indicators itself is off.
Also repairs test coverage: one test was parametrized over resource
values it never actually sent, and two scenarios (no configuration at
all, requesting self or self+unknown) had no test at all.
No functional change - every other client id in this file uses the "client_N" form; these bare "clientN" spellings were inconsistent.
Each docstring states the resource-indicators config in play and what the client requests, so the expected aud/error is readable without cross-referencing anything outside this file.
Two bugs combined to drop aud on cross-client token exchange: the helper never fell back to a default resource indicator (same gap as client_credentials, fixed the same way), and ExchangeGrant.payload_arguments computed the right aud from the minted token's own resources, then two lines later unconditionally replaced it with the grant's own (always-empty) resources, discarding it regardless of what the first fix set. Removing just the overwrite keeps the aud the existing code already computes correctly.
No functional change.
093e6ec to
dcd390b
Compare
The existing docs were stale and incomplete in several ways: - used "callable" as the policy key; the code has always read "function" - never mentioned enable_resource_indicators, without which the feature is a silent no-op regardless of "resource_indicators" config - never mentioned client_credentials/token_exchange support - the per-client example nested the policy under "authorization_code"/ "access_token" keys, which no current code path reads - every helper reads cdb[client]["resource_indicators"] flat - audience_policies/enable_audience_policies didn't exist in the docs at all, including no explanation of its policy function's arguments, its return-value contract (ignored, unlike a resource-indicators policy function), or a worked example of either restricting or computing the audience - the audience argument's per-endpoint source (and that it's read-only, not a write target) wasn't documented either - said nothing about the default aud (RFC 9068 Section 3 MUST) - the resource-indicators policy function example had no prose explaining its arguments, what it may mutate, or what its two possible return shapes mean - clients.rst didn't say who sets enable_resource_indicators or where, reading like a per-client setting when it's a one-time, server-wide endpoint setting, and described the per-client resource_indicators shape by contrast with a since-removed wrong version instead of plainly Rewritten in doc/server/contents/conf.rst and clients.rst to match the files' actual heading hierarchy and document what the code currently does.
3038665 to
ab37e5e
Compare
No description provided.