SmeeGen (SmeeGen v0.1.0)

Copy Markdown View Source

Documentation for SmeeGen.

Overview

Examples

Summary

Functions

Returns a SAML metadata record for a CAS client, as an :ok tuple with an XML string.

Returns a SAML metadata record for a CAS client, as an XML string.

Returns a SAML metadata record for an OIDC RP, as an :ok tuple with an XML string.

Returns a SAML metadata record for a an OIDC RP client, as an XML string.

Returns a SAML metadata record for a SAML SP, as an :ok tuple with an XML string.

Returns a SAML metadata record for a SAML SP, as an XML string.

Functions

cas(entity_id, opts \\ [])

@spec cas(entity_id :: binary(), opts :: keyword()) ::
  {:ok, xml :: binary()} | {:error, message :: any()}

Returns a SAML metadata record for a CAS client, as an :ok tuple with an XML string.

Supported options:

  • :auto (boolean/0) - Automatically add various metadata details with guesses and assumptions (assumes some editing later) The default value is true.

  • :fragment (boolean/0) - If set to true the metadata is assumed to be a fragment of an larger aggregated file and will not have its own namespaces The default value is false.

  • :comment (String.t/0) - Include a comment in the metadata

  • :id (String.t/0) - The XML ID for a metadata record. Not to be confused with the entityID!

  • :valid_until (struct of type DateTime) - Sets the expiry date and time of the record.

  • :cache_duration (struct of type Duration) - Sets the cache expiry attribute for the record

  • :keys (map of atom/0 keys and list of String.t/0 values) - Standard SAML signing and encryption keys, listed under :any, :signing and :encryption in x509 blocks, without the headers The default value is %{any: [], signing: [], encryption: []}.

  • :displayname (String.t/0) - The displayname for the entity. It will be set to the language specified by the :lang option

  • :description (String.t/0) - The description for the entity. It will be set to the language specified by the :lang option

  • :information_url (String.t/0) - The information_url for the entity. It will be set to the language specified by the :lang option

  • :privacy_url (String.t/0) - The privacy_url for the entity. It will be set to the language specified by the :lang option

  • :lang (String.t/0) - The two-letter ISO code for the default language of the entity. The default value is "en".

  • :displaynames (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of displaynames by alpha2 ISO language code. The default value is %{}.

  • :descriptions (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of descriptions by alpha2 ISO language code. The default value is %{}.

  • :logos (list of keyword/0) - A list of lists describing logos for this entity The default value is [].

  • :information_urls (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of information URLs, by alpha2 ISO language code. The default value is %{}.

  • :privacy_urls (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of privacy URLs, by alpha2 ISO language code. The default value is %{}.

  • :keywords (map of String.t/0 keys and list of String.t/0 values) - A multi-lingual map of keywords by alpha2 ISO language code. They can be a string of space-separated words, or an Elixir list. The default value is %{}.

  • :contacts (list of keyword/0) - A list of keyword lists describing contacts The default value is [].

  • :organization - Describes the organisation responsible for this entity. It currently only uses the default language set in :lang The default value is nil.

  • :entity_attributes (map of String.t/0 keys and list of String.t/0 values) - A map containing entity attributes that describe the entity The default value is %{}.

  • :ras (boolean/0) - If set to true the REFEDS Research And Scholarship entity attribute will be added The default value is false.

  • :sirtfi (boolean/0) - If set to true the REFEDS SIRTFI entity attribute will be added The default value is false.

  • :coco (boolean/0) - If set to true the REFEDS COCO2 Code of Conduct entity attribute will be added The default value is false.

  • :subject_id_request - Includes the subject ID request requirements of the entity The default value is nil.

  • :anonymous (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :pseudonymous (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :personalized (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :registration_authority (String.t/0) - Sets the registration authority URI for the entity.

  • :registration_instant (struct of type DateTime) - Sets the time the entity was first registered with the registration authority

  • :registration_policy_url (String.t/0) - Sets the URL pointing to the registration authority's policy document

  • :nameids (list of String.t/0) - A list of nameIDs to advertise support for The default value is [].

  • :base_url (String.t/0) - The base endpoint URL, for use with :auto and :template (overrides attempts to use the entityID)

  • :template - The template to use if :auto is set to true The default value is :none.

  • :service_urls (list of String.t/0) - A list of base URLs that will be authenticated using CAS. You will really need at least one. Wildcards are not supported. The default value is [].

  • :proxy_urls (list of String.t/0) - A list of proxy receptor URLs at the CAS client. The default value is [].

  • :logout (boolean/0) - Set to true to enable CAS logout The default value is true.

  • :proxy_keys (list of String.t/0) - A list of x509 certificate blocks that will be used to verify proxy requests The default value is [].

cas!(entity_id, opts \\ [])

@spec cas!(entity_id :: binary(), opts :: keyword()) :: binary()

Returns a SAML metadata record for a CAS client, as an XML string.

Raises an exception if any errors are encountered.

Options and other behaviour are the same as SmeeGen.cas/2

oidc(entity_id, opts \\ [])

@spec oidc(entity_id :: binary(), opts :: keyword()) ::
  {:ok, xml :: binary()} | {:error, message :: any()}

Returns a SAML metadata record for an OIDC RP, as an :ok tuple with an XML string.

Supported options:

  • :auto (boolean/0) - Automatically add various metadata details with guesses and assumptions (assumes some editing later) The default value is true.

  • :fragment (boolean/0) - If set to true the metadata is assumed to be a fragment of an larger aggregated file and will not have its own namespaces The default value is false.

  • :comment (String.t/0) - Include a comment in the metadata

  • :id (String.t/0) - The XML ID for a metadata record. Not to be confused with the entityID!

  • :valid_until (struct of type DateTime) - Sets the expiry date and time of the record.

  • :cache_duration (struct of type Duration) - Sets the cache expiry attribute for the record

  • :keys (map of atom/0 keys and list of String.t/0 values) - Standard SAML signing and encryption keys, listed under :any, :signing and :encryption in x509 blocks, without the headers The default value is %{any: [], signing: [], encryption: []}.

  • :displayname (String.t/0) - The displayname for the entity. It will be set to the language specified by the :lang option

  • :description (String.t/0) - The description for the entity. It will be set to the language specified by the :lang option

  • :information_url (String.t/0) - The information_url for the entity. It will be set to the language specified by the :lang option

  • :privacy_url (String.t/0) - The privacy_url for the entity. It will be set to the language specified by the :lang option

  • :lang (String.t/0) - The two-letter ISO code for the default language of the entity. The default value is "en".

  • :displaynames (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of displaynames by alpha2 ISO language code. The default value is %{}.

  • :descriptions (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of descriptions by alpha2 ISO language code. The default value is %{}.

  • :logos (list of keyword/0) - A list of lists describing logos for this entity The default value is [].

  • :information_urls (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of information URLs, by alpha2 ISO language code. The default value is %{}.

  • :privacy_urls (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of privacy URLs, by alpha2 ISO language code. The default value is %{}.

  • :keywords (map of String.t/0 keys and list of String.t/0 values) - A multi-lingual map of keywords by alpha2 ISO language code. They can be a string of space-separated words, or an Elixir list. The default value is %{}.

  • :contacts (list of keyword/0) - A list of keyword lists describing contacts The default value is [].

  • :organization - Describes the organisation responsible for this entity. It currently only uses the default language set in :lang The default value is nil.

  • :entity_attributes (map of String.t/0 keys and list of String.t/0 values) - A map containing entity attributes that describe the entity The default value is %{}.

  • :ras (boolean/0) - If set to true the REFEDS Research And Scholarship entity attribute will be added The default value is false.

  • :sirtfi (boolean/0) - If set to true the REFEDS SIRTFI entity attribute will be added The default value is false.

  • :coco (boolean/0) - If set to true the REFEDS COCO2 Code of Conduct entity attribute will be added The default value is false.

  • :subject_id_request - Includes the subject ID request requirements of the entity The default value is nil.

  • :anonymous (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :pseudonymous (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :personalized (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :registration_authority (String.t/0) - Sets the registration authority URI for the entity.

  • :registration_instant (struct of type DateTime) - Sets the time the entity was first registered with the registration authority

  • :registration_policy_url (String.t/0) - Sets the URL pointing to the registration authority's policy document

  • :nameids (list of String.t/0) - A list of nameIDs to advertise support for The default value is [].

  • :base_url (String.t/0) - The base endpoint URL, for use with :auto and :template (overrides attempts to use the entityID)

  • :template - The template to use if :auto is set to true The default value is :none.

  • :subject_type - The subject type, either :public or :pairwise

  • :callback_urls (list of String.t/0) - A list of callback URLs for this OIDC RP. You will need at least one. The default value is [].

  • :frontchannel_logout_url (String.t/0) - The URL for front channel logouts

  • :backchannel_logout_url (String.t/0) - The URL for back channel logouts

  • :token_endpoint_auth_method (String.t/0) - Set the token auth method

  • :application_type (String.t/0) - Declare the application type

  • :client_uri (String.t/0) - The public info URL of the software being used

  • :software_id (String.t/0) - Declares the software's internal ID

  • :software_version (String.t/0) - Declares the software's current version

  • :sector_identifier_uri (String.t/0) - URL that points to a JSON file of callback URLs

  • :id_token_signed_response_alg (String.t/0) - Declares an algorthm in the metadata

  • :id_token_encrypted_response_alg (String.t/0) - Declares an algorthm in the metadata

  • :id_token_encrypted_response_enc (String.t/0) - Declares an algorthm in the metadata

  • :userinfo_signed_response_alg (String.t/0) - Declares an algorthm in the metadata

  • :userinfo_encrypted_response_alg (String.t/0) - Declares an algorthm in the metadata

  • :userinfo_encrypted_response_enc (String.t/0) - Declares an algorthm in the metadata

  • :request_object_signing_alg (String.t/0) - Declares an algorthm in the metadata

  • :request_object_encryption_alg (String.t/0) - Declares an algorthm in the metadata

  • :request_object_encryption_enc (String.t/0) - Declares an algorthm in the metadata

  • :token_endpoint_auth_signing_alg (String.t/0) - Declares an algorthm in the metadata

  • :default_max_age (integer/0) - The default maximum age in seconds

  • :require_auth_time (boolean/0) - Declares that the auth_time claim in an ID token is required, or not required.

  • :initiate_login_uri (String.t/0) - Declares the URL that a 3rd party can use to initiate login to this RP

  • :frontchannel_logout_session_required (boolean/0) - Is front-channel logout required?

  • :backchannel_logout_session_required (boolean/0) - Is back-channel logout required?

  • :grant_types - List or space separated string of grant types to declare

  • :response_types - List or space separated string of response types to declare

  • :scopes - List or space separated string of scopes to declare

  • :default_acr_values (list of String.t/0) - List of requested Authentication Context Class names to declare The default value is [].

  • :request_urls (list of String.t/0) - List of request_uri values The default value is [].

  • :post_logout_redirect_urls (list of String.t/0) - List of URLs The default value is [].

  • :audience (list of String.t/0) - List of audience IDs (probably client_id values) The default value is [].

  • :client_secret (String.t/0) - The shared secret used to authenticate clients

  • :client_secret_format - How the client secret is to be stored in metadata: as a plain text secret, hashed, or as a reference The default value is :sha2.

  • :jwks - Declares an entire JWKS JSON structure (one or more keys) inside the metadata

  • :jwks_url (String.t/0) - Declares that the RP will use keys stored remotely at this URL

  • :x509_keys (map of String.t/0 keys and String.t/0 values) - A map of conventional PEM certificate blocks, with their KIDs as the map keys The default value is %{}.

  • :rsa_keys (list of keyword/0) - A list of RSA keys defined with their own option lists The default value is [].

oidc!(entity_id, opts \\ [])

@spec oidc!(entity_id :: binary(), opts :: keyword()) :: binary()

Returns a SAML metadata record for a an OIDC RP client, as an XML string.

Raises an exception if any errors are encountered.

Options and other behaviour are the same as SmeeGen.oidc/2

saml(entity_id, opts \\ [])

@spec saml(entity_id :: binary(), opts :: keyword()) ::
  {:ok, xml :: binary()} | {:error, message :: any()}

Returns a SAML metadata record for a SAML SP, as an :ok tuple with an XML string.

Supported options:

  • :auto (boolean/0) - Automatically add various metadata details with guesses and assumptions (assumes some editing later) The default value is true.

  • :fragment (boolean/0) - If set to true the metadata is assumed to be a fragment of an larger aggregated file and will not have its own namespaces The default value is false.

  • :comment (String.t/0) - Include a comment in the metadata

  • :id (String.t/0) - The XML ID for a metadata record. Not to be confused with the entityID!

  • :valid_until (struct of type DateTime) - Sets the expiry date and time of the record.

  • :cache_duration (struct of type Duration) - Sets the cache expiry attribute for the record

  • :keys (map of atom/0 keys and list of String.t/0 values) - Standard SAML signing and encryption keys, listed under :any, :signing and :encryption in x509 blocks, without the headers The default value is %{any: [], signing: [], encryption: []}.

  • :displayname (String.t/0) - The displayname for the entity. It will be set to the language specified by the :lang option

  • :description (String.t/0) - The description for the entity. It will be set to the language specified by the :lang option

  • :information_url (String.t/0) - The information_url for the entity. It will be set to the language specified by the :lang option

  • :privacy_url (String.t/0) - The privacy_url for the entity. It will be set to the language specified by the :lang option

  • :lang (String.t/0) - The two-letter ISO code for the default language of the entity. The default value is "en".

  • :displaynames (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of displaynames by alpha2 ISO language code. The default value is %{}.

  • :descriptions (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of descriptions by alpha2 ISO language code. The default value is %{}.

  • :logos (list of keyword/0) - A list of lists describing logos for this entity The default value is [].

  • :information_urls (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of information URLs, by alpha2 ISO language code. The default value is %{}.

  • :privacy_urls (map of String.t/0 keys and String.t/0 values) - A multi-lingual map of privacy URLs, by alpha2 ISO language code. The default value is %{}.

  • :keywords (map of String.t/0 keys and list of String.t/0 values) - A multi-lingual map of keywords by alpha2 ISO language code. They can be a string of space-separated words, or an Elixir list. The default value is %{}.

  • :contacts (list of keyword/0) - A list of keyword lists describing contacts The default value is [].

  • :organization - Describes the organisation responsible for this entity. It currently only uses the default language set in :lang The default value is nil.

  • :entity_attributes (map of String.t/0 keys and list of String.t/0 values) - A map containing entity attributes that describe the entity The default value is %{}.

  • :ras (boolean/0) - If set to true the REFEDS Research And Scholarship entity attribute will be added The default value is false.

  • :sirtfi (boolean/0) - If set to true the REFEDS SIRTFI entity attribute will be added The default value is false.

  • :coco (boolean/0) - If set to true the REFEDS COCO2 Code of Conduct entity attribute will be added The default value is false.

  • :subject_id_request - Includes the subject ID request requirements of the entity The default value is nil.

  • :anonymous (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :pseudonymous (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :personalized (boolean/0) - If set to true the REFEDS Anonymous profile entity attribute will be added The default value is false.

  • :registration_authority (String.t/0) - Sets the registration authority URI for the entity.

  • :registration_instant (struct of type DateTime) - Sets the time the entity was first registered with the registration authority

  • :registration_policy_url (String.t/0) - Sets the URL pointing to the registration authority's policy document

  • :nameids (list of String.t/0) - A list of nameIDs to advertise support for The default value is [].

  • :base_url (String.t/0) - The base endpoint URL, for use with :auto and :template (overrides attempts to use the entityID)

  • :template - The template to use if :auto is set to true The default value is :none.

  • :assertion_consumer_services (list of keyword/0) - ACS / Assertion Consumer Service endpoints - at least one is required, but it will be set automatically and probably incorrectly if :auto is true The default value is [].

saml!(entity_id, opts \\ [])

@spec saml!(entity_id :: binary(), opts :: keyword()) :: binary()

Returns a SAML metadata record for a SAML SP, as an XML string.

Raises an exception if any errors are encountered.

Options and other behaviour are the same as SmeeGen.saml/2