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

Inherits:
Object
  • Object
show all
Includes:
Templatable
Defined in:
lib/saml/kit/builders/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) ⇒ Metadata

Returns a new instance of Metadata.



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

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

Instance Attribute Details

#configuration ⇒ Object (readonly)

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

#contact_email ⇒ Object

Returns the value of attribute contact_email.



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

def contact_email
  @contact_email
end

#entity_id ⇒ Object

Returns the value of attribute entity_id.



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

def entity_id
  @entity_id
end

#id ⇒ Object

Returns the value of attribute id.



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

def id
  @id
end

#identity_provider ⇒ Object

Returns the value of attribute identity_provider.



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

def identity_provider
  @identity_provider
end

#organization_name ⇒ Object

Returns the value of attribute organization_name.



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

def organization_name
  @organization_name
end

#organization_url ⇒ Object

Returns the value of attribute organization_url.



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

def organization_url
  @organization_url
end

#service_provider ⇒ Object

Returns the value of attribute service_provider.



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

def service_provider
  @service_provider
end

Instance Method Details

#build ⇒ Object



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

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

#build_identity_provider ⇒ Object



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

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

#build_service_provider ⇒ Object



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

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