ExScim.Schema.Repository.Adapter behaviour (ex_scim v0.2.2)

Copy Markdown View Source

Behaviour for SCIM schema repositories.

Stores and retrieves SCIM schema definitions (RFC 7643 Section 7) used by the /Schemas discovery endpoint. The default implementation uses ExScim.Schema.Builder to construct schemas from Elixir DSL definitions.

Summary

Types

A SCIM schema definition as a JSON-compatible map.

A SCIM schema URI, e.g. "urn:ietf:params:scim:schemas:core:2.0:User".

Callbacks

Retrieves a schema by its URI. Returns {:ok, schema} or {:error, :not_found}.

Returns true if a schema with the given URI is registered.

Returns all registered schemas.

Types

schema()

@type schema() :: map()

A SCIM schema definition as a JSON-compatible map.

schema_uri()

@type schema_uri() :: binary()

A SCIM schema URI, e.g. "urn:ietf:params:scim:schemas:core:2.0:User".

Callbacks

get_schema(schema_uri)

@callback get_schema(schema_uri()) :: {:ok, schema()} | {:error, :not_found}

Retrieves a schema by its URI. Returns {:ok, schema} or {:error, :not_found}.

has_schema?(schema_uri)

@callback has_schema?(schema_uri()) :: boolean()

Returns true if a schema with the given URI is registered.

list_schemas()

@callback list_schemas() :: [schema()]

Returns all registered schemas.