Centralized configuration management for ExScim.
Summary
Functions
Returns the list of authentication schemes supported by the SCIM service provider.
Returns the configured base URL for SCIM endpoints.
Returns the maximum number of operations per bulk request.
Returns the maximum payload size in bytes for bulk operations.
Returns whether SCIM bulk operations are supported.
Returns whether SCIM change password operations are supported.
Generates a SCIM resource collection URL for the given resource type.
Generates a SCIM collection URL, using a tenant-specific base URL when available.
Returns the documentation URI for the SCIM service provider, or nil if not configured.
Returns whether SCIM ETag support is enabled.
Returns the maximum number of results for filter queries.
Returns whether SCIM filter operations are supported.
Returns whether SCIM PATCH operations are supported.
Returns the configured resource types supported by this SCIM service provider.
Generates a full SCIM resource URL for the given resource type and ID.
Generates a full SCIM resource URL, using a tenant-specific base URL when available.
Returns the list of schema modules to use for SCIM schema definitions.
Returns the configured base URL with the SCIM v2 API path appended.
Returns whether SCIM sort operations are supported.
Functions
@spec authentication_schemes() :: [map()]
Returns the list of authentication schemes supported by the SCIM service provider.
Each scheme is a map with string keys matching RFC 7643 (type, name, description,
and optionally specUri, documentationUri, primary).
@spec base_url() :: String.t()
Returns the configured base URL for SCIM endpoints.
The base URL is used for generating location headers, documentation URIs, and other absolute URLs in SCIM responses.
Configuration sources (in order of precedence):
- Application environment:
:ex_scim, :base_url - System environment variable:
SCIM_BASE_URL - Default fallback: "http://localhost:4000"
Examples
iex> ExScim.Config.base_url()
"http://localhost:4000"When config :ex_scim, base_url: "https://api.example.com" is set, that
value is returned instead.
@spec bulk_max_operations() :: integer()
Returns the maximum number of operations per bulk request.
@spec bulk_max_payload_size() :: integer()
Returns the maximum payload size in bytes for bulk operations.
@spec bulk_supported() :: boolean()
Returns whether SCIM bulk operations are supported.
@spec change_password_supported() :: boolean()
Returns whether SCIM change password operations are supported.
Generates a SCIM resource collection URL for the given resource type.
Examples
iex> ExScim.Config.collection_url("Users")
"http://localhost:4000/scim/v2/Users"
@spec collection_url(String.t(), ExScim.Scope.t() | nil) :: String.t()
Generates a SCIM collection URL, using a tenant-specific base URL when available.
@spec documentation_uri() :: String.t() | nil
Returns the documentation URI for the SCIM service provider, or nil if not configured.
@spec etag_supported() :: boolean()
Returns whether SCIM ETag support is enabled.
@spec filter_max_results() :: integer()
Returns the maximum number of results for filter queries.
@spec filter_supported() :: boolean()
Returns whether SCIM filter operations are supported.
@spec patch_supported() :: boolean()
Returns whether SCIM PATCH operations are supported.
@spec resource_types() :: [map()]
Returns the configured resource types supported by this SCIM service provider.
Each resource type is a map with the following keys:
:id- unique identifier (e.g.,"User"):name- display name:endpoint- the URL path suffix (e.g.,"/Users"):description- human-readable description:schema- the core schema URI for this resource type:schema_extensions- list of extension maps, each with:schema(URI) and:required(boolean)
Configuration
config :ex_scim, :resource_types, [
%{
id: "User",
name: "User",
endpoint: "/Users",
description: "User Account",
schema: "urn:ietf:params:scim:schemas:core:2.0:User",
schema_extensions: [
%{schema: "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", required: false}
]
}
]Default
When not configured, defaults to User (with Enterprise extension) and Group.
Generates a full SCIM resource URL for the given resource type and ID.
Examples
iex> ExScim.Config.resource_url("Users", "123")
"http://localhost:4000/scim/v2/Users/123"
iex> ExScim.Config.resource_url("Groups", "456")
"http://localhost:4000/scim/v2/Groups/456"
@spec resource_url(String.t(), String.t(), ExScim.Scope.t() | nil) :: String.t()
Generates a full SCIM resource URL, using a tenant-specific base URL when available.
When a scope with a tenant_id is provided and the configured tenant resolver
implements the optional tenant_scim_base_url/1 callback, that URL is used as the
base. Otherwise, falls back to the global scim_base_url/0.
Examples
iex> ExScim.Config.resource_url("Users", "123", nil)
"http://localhost:4000/scim/v2/Users/123"
@spec schema_modules() :: [module()]
Returns the list of schema modules to use for SCIM schema definitions.
Each module must implement the Schema Builder DSL and provide schema_id/0
and to_map/0 functions.
Configuration
config :ex_scim, :schema_modules, [
MyApp.Schemas.User,
MyApp.Schemas.Group
]Default
When not configured, defaults to the built-in schema definitions:
@spec scim_base_url() :: String.t()
Returns the configured base URL with the SCIM v2 API path appended.
This is a convenience function for generating SCIM v2 endpoint URLs.
Examples
iex> ExScim.Config.scim_base_url()
"http://localhost:4000/scim/v2"
@spec sort_supported() :: boolean()
Returns whether SCIM sort operations are supported.