Marks an Ash resource as a SCIM Group resource per RFC 7643 §4.2.

Add to your group resource:

defmodule MyApp.Accounts.Group do
  use Ash.Resource,
    domain: MyApp.Accounts,
    extensions: [AshScim.Group]

  scim do
    map :displayName, attribute: :name

    multivalued :members do
      map :value, attribute: :user_id
    end
  end

  # ... attributes, actions, relationships, etc.
end

See AshScim.Dsl.Map, AshScim.Dsl.Complex, and AshScim.Dsl.Multivalued for the per-entity options.

scim

Configure how this resource is exposed via SCIM 2.0.

The presence of an AshScim.User or AshScim.Group extension enables this resource for inclusion in an AshScim.Router. Mapping declarations describe how Ash attributes are projected to and from SCIM JSON.

Nested DSLs

Options

NameTypeDefaultDocs
pathString.t"/Groups"URL path under which this resource is mounted (relative to the SCIM root).
schemaString.t"urn:ietf:params:scim:schemas:core:2.0:Group"The SCIM schemas URN advertised for this resource.
read_actionatomThe Ash read action used by SCIM GET requests. Defaults to the resource's primary read action.
create_actionatomThe Ash create action used by SCIM POST requests. Defaults to the resource's primary create action.
update_actionatomThe Ash update action used by SCIM PUT/PATCH requests. Defaults to the resource's primary update action.
destroy_actionatomThe Ash destroy action used by SCIM DELETE requests. Defaults to the resource's primary destroy action.
meta?booleantrueEmit the standard SCIM meta object (created, lastModified, location, resourceType).

scim.map

map name

Map a SCIM attribute name to an Ash attribute (or a static value).

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name (camelCase per RFC 7643), e.g. :userName.

Options

NameTypeDefaultDocs
attributeatomThe Ash attribute on this resource that backs the SCIM attribute.
valueanyA static value to emit for this SCIM attribute. Useful inside multivalued mappings, e.g. map :primary, value: true. Mutually exclusive with attribute.
case_exact?booleanRFC 7643 caseExact. Defaults to false for strings.
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.
uniqueness:none | :server | :globalRFC 7643 uniqueness. Defaults to :none.

Introspection

Target: AshScim.Dsl.Map

scim.complex

complex name

Declare a SCIM complex (object-valued) attribute.

Nested DSLs

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name for the complex object, e.g. :name.

Options

NameTypeDefaultDocs
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.

scim.complex.map

map name

Map a SCIM attribute name to an Ash attribute (or a static value).

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name (camelCase per RFC 7643), e.g. :userName.

Options

NameTypeDefaultDocs
attributeatomThe Ash attribute on this resource that backs the SCIM attribute.
valueanyA static value to emit for this SCIM attribute. Useful inside multivalued mappings, e.g. map :primary, value: true. Mutually exclusive with attribute.
case_exact?booleanRFC 7643 caseExact. Defaults to false for strings.
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.
uniqueness:none | :server | :globalRFC 7643 uniqueness. Defaults to :none.

Introspection

Target: AshScim.Dsl.Map

Introspection

Target: AshScim.Dsl.Complex

scim.multivalued

multivalued name

Declare a SCIM multi-valued attribute (an array of complex objects).

Nested DSLs

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name for the multivalued array, e.g. :emails.

Options

NameTypeDefaultDocs
relationshipatomThe name of a has_many relationship on this resource that backs this multivalued attribute. When set, encoding loads the relationship and emits one array element per related record; PATCH operations on this attribute manipulate the related rows directly. Sub-map declarations reference attributes on the related resource. Either relationship: or mirror_primary_to: must be set.
mirror_primary_toatomNames a scalar attribute on this resource that mirrors the SCIM value of the multivalued's primary entry. With relationship: also set, the relationship is the source of truth for SCIM output and mirror_primary_to: keeps the parent scalar in sync (e.g. for use as a login identity). Without relationship:, the parent scalar is the source of truth: SCIM emails is collapsed to one element on read, and writes pick the primary entry's value into the scalar. The other sub-attributes (primary, type) can be filled in via static value: decorators on sub-maps. The primary entry is picked as: the entry with primary: true if one exists; otherwise the lexicographically first entry by value. Either relationship: or mirror_primary_to: must be set.
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.

scim.multivalued.map

map name

Map a SCIM attribute name to an Ash attribute (or a static value).

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name (camelCase per RFC 7643), e.g. :userName.

Options

NameTypeDefaultDocs
attributeatomThe Ash attribute on this resource that backs the SCIM attribute.
valueanyA static value to emit for this SCIM attribute. Useful inside multivalued mappings, e.g. map :primary, value: true. Mutually exclusive with attribute.
case_exact?booleanRFC 7643 caseExact. Defaults to false for strings.
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.
uniqueness:none | :server | :globalRFC 7643 uniqueness. Defaults to :none.

Introspection

Target: AshScim.Dsl.Map

Introspection

Target: AshScim.Dsl.Multivalued

scim.extension

extension urn

Map attributes that live under a SCIM schema-extension URN (RFC 7643 §3.3), e.g. the enterprise user extension.

Nested DSLs

Arguments

NameTypeDefaultDocs
urnString.tThe SCIM schema-extension URN this object is keyed under, e.g. urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.

scim.extension.map

map name

Map a SCIM attribute name to an Ash attribute (or a static value).

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name (camelCase per RFC 7643), e.g. :userName.

Options

NameTypeDefaultDocs
attributeatomThe Ash attribute on this resource that backs the SCIM attribute.
valueanyA static value to emit for this SCIM attribute. Useful inside multivalued mappings, e.g. map :primary, value: true. Mutually exclusive with attribute.
case_exact?booleanRFC 7643 caseExact. Defaults to false for strings.
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.
uniqueness:none | :server | :globalRFC 7643 uniqueness. Defaults to :none.

Introspection

Target: AshScim.Dsl.Map

scim.extension.complex

complex name

Declare a SCIM complex (object-valued) attribute.

Nested DSLs

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name for the complex object, e.g. :name.

Options

NameTypeDefaultDocs
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.

scim.extension.complex.map

map name

Map a SCIM attribute name to an Ash attribute (or a static value).

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name (camelCase per RFC 7643), e.g. :userName.

Options

NameTypeDefaultDocs
attributeatomThe Ash attribute on this resource that backs the SCIM attribute.
valueanyA static value to emit for this SCIM attribute. Useful inside multivalued mappings, e.g. map :primary, value: true. Mutually exclusive with attribute.
case_exact?booleanRFC 7643 caseExact. Defaults to false for strings.
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.
uniqueness:none | :server | :globalRFC 7643 uniqueness. Defaults to :none.

Introspection

Target: AshScim.Dsl.Map

Introspection

Target: AshScim.Dsl.Complex

scim.extension.multivalued

multivalued name

Declare a SCIM multi-valued attribute (an array of complex objects).

Nested DSLs

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name for the multivalued array, e.g. :emails.

Options

NameTypeDefaultDocs
relationshipatomThe name of a has_many relationship on this resource that backs this multivalued attribute. When set, encoding loads the relationship and emits one array element per related record; PATCH operations on this attribute manipulate the related rows directly. Sub-map declarations reference attributes on the related resource. Either relationship: or mirror_primary_to: must be set.
mirror_primary_toatomNames a scalar attribute on this resource that mirrors the SCIM value of the multivalued's primary entry. With relationship: also set, the relationship is the source of truth for SCIM output and mirror_primary_to: keeps the parent scalar in sync (e.g. for use as a login identity). Without relationship:, the parent scalar is the source of truth: SCIM emails is collapsed to one element on read, and writes pick the primary entry's value into the scalar. The other sub-attributes (primary, type) can be filled in via static value: decorators on sub-maps. The primary entry is picked as: the entry with primary: true if one exists; otherwise the lexicographically first entry by value. Either relationship: or mirror_primary_to: must be set.
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.

scim.extension.multivalued.map

map name

Map a SCIM attribute name to an Ash attribute (or a static value).

Arguments

NameTypeDefaultDocs
nameatomThe SCIM attribute name (camelCase per RFC 7643), e.g. :userName.

Options

NameTypeDefaultDocs
attributeatomThe Ash attribute on this resource that backs the SCIM attribute.
valueanyA static value to emit for this SCIM attribute. Useful inside multivalued mappings, e.g. map :primary, value: true. Mutually exclusive with attribute.
case_exact?booleanRFC 7643 caseExact. Defaults to false for strings.
returned:always | :never | :default | :requestRFC 7643 returned. Defaults to :default.
mutability:read_only | :read_write | :immutable | :write_onlyRFC 7643 mutability. Defaults to :read_write.
uniqueness:none | :server | :globalRFC 7643 uniqueness. Defaults to :none.

Introspection

Target: AshScim.Dsl.Map

Introspection

Target: AshScim.Dsl.Multivalued

Introspection

Target: AshScim.Dsl.Extension