Class: Saml::Kit::Builders::IdentityProviderMetadata

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
XmlTemplatable
Defined in:
lib/saml/kit/builders/identity_provider_metadata.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XmlTemplatable

#digest_method, #encrypt_with, #sign?, #signature_method, #signing_key_pair, #template_path

Constructor Details

#initialize(configuration: Saml::Kit.configuration) ⇒ IdentityProviderMetadata

Returns a new instance of IdentityProviderMetadata.



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 16

def initialize(configuration: Saml::Kit.configuration)
  @attributes = []
  @configuration = configuration
  @entity_id = configuration.entity_id
  @id = ::Xml::Kit::Id.generate
  @logout_urls = []
  @name_id_formats = [Namespaces::PERSISTENT]
  @single_sign_on_urls = []
  @want_authn_requests_signed = true
   = Saml::Kit::Builders::.new(configuration: configuration)
  .identity_provider = self
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



9
10
11
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 9

def attributes
  @attributes
end

#configurationObject (readonly)

Returns the value of attribute configuration.



12
13
14
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 12

def configuration
  @configuration
end

#logout_urlsObject (readonly)

Returns the value of attribute logout_urls.



11
12
13
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 11

def logout_urls
  @logout_urls
end

#metadataObject (readonly)

Returns the value of attribute metadata.



13
14
15
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 13

def 
  
end

#name_id_formatsObject

Returns the value of attribute name_id_formats.



9
10
11
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 9

def name_id_formats
  @name_id_formats
end

#single_sign_on_urlsObject (readonly)

Returns the value of attribute single_sign_on_urls.



11
12
13
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 11

def single_sign_on_urls
  @single_sign_on_urls
end

#want_authn_requests_signedObject

Returns the value of attribute want_authn_requests_signed.



10
11
12
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 10

def want_authn_requests_signed
  @want_authn_requests_signed
end

Instance Method Details

#add_single_logout_service(url, binding: :http_post) ⇒ Object



33
34
35
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 33

def add_single_logout_service(url, binding: :http_post)
  @logout_urls.push(location: url, binding: Bindings.binding_for(binding))
end

#add_single_sign_on_service(url, binding: :http_post) ⇒ Object



29
30
31
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 29

def add_single_sign_on_service(url, binding: :http_post)
  @single_sign_on_urls.push(location: url, binding: Bindings.binding_for(binding))
end

#buildObject



37
38
39
# File 'lib/saml/kit/builders/identity_provider_metadata.rb', line 37

def build
  Saml::Kit::.new(to_xml)
end