Repository navigation
providers/scim: accept a service provider that reports bulk as unsupported - #25057
Conversation
…orted
RFC 7644 Section 5 defines the bulk limits alongside bulk support, so a
provider answering `"bulk": {"supported": false}` and nothing else is
conforming. Requiring maxOperations made that response fail validation,
and get_service_provider_config() fell back to a configuration reporting
patch and filter as unsupported no matter what the provider advertised.
The effect shows up far from the parse. SCIMGroupClient.update() takes
its PUT branch instead of PATCH, and SCIMUserClient.create() skips the
409 recovery guarded by filter.supported, so an object that already
exists remotely can never be adopted and the create retries forever.
0 is what ServiceProviderConfiguration.default() already passes, and
_patch_chunked() already reads anything below 1 as no declared limit.
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates authentik’s SCIM client schema parsing so a service provider that reports bulk.supported: false can omit bulk.maxOperations without triggering a validation error and a fallback ServiceProviderConfiguration that incorrectly disables PATCH and filtering.
Changes:
- Make
bulk.maxOperationsno longer required during ServiceProviderConfig parsing (so bulk-unsupported providers can omit it). - Add a regression test ensuring the client does not fall back and preserves advertised
patch/filtersupport whenbulk.maxOperationsis omitted.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| authentik/providers/scim/clients/schema.py | Adjusts SCIM ServiceProviderConfig schema to accept missing bulk.maxOperations by defaulting it. |
| authentik/providers/scim/tests/test_client.py | Adds a test case for bulk-unsupported providers omitting bulk.maxOperations and verifies no fallback occurs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25057 +/- ##
========================================
Coverage 91.49% 91.49%
========================================
Files 1150 1151 +1
Lines 72626 72869 +243
Branches 3875 3889 +14
========================================
+ Hits 66446 66672 +226
- Misses 6145 6161 +16
- Partials 35 36 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Signed-off-by: Jens Langhammer <[email protected]>
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
🍒 Cherry-pick to |
…orted (cherry-pick #25057 to version-2026.8) (#26314) providers/scim: accept a service provider that reports bulk as unsupported (#25057) * providers/scim: accept a service provider that reports bulk as unsupported RFC 7644 Section 5 defines the bulk limits alongside bulk support, so a provider answering `"bulk": {"supported": false}` and nothing else is conforming. Requiring maxOperations made that response fail validation, and get_service_provider_config() fell back to a configuration reporting patch and filter as unsupported no matter what the provider advertised. The effect shows up far from the parse. SCIMGroupClient.update() takes its PUT branch instead of PATCH, and SCIMUserClient.create() skips the 409 recovery guarded by filter.supported, so an object that already exists remotely can never be adopted and the create retries forever. 0 is what ServiceProviderConfiguration.default() already passes, and _patch_chunked() already reads anything below 1 as no declared limit. * fix incorrect test --------- Signed-off-by: Jens Langhammer <[email protected]> Co-authored-by: YEONGCHANG YUN <[email protected]> Co-authored-by: YEONGCHANG YUN <[email protected]> Co-authored-by: Jens Langhammer <[email protected]>
Closes #25056.
What
ServiceProviderConfigurationrequiresbulk.maxOperations. RFC 7644 §5 onlydefines the bulk limits alongside bulk support, so a provider that answers
"bulk": {"supported": false}and nothing else is conforming — and today thatresponse fails validation.
get_service_provider_config()then falls back toServiceProviderConfiguration.default(), which reportspatch.supported: falseand
filter.supported: falseregardless of what the provider actuallyadvertised.
Nothing logs that the fallback was taken, and the two false values change
behaviour well away from the parse:
SCIMGroupClient.update()takes_update_putinstead of_update_patch.SCIMUserClient.create()skips its 409 recovery —if not self._config.filter.supported: raise exc— so an object that already existsremotely can never be adopted, and the create is retried indefinitely.
Against a provider that implements PATCH but not PUT, provisioning appears to
work — accounts are created — while every subsequent update fails.
Why
0ServiceProviderConfiguration.default()already constructsBulk(supported=False, maxOperations=0), and the one consumer already treatsanything below 1 as "no limit declared":
So
0is the value this codebase already means by it, and no call site changes.Reproduction
Google Cloud Identity's inbound SCIM endpoint (GA 2026-07-09) answers:
{ "schemas": ["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"], "patch": {"supported": true}, "bulk": {"supported": false}, "filter": {"supported": true, "maxResults": 50}, "changePassword": {"supported": false}, "sort": {"supported": false}, "etag": {"supported": false}, "authenticationSchemes": [ ... ] }Before:
After: the response parses, and both report
True.Tests
Adds
test_config_bulk_unsupported_without_max_operationstoauthentik/providers/scim/tests/test_client.py, asserting the client does notfall back and that
patch/filtersurvive.I have not been able to run the full suite locally (it needs the Postgres/Redis
stack); the change was verified against a running 2026.5.4 instance by applying
the same default at runtime and re-reading the parsed config.
Note on #16678
This is upstream of #16678. That issue asks for
SCIMUserClient.update()tobranch on
self._config.patch.supportedthe waySCIMGroupClient.update()already does, which is a real and separate gap. But adding that branch alone
would not help a provider like this one, because
patch.supportedis alreadyFalsebefore it is consulted.