class
Saml::IdpMetadataParser
- Saml::IdpMetadataParser
- Reference
- Object
Overview
Auxiliary class to retrieve and parse the Identity Provider Metadata
parse_remote fetches whatever URL it is given (an SSRF risk when the URL comes from a user): validate it before calling. Metadata is parsed with the same strict parser as messages (no DTDs, no entities, no network).
Included Modules
Defined in:
saml/idp_metadata_parser.crConstant Summary
-
DEFAULT_MAX_BYTESIZE =
10000000 -
Remote metadata larger than this is refused; aggregates may need more (:max_bytesize).
-
DEFAULT_TIMEOUT =
10.seconds
Class Method Summary
-
.get_idps(metadata_document : XML::Node, only_entity_id : String | Nil = nil) : Array(XML::Node)
fetch IdP descriptors from a metadata document
Instance Method Summary
- #document : XML::Node | Nil
- #options : Hash(Symbol, Array(String) | Bool | Hash(Symbol, Array(String) | Bool | Hash(Symbol, Array(String)) | Hash(Symbol, Bool | Int32 | String | Nil) | Int32 | String | Symbol | Time | Nil) | Int32 | Saml::Settings | String | Nil)
-
#parse(idp_metadata : String, options : Hash = {} of Symbol => Option) : Settings
Parses the IdP metadata and returns Settings with the IdP values.
-
#parse_remote(url : String, validate_cert = true, options : Hash = {} of Symbol => Option) : Settings
Fetches the IdP metadata and returns Settings with the IdP values.
-
#parse_remote_to_array(url : String, validate_cert = true, options : Hash = {} of Symbol => Option) : Array(Parsed)
Like parse_remote, returning every IdP's values.
-
#parse_remote_to_hash(url : String, validate_cert = true, options : Hash = {} of Symbol => Option) : Parsed
Like parse_remote, returning the first IdP's values as a Hash.
-
#parse_to_array(idp_metadata : String, options : Hash = {} of Symbol => Option) : Array(Parsed)
Parses the metadata and returns every IdP's values (or only :entity_id's).
-
#parse_to_hash(idp_metadata : String, options : Hash = {} of Symbol => Option) : Parsed
Parses the metadata and returns the first IdP's values as a Hash.
- #parse_to_idp_metadata_array(idp_metadata : String, options : Hash = {} of Symbol => Option) : Array(IdpMetadata)
- #response : HTTP::Client::Response | Nil
Class Method Detail
fetch IdP descriptors from a metadata document
Instance Method Detail
Parses the IdP metadata and returns Settings with the IdP values.
@option options [Saml::Settings, Hash] :settings the Settings to merge the metadata into, or overrides for new Settings
@option options [String] :entity_id use the IdP with this entityID (else the first)
@option options [String, Array
Fetches the IdP metadata and returns Settings with the IdP values. @param url [String] http(s) URL of the metadata @param validate_cert [Boolean] check the server's TLS certificate @param options [Hash] as for #parse, plus :max_bytesize @raise [HttpError] Failure to fetch remote IdP metadata
Like parse_remote, returning every IdP's values.
Like parse_remote, returning the first IdP's values as a Hash.
Parses the metadata and returns every IdP's values (or only :entity_id's).
Parses the metadata and returns the first IdP's values as a Hash.