Module: Sailpoint
- Defined in:
- lib/sailpoint/rest.rb,
lib/sailpoint.rb,
lib/sailpoint/scim.rb,
lib/sailpoint/helpers.rb,
lib/sailpoint/version.rb,
lib/sailpoint/configuration.rb
Overview
Used for setting you Sailpoint API configuration and credentials
Defined Under Namespace
Classes: Configuration, Error, Helpers, Rest, Scim
Constant Summary collapse
- RUBY_VERSION =
The minimum required RUBY_VERSION
'2.5'
- VERSION =
'0.1.0'
Class Method Summary collapse
- .config ⇒ Object
- .configure {|config| ... } ⇒ Object
-
.get_user(username = '') ⇒ Hash
If a valid username and URL have been supplied a lookup requests will be send to determine if the user exists in the specified interface.
-
.mutex ⇒ Mutex
Used to memorize and create a Mutex to keep config in sync across running threads.
-
.valid_credentials? ⇒ Boolean
Used to verify if any credentails were supplied for the API request.
-
.valid_interface_type?(interface = nil) ⇒ Boolean
Used to verify if the specifed interface type is valid for the Sailpoint API.
-
.valid_url? ⇒ Boolean
Used to verify if the URL string is blank or a URL was supplied.
Class Method Details
.config ⇒ Object
16 17 18 |
# File 'lib/sailpoint.rb', line 16 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
66 67 68 69 |
# File 'lib/sailpoint.rb', line 66 def configure self.config ||= config yield(config) end |
.get_user(username = '') ⇒ Hash
If a valid username and URL have been supplied a lookup requests will be send to determine if the user exists in the specified interface
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/sailpoint.rb', line 30 def get_user(username = '') raise ArgumentError, 'An invalid user lookup was specified.' if username.blank? raise ArgumentError, 'Please specify a valid HOST/Interface before attemping a lookup.' unless valid_url? raise ArgumentError, 'Valid credentials are required before attempting an API request.' unless valid_credentials? raise ArgumentError, 'Invalid interface type' unless valid_interface_type?(config.interface) if config.interface.blank? Sailpoint::Scim.get_user(username) else Object.const_get("Sailpoint::#{config.interface&.capitalize}").get_user(username) end end |
.mutex ⇒ Mutex
Used to memorize and create a Mutex to keep config in sync across running threads
23 24 25 |
# File 'lib/sailpoint.rb', line 23 def mutex @mutex ||= Mutex.new end |
.valid_credentials? ⇒ Boolean
Used to verify if any credentails were supplied for the API request
45 46 47 48 49 |
# File 'lib/sailpoint.rb', line 45 def valid_credentials? return false if Sailpoint.config.username.blank? && Sailpoint.config.password.blank? !Sailpoint.config.hashed_credentials.blank? end |
.valid_interface_type?(interface = nil) ⇒ Boolean
Used to verify if the specifed interface type is valid for the Sailpoint API
54 55 56 57 58 |
# File 'lib/sailpoint.rb', line 54 def valid_interface_type?(interface = nil) return false if interface.blank? Sailpoint::Configuration::ALLOWED_INTERFACES.include?(interface) end |