module Saml

Constants

ATTR_EXT_NAMESPACE
MD_ATTR_NAMESPACE
MD_NAMESPACE
MD_RPI_NAMESPACE
SAMLP_NAMESPACE
SAML_NAMESPACE
SAML_VERSION
VERSION
XML_DSIG_NAMESPACE
XSI_NAMESPACE
XS_NAMESPACE

Public Class Methods

current_provider() click to toggle source
# File lib/saml.rb, line 236
def self.current_provider
  Thread.current['saml_current_provider'] || NullProvider.new
end
current_provider=(provider) click to toggle source
# File lib/saml.rb, line 240
def self.current_provider=(provider)
  Thread.current['saml_current_provider'] = provider
end
current_store() click to toggle source
# File lib/saml.rb, line 244
def self.current_store
  store_name = Thread.current['saml_current_store']
  Saml::Config.registered_stores[store_name] ||
      Saml::Config.registered_stores[Saml::Config.default_store] ||
      raise(Errors::InvalidStore.new(store_name))
end
current_store=(store_name) click to toggle source
# File lib/saml.rb, line 251
def self.current_store=(store_name)
  Thread.current['saml_current_store'] = store_name
end
generate_id() click to toggle source
# File lib/saml.rb, line 259
def self.generate_id
  "_#{::SecureRandom.hex(20)}"
end
parse_message(message, type) click to toggle source
# File lib/saml.rb, line 271
def self.parse_message(message, type)
  if %w(authn_request response logout_request logout_response artifact_resolve artifact_response).include?(type.to_s)
    klass = "Saml::#{type.to_s.camelize}".constantize
    klass.parse(message, single: true)
  elsif klass = type.to_s.camelize.safe_constantize
    klass.parse(message, single: true)
  else
    nil
  end
end
provider(entity_id) click to toggle source
# File lib/saml.rb, line 263
def self.provider(entity_id)
  if current_provider && current_provider.entity_id == entity_id
    current_provider
  else
    current_store.find_by_entity_id(entity_id) || raise(Saml::Errors::InvalidProvider.new("Cannot find provider with entity_id: #{entity_id}"))
  end
end
setup() { |Config| ... } click to toggle source
# File lib/saml.rb, line 255
def self.setup
  yield Saml::Config
end