Module: Maestrano

Defined in:
lib/maestrano/saml/metadata.rb,
lib/maestrano.rb,
lib/maestrano/sso.rb,
lib/maestrano/version.rb,
lib/maestrano/api/util.rb,
lib/maestrano/sso/user.rb,
lib/maestrano/sso/group.rb,
lib/maestrano/api/object.rb,
lib/maestrano/sso/session.rb,
lib/maestrano/account/bill.rb,
lib/maestrano/api/resource.rb,
lib/maestrano/saml/request.rb,
lib/maestrano/saml/response.rb,
lib/maestrano/saml/settings.rb,
lib/maestrano/sso/base_user.rb,
lib/maestrano/sso/base_group.rb,
lib/maestrano/api/list_object.rb,
lib/maestrano/api/operation/base.rb,
lib/maestrano/api/operation/list.rb,
lib/maestrano/sso/base_membership.rb,
lib/maestrano/api/error/base_error.rb,
lib/maestrano/api/operation/create.rb,
lib/maestrano/api/operation/delete.rb,
lib/maestrano/api/operation/update.rb,
lib/maestrano/saml/attribute_value.rb,
lib/maestrano/saml/validation_error.rb,
lib/maestrano/account/recurring_bill.rb,
lib/maestrano/api/error/connection_error.rb,
lib/maestrano/xml_security/signed_document.rb,
lib/maestrano/api/error/authentication_error.rb,
lib/maestrano/api/error/invalid_request_error.rb

Overview

Only supports SAML 2.0

Defined Under Namespace

Modules: API, Account, SSO, Saml, XMLSecurity Classes: Configuration

Constant Summary collapse

VERSION =
'0.5.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



54
55
56
# File 'lib/maestrano.rb', line 54

def config
  @config
end

Class Method Details

.authenticate(app_id, api_key) ⇒ Object

Check that app_id and api_key passed in argument match



66
67
68
# File 'lib/maestrano.rb', line 66

def self.authenticate(app_id,api_key)
  self.param(:app_id) == app_id && self.param(:api_key) == api_key
end

.configure {|config| ... } ⇒ Object

Maestrano Configuration block

Yields:



58
59
60
61
62
# File 'lib/maestrano.rb', line 58

def self.configure
  self.config ||= Configuration.new
  yield(config)
  self.config.api_token = "#{self.config.app_id}:#{self.config.api_key}"
end

.mask_user(user_uid, group_uid) ⇒ Object



70
71
72
73
74
75
76
77
# File 'lib/maestrano.rb', line 70

def self.mask_user(user_uid,group_uid)
  sanitized_user_uid = self.unmask_user(user_uid)
  if Maestrano.param('user_creation_mode') == 'virtual'
    return "#{sanitized_user_uid}.#{group_uid}"
  else
    return sanitized_user_uid
  end
end

.param(parameter) ⇒ Object

Get configuration parameter value E.g: Maestrano.param(‘api_key’) Maestrano.param(:api_key)



87
88
89
# File 'lib/maestrano.rb', line 87

def self.param(parameter)
  self.config.param(parameter)
end

.unmask_user(user_uid) ⇒ Object



79
80
81
# File 'lib/maestrano.rb', line 79

def self.unmask_user(user_uid)
  user_uid.split(".").first
end