Class: Saml::Kit::Builders::Metadata

Inherits:
Object
  • Object
show all
Includes:
XmlTemplatable
Defined in:
lib/saml/kit/builders/metadata.rb

Overview

Constant Summary

Constants included from XmlTemplatable

XmlTemplatable::TEMPLATES_DIR

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XmlTemplatable

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

Constructor Details

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

Returns a new instance of Metadata


18
19
20
21
22
# File 'lib/saml/kit/builders/metadata.rb', line 18

def initialize(configuration: Saml::Kit.configuration)
  @id = ::Xml::Kit::Id.generate
  @entity_id = configuration.entity_id
  @configuration = configuration
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration


16
17
18
# File 'lib/saml/kit/builders/metadata.rb', line 16

def configuration
  @configuration
end

#contact_emailObject

Returns the value of attribute contact_email


14
15
16
# File 'lib/saml/kit/builders/metadata.rb', line 14

def contact_email
  @contact_email
end

#entity_idObject

Returns the value of attribute entity_id


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

def entity_id
  @entity_id
end

#idObject

Returns the value of attribute id


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

def id
  @id
end

#identity_providerObject

Returns the value of attribute identity_provider


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

def identity_provider
  @identity_provider
end

#organization_nameObject

Returns the value of attribute organization_name


14
15
16
# File 'lib/saml/kit/builders/metadata.rb', line 14

def organization_name
  @organization_name
end

#organization_urlObject

Returns the value of attribute organization_url


14
15
16
# File 'lib/saml/kit/builders/metadata.rb', line 14

def organization_url
  @organization_url
end

#service_providerObject

Returns the value of attribute service_provider


15
16
17
# File 'lib/saml/kit/builders/metadata.rb', line 15

def service_provider
  @service_provider
end

Instance Method Details

#buildObject


40
41
42
# File 'lib/saml/kit/builders/metadata.rb', line 40

def build
  Saml::Kit::Metadata.from(to_xml)
end

#build_identity_providerObject


32
33
34
35
36
37
38
# File 'lib/saml/kit/builders/metadata.rb', line 32

def build_identity_provider
  @identity_provider = Saml::Kit::IdentityProviderMetadata.builder(
    configuration: configuration
  ) do |x|
    yield x if block_given?
  end
end

#build_service_providerObject


24
25
26
27
28
29
30
# File 'lib/saml/kit/builders/metadata.rb', line 24

def build_service_provider
  @service_provider = Saml::Kit::ServiceProviderMetadata.builder(
    configuration: configuration
  ) do |x|
    yield x if block_given?
  end
end