Class: Saml::Kit::Builders::ServiceProviderMetadata

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

Instance Attribute Summary collapse

Attributes included from Templatable

#embed_signature

Instance Method Summary collapse

Methods included from Templatable

#encrypt?, #encryption_for, #render, #sign=, #sign?, #signature_for, #signatures, #to_xml

Constructor Details

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

Returns a new instance of ServiceProviderMetadata.



13
14
15
16
17
18
19
20
21
# File 'lib/saml/kit/builders/service_provider_metadata.rb', line 13

def initialize(configuration: Saml::Kit.configuration)
  @acs_urls = []
  @configuration = configuration
  @logout_urls = []
  @name_id_formats = [Namespaces::PERSISTENT]
  @want_assertions_signed = true
  @metadata = Saml::Kit::Builders::Metadata.new(configuration: configuration)
  @metadata.service_provider = self
end

Instance Attribute Details

#acs_urls ⇒ Object

Returns the value of attribute acs_urls.



7
8
9
# File 'lib/saml/kit/builders/service_provider_metadata.rb', line 7

def acs_urls
  @acs_urls
end

#configuration ⇒ Object (readonly)

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

#logout_urls ⇒ Object

Returns the value of attribute logout_urls.



7
8
9
# File 'lib/saml/kit/builders/service_provider_metadata.rb', line 7

def logout_urls
  @logout_urls
end

#metadata ⇒ Object (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#name_id_formats ⇒ Object

Returns the value of attribute name_id_formats.



7
8
9
# File 'lib/saml/kit/builders/service_provider_metadata.rb', line 7

def name_id_formats
  @name_id_formats
end

#want_assertions_signed ⇒ Object

Returns the value of attribute want_assertions_signed.



8
9
10
# File 'lib/saml/kit/builders/service_provider_metadata.rb', line 8

def want_assertions_signed
  @want_assertions_signed
end

Instance Method Details

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



23
24
25
# File 'lib/saml/kit/builders/service_provider_metadata.rb', line 23

def add_assertion_consumer_service(url, binding: :http_post)
  @acs_urls.push(location: url, binding: Bindings.binding_for(binding))
end

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



27
28
29
# File 'lib/saml/kit/builders/service_provider_metadata.rb', line 27

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

#build ⇒ Object



31
32
33
# File 'lib/saml/kit/builders/service_provider_metadata.rb', line 31

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