A Plug that exposes Ash resources as a SCIM 2.0 server.
Quick start
Either plug it directly into a pipeline:
plug AshScim.Router,
domains: [MyApp.Accounts],
auth: {AshScim.Auth.StaticBearer, tokens: ["dev-secret"]}Or wrap it in your own module so config lives next to your app:
defmodule MyApp.Scim do
use AshScim.Router,
domains: [MyApp.Accounts],
auth: {AshScim.Auth.StaticBearer, tokens: {:env, "SCIM_TOKEN"}}
end
# in your endpoint/router
forward "/scim/v2", MyApp.ScimOptions
:domains— list of Ash domains to scan for resources carrying theAshScim.UserorAshScim.Groupextensions.:resources— alternative to:domainsif you want to enumerate resources explicitly.:auth—{module, opts}implementingAshScim.Auth.:base_url— used to populatemeta.locationin encoded resources. If omitted,meta.locationis not emitted.
Endpoints
GET /<type>— list (supports?filter=…and?count=…&startIndex=…)GET /<type>/:idPOST /<type>PUT /<type>/:id— full replaceDELETE /<type>/:idGET /ServiceProviderConfig
<type> is the configured path from each resource's scim section
(defaults: Users, Groups).
PATCH support and the /Schemas & /ResourceTypes discovery endpoints
are forthcoming.