Module: Sailpoint
- Defined in:
- lib/sailpoint.rb,
lib/sailpoint/rest.rb,
lib/sailpoint/scim.rb,
lib/sailpoint/config.rb,
lib/sailpoint/version.rb
Overview
Used for setting you Sailpoint API configuration and credentials
Defined Under Namespace
Classes: Config, Error, Rest, Scim
Constant Summary collapse
- RUBY_VERSION =
The minimum required RUBY_VERSION
'2.5'.freeze
- VERSION =
The Sailpoints version
'0.0.2'.freeze
Class Method Summary collapse
-
.get_user(username, interface: nil) ⇒ 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.
-
.set_credentials(username, password) ⇒ Object
Assign the credentials for accessing the IdentityIQ API.
-
.set_host(host) ⇒ Object
Assign the IdentityIQ API base URL.
-
.valid_credentials? ⇒ Boolean
Used to verify if any credentails were supplied for the API request.
-
.valid_interface_type?(interface) ⇒ 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
.get_user(username, interface: nil) ⇒ 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
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/sailpoint.rb', line 15 def self.get_user(username, interface: nil) raise ArgumentError, 'An invalid user lookup was specified.' if username.to_s.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 method type' unless valid_interface_type?(interface) || valid_interface_type?(Sailpoint::Config.interface) if interface.nil? Object.const_get("Sailpoint::#{Sailpoint::Config.interface.capitalize}").get_user(username) elsif valid_interface_type?(interface) Object.const_get("Sailpoint::#{interface.capitalize}").get_user(username) end end |
.set_credentials(username, password) ⇒ Object
Assign the credentials for accessing the IdentityIQ API
31 32 33 |
# File 'lib/sailpoint.rb', line 31 def self.set_credentials(username, password) Sailpoint::Config.set_credentials(username, password) unless username.nil? && password.nil? end |
.set_host(host) ⇒ Object
Assign the IdentityIQ API base URL
37 38 39 |
# File 'lib/sailpoint.rb', line 37 def self.set_host(host) Sailpoint::Config.host = host unless host.blank? end |
.valid_credentials? ⇒ Boolean
Used to verify if any credentails were supplied for the API request
43 44 45 46 47 |
# File 'lib/sailpoint.rb', line 43 def self.valid_credentials? return false if Sailpoint::Config.username.blank? && Sailpoint::Config.password.blank? !Sailpoint::Config.hashed_credentials.blank? end |
.valid_interface_type?(interface) ⇒ Boolean
Used to verify if the specifed interface type is valid for the Sailpoint API
52 53 54 |
# File 'lib/sailpoint.rb', line 52 def self.valid_interface_type?(interface) %w[rest scim].include?(interface) end |
.valid_url? ⇒ Boolean
Used to verify if the URL string is blank or a URL was supplied
58 59 60 |
# File 'lib/sailpoint.rb', line 58 def self.valid_url? !Sailpoint::Config.url.blank? end |