Class: Sailpoint::Scim
Overview
Used for created SCIM API calls to the organizations IdentityIQ source
Constant Summary collapse
- EMPTY_RESPONSE =
'{}'
Class Method Summary collapse
-
.accounts ⇒ Hash
Returns a massive list of all account entries in the IdeneityIQ sources.
-
.applications ⇒ Hash
Used to fetch a list of all Applications and their associated attributes.
-
.get_user(identity) ⇒ Hash
Used to fetch the specified users associated data.
-
.resource_types ⇒ Hash
Fetch all resource types associated with the IdentityIQ API.
-
.schemas ⇒ Hash
Fetch the schemas for all resources types assocaited with the API’s returning data.
-
.service_providers ⇒ Hash
Fetch a list of all ServiceProviders associated with the data being served by the API.
-
.user_resource_types ⇒ Hash
Returns a list of data attributes for the ResourceType -> Users.
-
.users ⇒ Hash
Returns a list of all users from the associated organizations.
Class Method Details
.accounts ⇒ Hash
Returns a massive list of all account entries in the IdeneityIQ sources
14 15 16 17 18 19 20 |
# File 'lib/sailpoint/scim.rb', line 14 def self.accounts set_scim_interface response = HTTParty.get([Sailpoint.config.url, 'v2/Accounts'].join('/'), headers: Sailpoint.config.auth_header, output: 'json', timeout: 10) JSON.parse(response&.body || EMPTY_RESPONSE) end |
.applications ⇒ Hash
Used to fetch a list of all Applications and their associated attributes
24 25 26 27 28 29 30 |
# File 'lib/sailpoint/scim.rb', line 24 def self.applications set_scim_interface response = HTTParty.get([Sailpoint.config.url, 'v2/Applications'].join('/'), headers: Sailpoint.config.auth_header, output: 'json', timeout: 10) JSON.parse(response&.body || EMPTY_RESPONSE) end |
.get_user(identity) ⇒ Hash
Used to fetch the specified users associated data
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/sailpoint/scim.rb', line 34 def self.get_user(identity) set_scim_interface response = HTTParty.get([Sailpoint.config.url, 'v2/Users', identity].join('/'), headers: Sailpoint.config.auth_header, output: 'json', timeout: 10) # NOTE: If invalid credentials are supplied or the user could not be found response bodies contain a status code. # => But if a a user if found, a status code isn't returned, but all of their data attributes are returned instead. raise Sailpoint::Helpers::AuthenticationException, 'Invalid credentials, please try again.' if response.body['status'] && response.body['status'] == '401' return [].freeze if response.body && response.body['status'] && response.body['status'] == '404' JSON.parse(response&.body || EMPTY_RESPONSE) end |
.resource_types ⇒ Hash
Fetch all resource types associated with the IdentityIQ API
49 50 51 52 53 54 55 |
# File 'lib/sailpoint/scim.rb', line 49 def self.resource_types set_scim_interface response = HTTParty.get([Sailpoint.config.url, 'v2/ResourceTypes'].join('/'), headers: Sailpoint.config.auth_header, output: 'json', timeout: 10) JSON.parse(response&.body || EMPTY_RESPONSE) end |
.schemas ⇒ Hash
Fetch the schemas for all resources types assocaited with the API’s returning data
59 60 61 62 63 64 65 |
# File 'lib/sailpoint/scim.rb', line 59 def self.schemas set_scim_interface response = HTTParty.get([Sailpoint.config.url, 'v2/Schemas'].join('/'), headers: Sailpoint.config.auth_header, output: 'json', timeout: 10) JSON.parse(response&.body || EMPTY_RESPONSE) end |
.service_providers ⇒ Hash
Fetch a list of all ServiceProviders associated with the data being served by the API
69 70 71 72 73 74 75 |
# File 'lib/sailpoint/scim.rb', line 69 def self.service_providers set_scim_interface response = HTTParty.get([Sailpoint.config.url, 'v2/ServiceProviderConfig'].join('/'), headers: Sailpoint.config.auth_header, output: 'json', timeout: 10) JSON.parse(response&.body || EMPTY_RESPONSE) end |
.user_resource_types ⇒ Hash
Returns a list of data attributes for the ResourceType -> Users
89 90 91 92 93 94 95 |
# File 'lib/sailpoint/scim.rb', line 89 def self.user_resource_types set_scim_interface response = HTTParty.get([Sailpoint.config.url, 'v2/ResourceTypes/User'].join('/'), headers: Sailpoint.config.auth_header, output: 'json', timeout: 10) JSON.parse(response&.body || EMPTY_RESPONSE) end |
.users ⇒ Hash
Returns a list of all users from the associated organizations
79 80 81 82 83 84 85 |
# File 'lib/sailpoint/scim.rb', line 79 def self.users set_scim_interface response = HTTParty.get([Sailpoint.config.url, 'v2/Users'].join('/'), headers: Sailpoint.config.auth_header, output: 'json', timeout: 10) JSON.parse(response&.body || EMPTY_RESPONSE) end |