Sha256: 1ee4201907881aa6a39313c3ad99bffa3f3e02b4c013cbed985e27ddd29f5ed7

Contents?: true

Size: 1.31 KB

Versions: 11

Compression:

Stored size: 1.31 KB

Contents

module Saml
  module Kit
    module Builders
      class Metadata
        include Templatable

        attr_accessor :entity_id
        attr_accessor :id
        attr_accessor :identity_provider
        attr_accessor :organization_name, :organization_url, :contact_email
        attr_accessor :service_provider
        attr_reader :configuration

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

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

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

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

        private

        def entity_descriptor_options
          {
            'xmlns': Namespaces::METADATA,
            'xmlns:ds': Namespaces::XMLDSIG,
            'xmlns:saml': Namespaces::ASSERTION,
            ID: id,
            entityID: entity_id,
          }
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
saml-kit-0.2.17 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.16 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.15 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.14 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.13 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.12 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.11 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.10 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.9 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.8 lib/saml/kit/builders/metadata.rb
saml-kit-0.2.7 lib/saml/kit/builders/metadata.rb