View Source Smee.Filter (Smee v0.5.0)

Process a stream of entities to include or exclude entity structs matching the specified criteria.

These functions are intended to be used with streams but should also work with simple lists too - but using lists to process larger metadata files is strongly discouraged.

By default these functions include matching entities and exclude those that do not match, but this an be reversed. By default Smee.Filter.idp/2 will exclude entities that are no IdPs. But by specifying false as the third parameter the filter will be inverted and exclude entities that have an IdP role.

Summary

Functions

Filters a stream of entities to include or exclude those that have the specified assurance profile certification URI.

Filters a stream of entities to include or exclude those that were registered within the specified number of days.

Filters a stream of entities to include or exclude those that have the specified entity category URI.

Filters a stream of entities to include or exclude those that have the specified entity category support URI.

Filters a stream of entities to include or exclude those that were registered within the last 7 days.

Filters a stream of entities to include or exclude those that have an IdP role.

Filters a stream of entities to include or exclude those that were registered after the specified date.

Filters a stream of entities to include or exclude those that were registered before the specified date.

Filters a stream of entities to include or exclude those that were registered at a particular federation, using the specified URI.

Filters a stream of entities to include or exclude those that have an SP role.

Filters a stream of entities to include or exclude those that have the specified tag.

Filters a stream of entities to include or exclude those that have a trustiness equal or less than the specified number.

Filters a stream of entities to include or exclude those that have one of the specified IDs.

Functions

Link to this function

assurance(enum, certification, bool \\ true)

View Source
@spec assurance(enum :: Enumerable.t(), certification :: binary(), bool :: boolean()) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that have the specified assurance profile certification URI.

The filter is positive by default but can be inverted by specifying false

Link to this function

days(enum, days, bool \\ true)

View Source
@spec days(enum :: Enumerable.t(), days :: integer(), bool :: boolean()) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that were registered within the specified number of days.

Entities without a date will be included in the inverted results.

The filter is positive by default but can be inverted by specifying false

Link to this function

entity_category(enum, category, bool \\ true)

View Source
@spec entity_category(enum :: Enumerable.t(), category :: binary(), bool :: boolean()) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that have the specified entity category URI.

The filter is positive by default but can be inverted by specifying false

Link to this function

entity_category_support(enum, category, bool \\ true)

View Source
@spec entity_category_support(
  enum :: Enumerable.t(),
  category :: binary(),
  bool :: boolean()
) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that have the specified entity category support URI.

The filter is positive by default but can be inverted by specifying false

Link to this function

fresh(enum, bool \\ true)

View Source
@spec fresh(enum :: Enumerable.t(), bool :: boolean()) :: Enumerable.t()

Filters a stream of entities to include or exclude those that were registered within the last 7 days.

Entities without a date will be included in the inverted results.

The filter is positive by default but can be inverted by specifying false

@spec idp(enum :: Enumerable.t(), bool :: boolean()) :: Enumerable.t()

Filters a stream of entities to include or exclude those that have an IdP role.

The filter is positive by default but can be inverted by specifying false

Link to this function

registered_after(enum, date, bool \\ true)

View Source
@spec registered_after(
  enum :: Enumerable.t(),
  date :: Date.t() | binary(),
  bool :: boolean()
) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that were registered after the specified date.

Dates can be Date structs or binary strings in the format "YYYY-MM-DD"

Entities without a date will be included in the inverted results.

The filter is positive by default but can be inverted by specifying false

Link to this function

registered_before(enum, date, bool \\ true)

View Source
@spec registered_before(
  enum :: Enumerable.t(),
  date :: Date.t() | binary(),
  bool :: boolean()
) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that were registered before the specified date.

Dates can be Date structs or binary strings in the format "YYYY-MM-DD"

Entities without a date will be included in the inverted results.

The filter is positive by default but can be inverted by specifying false

Link to this function

registered_by(enum, registrar, bool \\ true)

View Source
@spec registered_by(enum :: Enumerable.t(), registrar :: binary(), bool :: boolean()) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that were registered at a particular federation, using the specified URI.

The filter is positive by default but can be inverted by specifying false

@spec sp(enum :: Enumerable.t(), bool :: boolean()) :: Enumerable.t()

Filters a stream of entities to include or exclude those that have an SP role.

The filter is positive by default but can be inverted by specifying false

Link to this function

tag(enum, tag, bool \\ true)

View Source
@spec tag(enum :: Enumerable.t(), tag :: binary() | atom(), bool :: boolean()) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that have the specified tag.

It's best to provide the tag as a string.

The filter is positive by default but can be inverted by specifying false

Link to this function

trustiness(enum, trustiness \\ 0.7, bool \\ true)

View Source
@spec trustiness(enum :: Enumerable.t(), trustiness :: float(), bool :: boolean()) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that have a trustiness equal or less than the specified number.

Trustiness values are between 0.0 and 0.9.

The filter is positive by default but can be inverted by specifying false

Link to this function

uri(enum, uris, bool \\ true)

View Source
@spec uri(enum :: Enumerable.t(), uris :: list() | binary(), bool :: boolean()) ::
  Enumerable.t()

Filters a stream of entities to include or exclude those that have one of the specified IDs.

The filter is positive by default but can be inverted by specifying false