sailpoint 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/sailpoint/config.rb +5 -1
- data/lib/sailpoint/helpers.rb +4 -0
- data/lib/sailpoint/rest.rb +4 -4
- data/lib/sailpoint/scim.rb +1 -2
- data/lib/sailpoint/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6bf86899f091940b968757d594603b5db984e6d89cdd999787b873f86bfe9ed
|
4
|
+
data.tar.gz: 442bfb5d83d550d3899e029d5234bac86c710059148a69dfbf32222f4442d02f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68c0c05d8f5c6a8fb53e1eb5655ce6e4418725820703734d60e9c2579b3ed727e307a8832389340e9bc5e2fadc92117e38c91dc3036660f0146dcc793cbe30fa
|
7
|
+
data.tar.gz: 663cc39a7e2bc3a73b1de299f07fd4721334aff2eac81aca2c7249f364e2bc2082739843a6369a6cf3dc15c094c30a842a8f367622790fbf9b6cd909aa9f7803
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
+
|
1
2
|
# Sailpoint
|
2
3
|
|
4
|
+
 [](http://opensource.org/licenses/MIT)
|
5
|
+
|
6
|
+
|
3
7
|
This is an unofficial tool for interactiving with Sailpoints [IdentityIQ's](https://www.sailpoint.com/solutions/identityiq/?elqct=Website&elqchannel=OrganicDirect) API interface. This gem assumes your IdenityIQ API is setup to authenticate using [BasicAuth](https://developer.sailpoint.com/SCIM/index.html#authentication) headers. If you require credentials for your SailPoint (IdenitityIQ) interface, I suggest contacting your system administrator before continuing any farther.
|
4
8
|
|
5
9
|
**Note:** This gem doesn't include all possible IdentityIQ API requests, primarmly due to last of authorization to access much else. If you happen to have additional access to an IdentitiyIQ API it would be very much appreciated if you contributed any additional API requests.
|
data/lib/sailpoint/config.rb
CHANGED
@@ -45,11 +45,15 @@ module Sailpoint
|
|
45
45
|
end
|
46
46
|
|
47
47
|
# Used for fetching the requesting users entire URL (Host+Interface)
|
48
|
-
# @param interface [String] - used for when the user is specicically calling an API such as <code>Sailpoint::Scim.get_user('
|
48
|
+
# @param interface [String] - used for when the user is specicically calling an API such as <code>Unmh::Sailpoint::Scim.get_user('brhicks')</code>
|
49
49
|
# @return [String] - Returns the entire requesting URL (based on host and interface type)
|
50
50
|
def url(interface = '')
|
51
51
|
return '' if @host.blank? || @interface.blank?
|
52
52
|
|
53
|
+
full_host(interface)
|
54
|
+
end
|
55
|
+
|
56
|
+
def full_host(interface = '')
|
53
57
|
interface.blank? ? [trimmed_host, 'identityiq', interface_path].join('/') : [trimmed_host, 'identityiq', interface].join('/')
|
54
58
|
end
|
55
59
|
|
data/lib/sailpoint/helpers.rb
CHANGED
data/lib/sailpoint/rest.rb
CHANGED
@@ -25,7 +25,7 @@ module Sailpoint
|
|
25
25
|
|
26
26
|
# the roles attribute should either be 'Contractor,Assistant' or ['Contractor', 'Assistant']
|
27
27
|
roles = roles.join(',') if roles.is_a?(Array)
|
28
|
-
response = HTTParty.get([Sailpoint::Config.url('rest'), "policies/checkRolePolicies?identity=#{identity}&roles=#{roles}"].join('/'),
|
28
|
+
response = HTTParty.get([Sailpoint::Config.url('rest'), "policies/checkRolePolicies?identity=#{identity.escape_str}&roles=#{roles}"].join('/'),
|
29
29
|
headers: Sailpoint::Config.auth_header,
|
30
30
|
output: 'json')
|
31
31
|
JSON.parse(response&.body || '{}')
|
@@ -35,7 +35,7 @@ module Sailpoint
|
|
35
35
|
# @param identity [String] - The user in which you are requesting data for
|
36
36
|
# @return [Hash] - If no user if found an empty hash will be returned. If a a user is found, their parsed JSON will be returned as a result
|
37
37
|
def self.get_identity(identity)
|
38
|
-
response = HTTParty.get([Sailpoint::Config.url('rest'), 'identities', identity, 'managedIdentities'].join('/'),
|
38
|
+
response = HTTParty.get([Sailpoint::Config.url('rest'), 'identities', identity.escape_str, 'managedIdentities'].join('/'),
|
39
39
|
headers: Sailpoint::Config.auth_header,
|
40
40
|
output: 'json')
|
41
41
|
return [] if response.code == '500'
|
@@ -47,7 +47,7 @@ module Sailpoint
|
|
47
47
|
# @param identity [String] - The user in which you are requesting data for
|
48
48
|
# @return [Hash] - If no user if found an empty hash will be returned. If a a user is found, their parsed JSON will be returned as a result
|
49
49
|
def self.get_user(identity)
|
50
|
-
response = HTTParty.get([Sailpoint::Config.url('rest'), 'identities', identity].join('/'),
|
50
|
+
response = HTTParty.get([Sailpoint::Config.url('rest'), 'identities', identity.escape_str].join('/'),
|
51
51
|
headers: Sailpoint::Config.auth_header,
|
52
52
|
output: 'json')
|
53
53
|
raise AuthenticationException, 'Invalid credentials, please try again.' if response.code == 401
|
@@ -61,7 +61,7 @@ module Sailpoint
|
|
61
61
|
# Before requesting a users roles we need to verify if the identiy matches a valid user first
|
62
62
|
return {} if identity.blank? || get_user(identity).empty?
|
63
63
|
|
64
|
-
response = HTTParty.get([Sailpoint::Config.url('rest'), "roles/assignablePermits/?roleMode=assignable&identity=#{identity}"].join('/'),
|
64
|
+
response = HTTParty.get([Sailpoint::Config.url('rest'), "roles/assignablePermits/?roleMode=assignable&identity=#{identity.escape_str}"].join('/'),
|
65
65
|
headers: Sailpoint::Config.auth_header,
|
66
66
|
output: 'json')
|
67
67
|
response_body = JSON.parse(response&.body || '{}')
|
data/lib/sailpoint/scim.rb
CHANGED
@@ -26,8 +26,7 @@ module Sailpoint
|
|
26
26
|
# Used to fetch the specified users associated data
|
27
27
|
# @return [Hash] - The users hashed data attributes
|
28
28
|
def self.get_user(identity)
|
29
|
-
|
30
|
-
response = HTTParty.get([Sailpoint::Config.url('scim'), 'v2/Users', identity].join('/'),
|
29
|
+
response = HTTParty.get([Sailpoint::Config.url('scim'), 'v2/Users', identity.escape_str].join('/'),
|
31
30
|
headers: Sailpoint::Config.auth_header,
|
32
31
|
output: 'json')
|
33
32
|
# NOTE: If invalid credentials are supplied or the user could not be found response bodies contain a status code.
|
data/lib/sailpoint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sailpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Hicks
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|