• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / auth / 30928593075

04 Aug 2026 04:19PM UTC coverage: 72.178% (+0.008%) from 72.17%
30928593075

push

github

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

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 https://github.com/supabase/auth/pull/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

15 of 17 new or added lines in 3 files covered. (88.24%)

18339 of 25408 relevant lines covered (72.18%)

685.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/internal/api/shared/http.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc