Class: Saml::Kit::DefaultRegistry
- Inherits:
-
Object
- Object
- Saml::Kit::DefaultRegistry
- Defined in:
- lib/saml/kit/default_registry.rb
Overview
The default metadata registry is used to fetch the metadata associated with an issuer or entity id. The metadata associated with an issuer is used to verify trust for any SAML documents that are received.
Defined Under Namespace
Classes: HttpApi
Instance Method Summary collapse
-
#initialize(items = {}) ⇒ DefaultRegistry
constructor
A new instance of DefaultRegistry.
-
#metadata_for(entity_id) ⇒ Object
Returns the metadata document associated with an issuer or entityID.
-
#register(metadata) ⇒ Object
Register a metadata document.
-
#register_url(url, verify_ssl: true) ⇒ Object
Register metadata via a remote URL.
Constructor Details
#initialize(items = {}) ⇒ DefaultRegistry
Returns a new instance of DefaultRegistry.
6 7 8 |
# File 'lib/saml/kit/default_registry.rb', line 6 def initialize(items = {}) @items = items end |
Instance Method Details
#metadata_for(entity_id) ⇒ Object
Returns the metadata document associated with an issuer or entityID.
31 32 33 |
# File 'lib/saml/kit/default_registry.rb', line 31 def (entity_id) @items[entity_id] end |
#register(metadata) ⇒ Object
Register a metadata document
13 14 15 16 |
# File 'lib/saml/kit/default_registry.rb', line 13 def register() Saml::Kit.logger.debug(.to_xml(pretty: true)) @items[.entity_id] = end |
#register_url(url, verify_ssl: true) ⇒ Object
Register metadata via a remote URL. This will attempt to connect to the remove URL to download the metadata and register it in the registry.
23 24 25 26 |
# File 'lib/saml/kit/default_registry.rb', line 23 def register_url(url, verify_ssl: true) content = HttpApi.new(url, verify_ssl: verify_ssl).get register(Saml::Kit::Metadata.from(content)) end |