View Source SmeeView.Aspects.Attribute (SmeeView v0.2.1)

Represents and processes <saml:Attribute> elements in entity metadata as Aspect structs.

The functions in this module are intended to be applied to individual Aspect structs - for extracting and processing collections of these records please use the matching View module.

Summary

Functions

Returns any predefined values for this attribute, or an empty list

Returns true if the attribute has predefined values

Returns the human-readable name for this attribute

Is this aspect relevant to the IdP role?

Returns the technical name for this attribute

Returns for technical name format for this attribute

Returns the associated role for this aspect: :sp, :idp or :all

Is this a SAML1 attribute? Returns true if passed a SAML1 attribute.

Is this a SAML2 attribute? Returns true if a passed SAML2 attribute

Is this aspect relevant to the SP role?

Types

@type t() :: %SmeeView.Aspects.Attribute{
  friendly_name: binary(),
  name: binary(),
  name_format: binary(),
  values: list()
}

Functions

@spec defined_values(aspect :: t()) :: boolean()

Returns any predefined values for this attribute, or an empty list

SmeeView.Aspects.Attribute.defined_values(aspect)
# => ["member", "affiliate", "staff", "student"]
@spec defined_values?(aspect :: t()) :: boolean()

Returns true if the attribute has predefined values

SmeeView.Aspects.Attribute.defined_values?(aspect)
# => false
@spec friendly_name(aspect :: t()) :: binary()

Returns the human-readable name for this attribute

Attribute.friendly_name(aspect)
# => "eduPersonScopedAffiliation"
@spec idp?(aspect :: t()) :: boolean()

Is this aspect relevant to the IdP role?

Will return true if the aspect has been derived from an IdP role, or is applicable to all roles.

Attribute.idp?(aspect)
# => true
@spec name(aspect :: t()) :: binary()

Returns the technical name for this attribute

Attribute.name(aspect)
# => "urn:oid:1.3.6.1.4.1.5923.1.1.1.9"
@spec name_format(aspect :: t()) :: binary()

Returns for technical name format for this attribute

(It'll almost certainly be "urn:oasis:names:tc:SAML:2.0:attrname-format:uri")

Attribute.name_format(aspect)
# => "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
@spec role(aspect :: t()) :: atom()

Returns the associated role for this aspect: :sp, :idp or :all

The role type is useful when handling a mixed list of aspects that may be specific to certain roles of an entity.

Attribute.role(aspect)
# => :idp
@spec saml1?(aspect :: t()) :: boolean()

Is this a SAML1 attribute? Returns true if passed a SAML1 attribute.

Attribute.saml1?(aspect)
# => false
@spec saml2?(aspect :: t()) :: boolean()

Is this a SAML2 attribute? Returns true if a passed SAML2 attribute

Attribute.saml2?(aspect)
# => true
@spec sp?(aspect :: t()) :: boolean()

Is this aspect relevant to the SP role?

Will return true if the aspect has been derived from an SP role, or is applicable to all roles.

Attribute.sp?(aspect)
# => false