module Sailpoint

Used for setting you Sailpoint API configuration and credentials

Used for creating Sailpoint RESTS requests

Used for creating Sailpoint SCIM requests

Constants

RUBY_VERSION

The minimum required RUBY_VERSION

VERSION

Public Class Methods

config() click to toggle source
# File lib/sailpoint.rb, line 16
def config
  @config ||= Configuration.new
end
configure() { |config| ... } click to toggle source
# File lib/sailpoint.rb, line 66
def configure
  self.config ||= config
  yield(config)
end
get_user(username = '') click to toggle source

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 @param username [String] - the username that we are going to valid exists in the IdentityIQ listing @return [Hash] - If a user is found, it will return all the that identities attributes

# 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() click to toggle source

Used to memorize and create a Mutex to keep config in sync across running threads

@return [Mutex]

# File lib/sailpoint.rb, line 23
def mutex
  @mutex ||= Mutex.new
end
valid_credentials?() click to toggle source

Used to verify if any credentails were supplied for the API request @return [Boolean] if credentials were supplied or not

# 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) click to toggle source

Used to verify if the specifed interface type is valid for the Sailpoint API @param interface [String] - A specified API interface endpoint, that can either be `Rest` or `Scim` @return [Boolean] - Returns weither the specifed interface is a a valid type allowed by the API.

# File lib/sailpoint.rb, line 54
def valid_interface_type?(interface = nil)
  return false if interface.blank?

  Sailpoint::Configuration::ALLOWED_INTERFACES.include?(interface)
end
valid_url?() click to toggle source

Used to verify if the URL string is blank or a URL was supplied @return [Boolean] - if a url for the API endpoint was supplied or not

# File lib/sailpoint.rb, line 62
def valid_url?
  !Sailpoint.config.url.blank?
end