Skip to content

providers/scim: accept a service provider that reports bulk as unsupported - #25057

Merged
BeryJu merged 2 commits into
goauthentik:mainfrom
YeongT:providers-scim-optional-bulk-maxoperations
Aug 14, 2026
Merged

BeryJu merged 2 commits into
goauthentik:mainfrom
YeongT:providers-scim-optional-bulk-maxoperations

Conversation

@YeongT

@YeongT YeongT commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Closes #25056.

What

ServiceProviderConfiguration requires bulk.maxOperations. RFC 7644 §5 only
defines the bulk limits alongside bulk support, so a provider that answers
"bulk": {"supported": false} and nothing else is conforming — and today that
response fails validation. get_service_provider_config() then falls back to
ServiceProviderConfiguration.default(), which reports patch.supported: false
and filter.supported: false regardless of what the provider actually
advertised.

Nothing logs that the fallback was taken, and the two false values change
behaviour well away from the parse:

  • SCIMGroupClient.update() takes _update_put instead of _update_patch.
  • SCIMUserClient.create() skips its 409 recovery — if not self._config.filter.supported: raise exc — so an object that already exists
    remotely 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 0

ServiceProviderConfiguration.default() already constructs
Bulk(supported=False, maxOperations=0), and the one consumer already treats
anything below 1 as "no limit declared":

# authentik/providers/scim/clients/groups.py
chunk_size = self._config.bulk.maxOperations
if chunk_size < 1:
    chunk_size = len(ops)

So 0 is 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:

ValidationError: 1 validation error for ServiceProviderConfiguration
bulk.maxOperations
  Field required [type=missing, input_value={'supported': False}, input_type=dict]

>>> client._config.patch.supported, client._config.filter.supported
(False, False)

After: the response parses, and both report True.

Tests

Adds test_config_bulk_unsupported_without_max_operations to
authentik/providers/scim/tests/test_client.py, asserting the client does not
fall back and that patch/filter survive.

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() to
branch on self._config.patch.supported the way SCIMGroupClient.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.supported is already
False before it is consulted.

…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.
@YeongT
YeongT requested a review from a team as a code owner August 13, 2026 08:39
Copilot AI lite review requested due to automatic review settings August 13, 2026 08:39
@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 3afff8c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a7d82c03a9a730008dbe6ba
😎 Deploy Preview https://deploy-preview-25057--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.maxOperations no 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/filter support when bulk.maxOperations is 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

codecov Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.49%. Comparing base (06d90d0) to head (0bdcf85).
⚠️ Report is 21 commits behind head on main.

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     
Flag Coverage Δ
conformance 34.59% <11.11%> (-0.10%) ⬇️
e2e 39.26% <11.11%> (-0.10%) ⬇️
integration 30.71% <11.11%> (-0.54%) ⬇️
rust 39.21% <ø> (+0.32%) ⬆️
unit 93.16% <100.00%> (+1.00%) ⬆️
unit-migrate 93.19% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Signed-off-by: Jens Langhammer <[email protected]>
@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 0bdcf85
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a7f26c7ba67110008118152
😎 Deploy Preview https://deploy-preview-25057--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 0bdcf85
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a7f26c7c43e19000829ec85
😎 Deploy Preview https://deploy-preview-25057--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@BeryJu
BeryJu merged commit 74e1578 into goauthentik:main Aug 14, 2026
139 checks passed
@YeongT
YeongT deleted the providers-scim-optional-bulk-maxoperations branch August 16, 2026 07:41
@BeryJu BeryJu added the backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 label Sep 21, 2026
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.8 created: #26314

BeryJu added a commit that referenced this pull request Sep 21, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SCIM: a service provider that reports bulk as unsupported silently disables PATCH and filtering

3 participants