Class: Saml::Kit::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/saml/kit/core_ext/metadata.rb

Constant Summary collapse

TABLE =
{
  'Entity Id' => ->(x) { x.entity_id },
  'Type' => ->(x) { x.name },
  'Valid' => ->(x) { x.valid? },
  'Name Id Formats' => ->(x) { x.name_id_formats.inspect },
  'Organization' => ->(x) { x.organization_name },
  'Url' => ->(x) { x.organization_url },
  'Contact' => ->(x) { x.contact_person_company },
}.freeze
SERVICES =
%w[
  SingleSignOnService
  SingleLogoutService
  AssertionConsumerService
].freeze

Instance Method Summary collapse

Instance Method Details

#build_services_table(table) ⇒ Object



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

def build_services_table(table)
  SERVICES.each do |type|
    services(type).each do |service|
      table.push([type, [service.location, service.binding]])
    end
  end
end

#build_table(table = []) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/saml/kit/core_ext/metadata.rb', line 22

def build_table(table = [])
  TABLE.each { |key, callable| table.push([key, callable.call(self)]) }
  build_services_table(table)
  certificates.each do |certificate|
    table.push(['', certificate.x509.to_text])
  end
  signature.build_table(table)
end