Skip to content

chore(scim): deliver SCIM responses through a protocol helper - #2657

Open
xlgmokha wants to merge 1 commit into
masterfrom
xlgmokha/auth-1362a
Open

chore(scim): deliver SCIM responses through a protocol helper#2657
xlgmokha wants to merge 1 commit into
masterfrom
xlgmokha/auth-1362a

Conversation

@xlgmokha

@xlgmokha xlgmokha commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Extract SendJSONAs from SendJSON so callers can specify a Content-Type, and add a protocol package that wraps it with the SCIM media type.

Extracted from #2643

What kind of change does this PR introduce?

Refactor. Extracts a scim/protocol package that writes responses using the SCIM media type, so the discovery endpoints in the follow-up PRs have one place to send from.

What is the current behavior?

shared.SendJSON hardcodes application/json, so it is not usable for SCIM.
scim.Server.notImplemented writes its response by hand instead, setting Content-Type from a local mediaType const and calling WriteHeader(501) directly.

What is the new behavior?

  • shared.SendJSONAs(w, status, contentType, obj) takes the Content-Type; SendJSON delegates to it with application/json.
  • A new internal/api/scim/protocol package holds MediaType (application/scim+json) and Send.
  • notImplemented goes through protocol.Send, and the local mediaType const is gone.

Additional context

@xlgmokha xlgmokha self-assigned this Jul 30, 2026
Extract SendJSONAs from SendJSON so callers can specify a Content-Type,
and add a protocol package that wraps it with the SCIM media type.
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1362a branch from ae237ce to e47f1c3 Compare July 30, 2026 21:11
@xlgmokha xlgmokha changed the title refactor(scim): deliver SCIM responses through a protocol helper chore(scim): deliver SCIM responses through a protocol helper Jul 30, 2026
@xlgmokha
xlgmokha marked this pull request as ready for review July 30, 2026 21:12
@xlgmokha
xlgmokha requested a review from a team as a code owner July 30, 2026 21:12
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