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

Represents and processes <shibmd:Scope> 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 the domain of the scope as a string (whether or not it is a regex)

Is this aspect relevant to the IdP role?

Does the scope ask to be treated as a regular expression? Returns true if scope is a regex.

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

Returns the domain of the scope as a string (whether or not it is a regex)

Is this aspect relevant to the SP role?

Returns the domain of the scope as a string (whether or not it is a regex)

Types

@type t() :: %SmeeView.Aspects.Scope{domain: binary(), regex: boolean()}

Functions

@spec domain(aspect :: t()) :: binary()

Returns the domain of the scope as a string (whether or not it is a regex)

Scope.domain(aspect)
# => "example.com"
@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.

Scope.idp?(aspect)
# => true
@spec regex?(aspect :: t()) :: boolean()

Does the scope ask to be treated as a regular expression? Returns true if scope is a regex.

Scope.regex?(aspect)
# => false
@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.

Scope.role(aspect)
# => :idp
@spec scope(aspect :: t()) :: binary()

Returns the domain of the scope as a string (whether or not it is a regex)

Scope.scope(aspect)
# => "example.com"
@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.

Scope.sp?(aspect)
# => false
@spec text(aspect :: t()) :: binary()

Returns the domain of the scope as a string (whether or not it is a regex)

Scope.text(aspect)
# => "example.com"