Sha256: a43b8b1a56dc7678c9082abc9a54f5792f9ec7c10aa5fa00bd4b68b222be11f1
Contents?: true
Size: 1.29 KB
Versions: 16
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true 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 # This module is responsible for exposing # the different SAML bindings that are # supported by this gem. module Bindings BINDINGS_2_0 = 'urn:oasis:names:tc:SAML:2.0:bindings'.freeze HTTP_ARTIFACT = "#{BINDINGS_2_0}:HTTP-Artifact".freeze HTTP_POST = "#{BINDINGS_2_0}:HTTP-POST".freeze HTTP_REDIRECT = "#{BINDINGS_2_0}:HTTP-Redirect".freeze ALL = { http_post: HTTP_POST, http_redirect: HTTP_REDIRECT, http_artifact: HTTP_ARTIFACT, }.freeze 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
16 entries across 16 versions & 1 rubygems