View Source SmeeView.Aspects.Entity (SmeeView v0.2.0)
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
Returns the cache duration value for the metadata, as a string
Entity.cache_duration(aspect)
# => "PT6H0M0.000S"
Returns a list of all contact aspects in the entity
Entity.contacts(aspect)
# => [%Contact{}, %Contact{}, %Contact{}]
Returns a list of all Entity Attribute aspects for the entity
Entity.entity_attributes(aspect)
# => [%EntityAttribute{}, %EntityAttribute{}, %EntityAttribute{}]
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"
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"
Returns the IdP role attribute for the entity, or nil
Entity.idp(aspect)
# => %IdP{}
Returns true if an IdP role is present
Entity.idp?(aspect)
# => true
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{}]
Returns the top-level organization aspect for the entity, or nil
Entity.organization(aspect)
# => %Organization{}
Returns true if an Organization aspect is present
Entity.organization?(aspect)
# => true
Returns a list of Organization aspects in the entity
Entity.organizations(aspect)
# => [%Organization{}]
PublicationPath - list of Publications for the entity
Entity.publications(aspect)
# => [%Publication{}]
Registration aspect for the entity
Entity.registration(aspect)
# => %Registration{}
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
Lists all roles for the Entity (IdPs, SPs, others)
Entity.roles(aspect)
# => [%SP{}]
Returns the SP role attribute for the entity, or nil
Entity.sp(aspect)
# => %SP{}
Returns true if an SP role is present
Entity.sp?(aspect)
# => true
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{}]
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"