Sha256: d806970763d97d906d955857bad4fd853afd46162a396c726d8d217a6050d0f5

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

require 'saml2/bindings/http_redirect'

module SAML2
  class Endpoint < Base
    module Bindings
      HTTP_POST     = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST".freeze
      HTTP_REDIRECT = ::SAML2::Bindings::HTTPRedirect::URN
    end

    attr_reader :location, :binding

    def initialize(location = nil, binding = Bindings::HTTP_POST)
      @location, @binding = location, binding
    end

    def ==(rhs)
      location == rhs.location && binding == rhs.binding
    end

    def from_xml(node)
      super
      @location = node['Location']
      @binding = node['Binding']
    end

    def build(builder, element)
      builder['md'].__send__(element, 'Location' => location, 'Binding' => binding)
    end

    class Indexed < Endpoint
      include IndexedObject

      def initialize(location = nil, index = nil, is_default = nil, binding = Bindings::HTTP_POST)
        super(location, binding)
        @index, @is_default = index, is_default
      end

      def eql?(rhs)
        location == rhs.location &&
            binding == rhs.binding && super
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
saml2-1.1.3 lib/saml2/endpoint.rb
saml2-1.1.2 lib/saml2/endpoint.rb
saml2-1.1.1 lib/saml2/endpoint.rb
saml2-1.1.0 lib/saml2/endpoint.rb