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

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:

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.

Types

@type t() :: %SmeeView.Aspects.Entity{
  cache_duration: binary(),
  contacts: list(),
  downloaded_at: nil | DateTime.t(),
  entity_attributes: list(),
  entity_id: binary(),
  entity_id_hash: binary(),
  id: nil | binary(),
  idps: list(),
  label: nil | binary(),
  modified_at: nil | DateTime.t(),
  organizations: list(),
  priority: integer(),
  publications: list(),
  registration: struct(),
  sps: list(),
  tags: [binary()],
  trustiness: float(),
  valid_until: nil | DateTime.t()
}

Functions

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

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

Entity.cache_duration(aspect)
# => "PT6H0M0.000S"
@spec 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
@spec entity_attributes(aspect :: t()) :: list()

Returns a list of all Entity Attribute aspects for the entity

Entity.entity_attributes(aspect)
# => [%EntityAttribute{}, %EntityAttribute{}, %EntityAttribute{}]
@spec 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"
@spec 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"
@spec idp(aspect :: t()) :: struct() | nil

Returns the IdP role attribute for the entity, or nil

Entity.idp(aspect)
# => %IdP{}
@spec idp?(aspect :: t()) :: boolean()

Returns true if an IdP role is present

Entity.idp?(aspect)
# => true
@spec 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{}]
@spec organization(aspect :: t()) :: struct() | nil

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

Entity.organization(aspect)
# => %Organization{}
@spec organization?(aspect :: t()) :: boolean()

Returns true if an Organization aspect is present

Entity.organization?(aspect)
# => true
@spec organizations(aspect :: t()) :: list()

Returns a list of Organization aspects in the entity

Entity.organizations(aspect)
# => [%Organization{}]
@spec publications(aspect :: t()) :: list()

PublicationPath - list of Publications for the entity

Entity.publications(aspect)
# => [%Publication{}]
@spec registration(aspect :: t()) :: struct()

Registration aspect for the entity

Entity.registration(aspect)
# => %Registration{}
@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.

Entity.role(aspect)
# => :idp
@spec roles(aspect :: t()) :: list()

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

Entity.roles(aspect)
# => [%SP{}]
@spec sp(aspect :: t()) :: struct() | nil

Returns the SP role attribute for the entity, or nil

Entity.sp(aspect)
# => %SP{}
@spec sp?(aspect :: t()) :: boolean()

Returns true if an SP role is present

Entity.sp?(aspect)
# => true
@spec 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{}]
@spec 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"