View Source SmeeView.SingleLogoutServices (SmeeView v0.2.0)
This module can extracts the <SingleLogoutService>
elements in entity metadata as "aspect" structs, and then
process and filter the results.
Aspects can be extracted with three functions:
- Views, via
view/3
are lists of aspects - Prisms, via
prism/3
are maps of entity IDs to views - There is also
view_one/3
which returns the first aspect found
Aspects can be extracted from Smee.Metadata
structs, Smee.Entity
structs, or lists of aspects, Metadata and Entity
structs.
The other functions in this module are intended to be applied to collections of aspect structs - for working with individual aspects, please look at the appropriate Aspect module.
Summary
Functions
Returns all services matching the specified binding
Returns all bindings present in the view
Removes any non-IdP aspects from a list (view) or map (prism)
Returns a map of Elixir.SmeeView.Aspects.SingleLogoutService
aspect structs extracted from the input data, with entity IDs as keys.
Sorts the services - only really has an impact if services have an index value set
Removes any non-SP aspects from a list (view) or map (prism)
Returns a list of Elixir.SmeeView.Aspects.SingleLogoutService
aspect structs extracted from the input data.
Returns a single Elixir.SmeeView.Aspects.SingleLogoutService
aspect struct extracted from one record in the input data.
Functions
Returns all services matching the specified binding
SingleLogoutServices.binding_filter(aspect)
# => []
Returns all bindings present in the view
SingleLogoutServices.bindings(aspects)
# => []
Removes any non-IdP aspects from a list (view) or map (prism)
SingleLogoutServices.idp_filter(view)
# => []
@spec prism( various :: Smee.Entity.t() | Smee.Metadata.t() | list(), role :: atom(), options :: keyword() ) :: map()
Returns a map of Elixir.SmeeView.Aspects.SingleLogoutService
aspect structs extracted from the input data, with entity IDs as keys.
Input data can be a Smee.Entity
or Smee.Metadata
struct, or a list containing Smee.Entity
and/or Smee.Metadata
structs.
Only appropriate aspect records will be returned.
prism/3
is useful for extracting specific types of aspects from lists of entity records, or metadata. If you are
only interested in one aspect from a single Smee.Entity
struct then you should probably use view/3
instead.
The optional role parameter will optimize the results to only search for either :idp or :sp aspects. The default is :all.
SingleLogoutServices.prism(entity)
# => %{"https://example.com/shibboleth" => [%Elixir.SmeeView.Aspects.SingleLogoutService{}, %Elixir.SmeeView.Aspects.SingleLogoutService{},]}
Sorts the services - only really has an impact if services have an index value set
SingleLogoutServices.sort(aspect)
# => [...]
Removes any non-SP aspects from a list (view) or map (prism)
SingleLogoutServices.sp_filter(view)
# => []
@spec view( list :: Smee.Entity.t() | Smee.Metadata.t() | list(), role :: atom(), options :: keyword() ) :: list()
Returns a list of Elixir.SmeeView.Aspects.SingleLogoutService
aspect structs extracted from the input data.
Input data can be a Smee.Entity
or Smee.Metadata
struct, or a list containing Smee.Entity
, Smee.Metadata
or
any aspects. Only appropriate aspect records will be returned.
view/3
is useful for extracting specific types of aspects from one Entity, but because it has no entity ID information
it's often not the best choice for handling Metadata. When extracting information from entire metadata it's often
better to use prism/3
which returns the same data in a map, associated with each entity's ID.
The optional role parameter will optimize the results to only search for either :idp or :sp aspects. The default is :all.
SingleLogoutServices.view(entity)
# => [%Elixir.SmeeView.Aspects.SingleLogoutService{}, %Elixir.SmeeView.Aspects.SingleLogoutService{}]
@spec view_one( list :: Smee.Entity.t() | Smee.Metadata.t() | list(), role :: atom(), options :: keyword() ) :: SmeeView.Aspects.SingleLogoutService.t() | nil
Returns a single Elixir.SmeeView.Aspects.SingleLogoutService
aspect struct extracted from one record in the input data.
Input data can be a Smee.Entity
or Smee.Metadata
struct, or a list containing Smee.Entity
, Smee.Metadata
or
any aspects.
Only one entity will be processed and then only one aspect will be returned. If you pass one Entity struct as the input, it will be that entity (obviously). If you pass metadata structs or lists one entity will be chosen at random. The first suitable entity will be returned.
view_one/3
is intended for use with a single entity record and aspects like SmeeView.Aspect.Entity
,
SmeeView.Aspect.SP' or
SmeeView.Aspect.Organization' but will work with any aspect.
The optional role parameter will optimize the results to only search for either :idp or :sp aspects. The default is :all.
SingleLogoutServices.view_one(entity)
# => %Elixir.SmeeView.Aspects.SingleLogoutService{}