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

This aspect contains a bundle of related aspects from entity metadata. It is the top-level structure for SmeeView.

This is the most complicated and slowest Aspect structure in SmeeView, so unless you need everything within this structure, you will probably be better off using other Views to extract only what you need directly.

You can extract and process each of the different types of aspects using their own View modules:

Link to this section Summary

Functions

Returns the cache duration value for the metadata, as a string

Returns a list of all contact aspects in the entity

Returns a list of all Entity Attribute aspects for the entity

Returns the entity ID (URI) of the entity.

Returns the "ID" of the entity's metadata record not the entity ID.

Returns the IdP role attribute for the entity, or nil

Returns true if an IdP role is present

Returns a list of all IdP role aspects (there will be zero or one IdPs in the list)

Returns the top-level organization aspect for the entity, or nil

Returns true if an Organization aspect is present

Returns a list of Organization aspects in the entity

PublicationPath - list of Publications for the entity

Registration aspect for the entity

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

Lists all roles for the Entity (IdPs, SPs, others)

Returns the SP role attribute for the entity, or nil

Returns true if an SP role is present

Returns a list of all SP role aspects (there will be zero or one SPs in the list)

Returns the valid until expiry date from the Entity.

Link to this section Types

Specs

t() :: %SmeeView.Aspects.Entity{
  cache_duration: binary(),
  contacts: list(),
  entity_attributes: list(),
  entity_id: binary(),
  id: binary(),
  idps: list(),
  organizations: list(),
  publications: list(),
  registration: struct(),
  sps: list(),
  valid_until: binary()
}

Link to this section Functions

Specs

cache_duration(aspect :: t()) :: binary()

Returns the cache duration value for the metadata, as a string

Entity.cache_duration(aspect)
# => "PT6H0M0.000S"

Specs

contacts(aspect :: t()) :: list()

Returns a list of all contact aspects in the entity

Entity.contacts(aspect)
# => [%Contact{}, %Contact{}, %Contact{}]
Link to this function

entity_attributes(aspect)

View Source

Specs

entity_attributes(aspect :: t()) :: list()

Returns a list of all Entity Attribute aspects for the entity

Entity.entity_attributes(aspect)
# => [%EntityAttribute{}, %EntityAttribute{}, %EntityAttribute{}]

Specs

entity_id(aspect :: t()) :: binary()

Returns the entity ID (URI) of the entity.

This is already available in the Smee.Entity record and the keys of prism data

Entity.entity_id(aspect)
# => "https://idp.example.com/shibboleth"

Specs

id(aspect :: t()) :: binary()

Returns the "ID" of the entity's metadata record not the entity ID.

This field will often be blank, and will differ for the same entity in different federations

It will often be "_" or nil

Entity.id(aspect)
# => "ex378486"

Specs

idp(aspect :: t()) :: struct() | nil

Returns the IdP role attribute for the entity, or nil

Entity.idp(aspect)
# => %IdP{}

Specs

idp?(aspect :: t()) :: boolean()

Returns true if an IdP role is present

Entity.idp?(aspect)
# => true

Specs

idps(aspect :: t()) :: list()

Returns a list of all IdP role aspects (there will be zero or one IdPs in the list)

See idp/1 too, which returns one or nil

Entity.idps(aspect)
# => [%IdP{}]

Specs

organization(aspect :: t()) :: struct() | nil

Returns the top-level organization aspect for the entity, or nil

Entity.organization(aspect)
# => %Organization{}

Specs

organization?(aspect :: t()) :: boolean()

Returns true if an Organization aspect is present

Entity.organization?(aspect)
# => true

Specs

organizations(aspect :: t()) :: list()

Returns a list of Organization aspects in the entity

Entity.organizations(aspect)
# => [%Organization{}]

Specs

publications(aspect :: t()) :: list()

PublicationPath - list of Publications for the entity

Entity.publications(aspect)
# => [%Publication{}]

Specs

registration(aspect :: t()) :: struct()

Registration aspect for the entity

Entity.registration(aspect)
# => %Registration{}

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.

Entity.role(aspect)
# => :idp

Specs

roles(aspect :: t()) :: list()

Lists all roles for the Entity (IdPs, SPs, others)

Entity.roles(aspect)
# => [%SP{}]

Specs

sp(aspect :: t()) :: struct() | nil

Returns the SP role attribute for the entity, or nil

Entity.sp(aspect)
# => %SP{}

Specs

sp?(aspect :: t()) :: boolean()

Returns true if an SP role is present

Entity.sp?(aspect)
# => true

Specs

sps(aspect :: t()) :: list()

Returns a list of all SP role aspects (there will be zero or one SPs in the list)

See sp/1 too, which returns one or nil

Entity.sps(aspect)
# => [%SP{}]

Specs

valid_until(aspect :: t()) :: binary()

Returns the valid until expiry date from the Entity.

This should already be available in the Smee.Entity record, but that may be derived from the default in the parent metadata.

Entity.valid_until(aspect)
# => "2021-12-25T17:33:22.438Z"