Skip to content

chore(scim): mount the SCIM router in the main route tree - #2658

Open
xlgmokha wants to merge 1 commit into
xlgmokha/auth-1362afrom
xlgmokha/auth-1362b
Open

chore(scim): mount the SCIM router in the main route tree#2658
xlgmokha wants to merge 1 commit into
xlgmokha/auth-1362afrom
xlgmokha/auth-1362b

Conversation

@xlgmokha

@xlgmokha xlgmokha commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Moves the SCIM routes into the main route tree and hands the feature-flag check to the API layer, so the SCIM package stops carrying that concern.

Extracted from #2643.

What is the current behavior?

/scim/v2 is mounted at the top level of the router, outside the r.Route("/") block, so it does not run isValidExternalHost the way the rest of the API does.

The feature flag is enforced by scim.Server.Middleware, which means the SCIM package has to know about Experimental.ScimEnabled and depend on apierrors.

What is the new behavior?

  • The routes move into the r.Route("/") subtree, so they run isValidExternalHost alongside every other endpoint.
  • (*API).requireScimServerEnabled replaces scim.Server.Middleware, following the existing requireOAuthServerEnabled, requirePasskeyEnabled, and requireCustomOAuthEnabled.

The three endpoints still return 501. With the flag off they still return the same 404, which the test now pins on the body rather than the status code alone:

{
  "code": 404,
  "error_code": "feature_disabled",
  "msg": "SCIM server is disabled"
}

Additional context

Move the `/scim/v2` routes from the top level into the `r.Route("/")`
subtree so they pick up isValidExternalHost along with the rest of
the API.
@xlgmokha xlgmokha self-assigned this Jul 30, 2026
@xlgmokha
xlgmokha changed the base branch from master to xlgmokha/auth-1362a July 30, 2026 21:34
@xlgmokha
xlgmokha marked this pull request as ready for review July 30, 2026 21:37
@xlgmokha
xlgmokha requested a review from a team as a code owner July 30, 2026 21:37
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.

1 participant