Documentation
¶
Overview ¶
Package legacyscim preserves the old imulab/go-scim based SCIM handler. It was added in May 2026 to keep an opt-out path available during the rollout of the new SCIM 2.0 implementation in enterprise/coderd/scim. Once that implementation has run in production for a while and the CODER_SCIM_USE_LEGACY default is flipped, remove this package in its entirety.
Enabled via the UseLegacySCIM option.
Deprecated: Use the enterprise/coderd/scim package instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SCIMAuditAdditionalFields = map[string]string{
"automatic_actor": "coder",
"automatic_subsystem": "scim",
}
Functions ¶
This section is empty.
Types ¶
type AuthenticationScheme ¶
type BulkSupported ¶
type FilterSupported ¶
type HTTPError ¶
type HTTPError struct {
// contains filtered or unexported fields
}
HTTPError wraps a *spec.Error for correct usage with 'handlerutil.WriteError'. This error type is cursed to be absolutely strange and specific to the SCIM library we use.
The library expects *spec.Error to be returned on unwrap, and the internal error description to be returned by a json.Marshal of the top level error.
func (HTTPError) MarshalJSON ¶
type LegacyServer ¶
type LegacyServer struct {
Logger slog.Logger
Database database.Store
IDPSync idpsync.IDPSync
AGPL *agpl.API
AccessURL *url.URL
SCIMAPIKey []byte
Auditor *atomic.Pointer[audit.Auditor]
}
LegacyServer is the old SCIM handler implementation, kept for backward compatibility. It uses the imulab/go-scim library and custom JSON handling.
func (*LegacyServer) AuthMiddleware ¶
func (s *LegacyServer) AuthMiddleware(next http.Handler) http.Handler
AuthMiddleware verifies the SCIM Bearer token.
func (*LegacyServer) Handler ¶
func (s *LegacyServer) Handler() http.Handler
Handler returns an http.Handler that serves the legacy SCIM endpoints. It should be mounted at /scim/v2.
type SCIMUser ¶
type SCIMUser struct {
Schemas []string `json:"schemas"`
ID string `json:"id"`
UserName string `json:"userName"`
Name struct {
GivenName string `json:"givenName"`
FamilyName string `json:"familyName"`
} `json:"name"`
Emails []struct {
Primary bool `json:"primary"`
Value string `json:"value" format:"email"`
Type string `json:"type"`
Display string `json:"display"`
} `json:"emails"`
// Active is a ptr to prevent the empty value from being interpreted as false.
Active *bool `json:"active"`
Groups []interface{} `json:"groups"`
Meta struct {
ResourceType string `json:"resourceType"`
} `json:"meta"`
}
We currently use our own struct instead of using the SCIM package. This was done mostly because the SCIM package was almost impossible to use. We only need these fields, so it was much simpler to use our own struct. This was tested only with Okta.
type ServiceProviderConfig ¶
type ServiceProviderConfig struct {
Schemas []string `json:"schemas"`
DocURI string `json:"documentationUri"`
Patch Supported `json:"patch"`
Bulk BulkSupported `json:"bulk"`
Filter FilterSupported `json:"filter"`
ChangePassword Supported `json:"changePassword"`
Sort Supported `json:"sort"`
ETag Supported `json:"etag"`
AuthSchemes []AuthenticationScheme `json:"authenticationSchemes"`
Meta ServiceProviderMeta `json:"meta"`
}