SmeeView.Aspects.NameidMappingService (SmeeView v0.1.0) View Source

Represents and processes <NameIDMappingService> 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.

Link to this section Summary

Functions

Returns the binding type for this endpoint/service

Returns the endpoint URL for this endpoint/service.

Is this aspect relevant to the IdP role?

Returns the index type for this endpoint/service, as an integer.

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

Is this aspect relevant to the SP role?

Is the URL for this endpoint/service valid? Returns true if the endpoint URL can be parsed

Link to this section Types

Specs

t() :: %SmeeView.Aspects.NameidMappingService{
  binding: binary(),
  index: integer(),
  location: binary()
}

Link to this section Functions

Specs

binding(aspect :: t()) :: binary()

Returns the binding type for this endpoint/service

NameidMappingService.binding(aspect)
# => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"

Specs

endpoint(aspect :: t()) :: binary()

Returns the endpoint URL for this endpoint/service.

Aspects containing URLs are printable and can be converted to strings using Kernel.to_string/1 or interpolated into another string.

NameidMappingService.endpoint(aspect)
# => "https://test.ukfederation.org.uk/Shibboleth.sso/SAML2/POST"

Specs

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.

NameidMappingService.idp?(aspect)
# => true

Specs

index(aspect :: t()) :: integer()

Returns the index type for this endpoint/service, as an integer.

NameidMappingService.index(aspect)
# => 1

Specs

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.

NameidMappingService.role(aspect)
# => :idp

Specs

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.

NameidMappingService.sp?(aspect)
# => false

Specs

valid?(aspect :: t()) :: boolean()

Is the URL for this endpoint/service valid? Returns true if the endpoint URL can be parsed

NameidMappingService.valid?(aspect)
# => true