Sha256: 08c38b3bc31923b25ec3f5029508b8c07a9449f9d407e375e2755719e3c2bda7

Contents?: true

Size: 1.11 KB

Versions: 33

Compression:

Stored size: 1.11 KB

Contents

require "saml/kit/bindings/binding"
require "saml/kit/bindings/http_post"
require "saml/kit/bindings/http_redirect"
require "saml/kit/bindings/url_builder"

module Saml
  module Kit
    module Bindings
      HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact'
      HTTP_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
      HTTP_REDIRECT = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
      ALL = {
        http_post: HTTP_POST,
        http_redirect: HTTP_REDIRECT,
        http_artifact: HTTP_ARTIFACT,
      }

      def self.binding_for(binding)
        ALL[binding]
      end

      def self.to_symbol(binding)
        case binding
        when HTTP_REDIRECT
          :http_redirect
        when HTTP_POST
          :http_post
        else
          binding
        end
      end

      def self.create_for(binding, location)
        case binding
        when HTTP_REDIRECT
          HttpRedirect.new(location: location)
        when HTTP_POST
          HttpPost.new(location: location)
        else
          Binding.new(binding: binding, location: location)
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
saml-kit-1.0.6 lib/saml/kit/bindings.rb
saml-kit-1.0.5 lib/saml/kit/bindings.rb
saml-kit-1.0.4 lib/saml/kit/bindings.rb
saml-kit-1.0.3 lib/saml/kit/bindings.rb
saml-kit-1.0.2 lib/saml/kit/bindings.rb
saml-kit-1.0.1 lib/saml/kit/bindings.rb
saml-kit-1.0.0 lib/saml/kit/bindings.rb
saml-kit-0.3.6 lib/saml/kit/bindings.rb
saml-kit-0.3.5 lib/saml/kit/bindings.rb
saml-kit-0.3.4 lib/saml/kit/bindings.rb
saml-kit-0.3.3 lib/saml/kit/bindings.rb
saml-kit-0.3.2 lib/saml/kit/bindings.rb
saml-kit-0.3.1 lib/saml/kit/bindings.rb
saml-kit-0.3.0 lib/saml/kit/bindings.rb
saml-kit-0.2.18 lib/saml/kit/bindings.rb
saml-kit-0.2.17 lib/saml/kit/bindings.rb
saml-kit-0.2.16 lib/saml/kit/bindings.rb
saml-kit-0.2.15 lib/saml/kit/bindings.rb
saml-kit-0.2.14 lib/saml/kit/bindings.rb
saml-kit-0.2.13 lib/saml/kit/bindings.rb