oktakit 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.rubocop.yml +84 -0
- data/.travis.yml +6 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/Rakefile +19 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/dev.yml +11 -0
- data/lib/oktakit.rb +8 -0
- data/lib/oktakit/client.rb +165 -0
- data/lib/oktakit/client/admin_roles.rb +160 -0
- data/lib/oktakit/client/apps.rb +363 -0
- data/lib/oktakit/client/events.rb +20 -0
- data/lib/oktakit/client/factors.rb +223 -0
- data/lib/oktakit/client/groups.rb +149 -0
- data/lib/oktakit/client/identity_providers.rb +274 -0
- data/lib/oktakit/client/schemas.rb +65 -0
- data/lib/oktakit/client/templates.rb +99 -0
- data/lib/oktakit/client/users.rb +290 -0
- data/lib/oktakit/error.rb +166 -0
- data/lib/oktakit/response/raise_error.rb +19 -0
- data/lib/oktakit/version.rb +3 -0
- data/oktakit.gemspec +25 -0
- metadata +101 -0
@@ -0,0 +1,149 @@
|
|
1
|
+
module Oktakit
|
2
|
+
class Client
|
3
|
+
module Groups
|
4
|
+
# Add Group
|
5
|
+
#
|
6
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
7
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
8
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
9
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
10
|
+
# @param options [Hash] Optional. Body params for request.
|
11
|
+
# @return [Hash<Sawyer::Resource>] The created Group.
|
12
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#add-group
|
13
|
+
# @example
|
14
|
+
# Oktakit.add_group
|
15
|
+
def add_group(options = {})
|
16
|
+
post('/groups', options)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Get Group
|
20
|
+
#
|
21
|
+
# @params id [string] Group ID
|
22
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
23
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
24
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
25
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
26
|
+
# @param options [Hash] Optional. Body params for request.
|
27
|
+
# @return [Hash<Sawyer::Resource>] Fetched Group
|
28
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#get-group
|
29
|
+
# @example
|
30
|
+
# Oktakit.get_group('id')
|
31
|
+
def get_group(id, options = {})
|
32
|
+
get("/groups/#{id}", options)
|
33
|
+
end
|
34
|
+
|
35
|
+
# List Groups
|
36
|
+
#
|
37
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
38
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
39
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
40
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
41
|
+
# @param options [Hash] Optional. Body params for request.
|
42
|
+
# @return [Array<Sawyer::Resource>] Array of Groups
|
43
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#list-groups
|
44
|
+
# @example
|
45
|
+
# Oktakit.list_groups
|
46
|
+
def list_groups(options = {})
|
47
|
+
get('/groups', options)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Update Group
|
51
|
+
#
|
52
|
+
# @params id [string] Group ID
|
53
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
54
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
55
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
56
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
57
|
+
# @param options [Hash] Optional. Body params for request.
|
58
|
+
# @return [Hash<Sawyer::Resource>] Updated Group
|
59
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#update-group
|
60
|
+
# @example
|
61
|
+
# Oktakit.update_group('id')
|
62
|
+
def update_group(id, options = {})
|
63
|
+
put("/groups/#{id}", options)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Remove Group
|
67
|
+
#
|
68
|
+
# @params id [string] Group ID
|
69
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
70
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
71
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
72
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
73
|
+
# @param options [Hash] Optional. Body params for request.
|
74
|
+
# @return HTTP 204 No Content
|
75
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#remove-group
|
76
|
+
# @example
|
77
|
+
# Oktakit.remove_group('id')
|
78
|
+
def remove_group(id, options = {})
|
79
|
+
delete("/groups/#{id}", options)
|
80
|
+
end
|
81
|
+
|
82
|
+
# List Group Members
|
83
|
+
#
|
84
|
+
# @params id [string] Group ID
|
85
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
86
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
87
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
88
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
89
|
+
# @param options [Hash] Optional. Body params for request.
|
90
|
+
# @return [Array<Sawyer::Resource>] Array of Users
|
91
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#list-group-members
|
92
|
+
# @example
|
93
|
+
# Oktakit.list_group_members('id')
|
94
|
+
def list_group_members(id, options = {})
|
95
|
+
get("/groups/#{id}/users", options)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Add User to Group
|
99
|
+
#
|
100
|
+
# @params group_id [string] Group ID
|
101
|
+
# @params user_id [string] User ID
|
102
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
103
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
104
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
105
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
106
|
+
# @param options [Hash] Optional. Body params for request.
|
107
|
+
# @return HTTP 204 No Content
|
108
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#add-user-to-group
|
109
|
+
# @example
|
110
|
+
# Oktakit.add_user_to_group('group_id', 'user_id')
|
111
|
+
def add_user_to_group(group_id, user_id, options = {})
|
112
|
+
put("/groups/#{group_id}/users/#{user_id}", options)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Remove User from Group
|
116
|
+
#
|
117
|
+
# @params group_id [string] Group ID
|
118
|
+
# @params user_id [string] User ID
|
119
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
120
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
121
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
122
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
123
|
+
# @param options [Hash] Optional. Body params for request.
|
124
|
+
# @return HTTP 204 No Content
|
125
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#remove-user-from-group
|
126
|
+
# @example
|
127
|
+
# Oktakit.remove_user_from_group('group_id', 'user_id')
|
128
|
+
def remove_user_from_group(group_id, user_id, options = {})
|
129
|
+
delete("/groups/#{group_id}/users/#{user_id}", options)
|
130
|
+
end
|
131
|
+
|
132
|
+
# List Assigned Applications
|
133
|
+
#
|
134
|
+
# @params id [string] Group ID
|
135
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
136
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
137
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
138
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
139
|
+
# @param options [Hash] Optional. Body params for request.
|
140
|
+
# @return [Array<Sawyer::Resource>] Array of Applications
|
141
|
+
# @see http://developer.okta.com/docs/api/resources/groups.html#list-assigned-applications
|
142
|
+
# @example
|
143
|
+
# Oktakit.list_assigned_applications('id')
|
144
|
+
def list_assigned_applications(id, options = {})
|
145
|
+
get("/groups/#{id}/apps", options)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,274 @@
|
|
1
|
+
module Oktakit
|
2
|
+
class Client
|
3
|
+
module IdentityProviders
|
4
|
+
# Add Identity Provider
|
5
|
+
#
|
6
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
7
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
8
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
9
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
10
|
+
# @param options [Hash] Optional. Body params for request.
|
11
|
+
# @return [Hash<Sawyer::Resource>] The created Identity Provider
|
12
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#add-identity-provider
|
13
|
+
# @example
|
14
|
+
# Oktakit.add_identity_provider
|
15
|
+
def add_identity_provider(options = {})
|
16
|
+
post('/idps', options)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Get Identity Provider
|
20
|
+
#
|
21
|
+
# @params id [string] IDPS ID
|
22
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
23
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
24
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
25
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
26
|
+
# @param options [Hash] Optional. Body params for request.
|
27
|
+
# @return [Hash<Sawyer::Resource>] Identity Provider
|
28
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#get-identity-provider
|
29
|
+
# @example
|
30
|
+
# Oktakit.get_identity_provider('id')
|
31
|
+
def get_identity_provider(id, options = {})
|
32
|
+
get("/idps/#{id}", options)
|
33
|
+
end
|
34
|
+
|
35
|
+
# List Identity Providers
|
36
|
+
#
|
37
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
38
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
39
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
40
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
41
|
+
# @param options [Hash] Optional. Body params for request.
|
42
|
+
# @return [Array<Sawyer::Resource>] Array of Identity Provider
|
43
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#list-identity-providers
|
44
|
+
# @example
|
45
|
+
# Oktakit.list_identity_providers
|
46
|
+
def list_identity_providers(options = {})
|
47
|
+
get('/idps', options)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Update Identity Provider
|
51
|
+
#
|
52
|
+
# @params id [string] IDPS ID
|
53
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
54
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
55
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
56
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
57
|
+
# @param options [Hash] Optional. Body params for request.
|
58
|
+
# @return [Hash<Sawyer::Resource>] Updated Identity Provider
|
59
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#update-identity-provider
|
60
|
+
# @example
|
61
|
+
# Oktakit.update_identity_provider('id')
|
62
|
+
def update_identity_provider(id, options = {})
|
63
|
+
put("/idps/#{id}", options)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Delete Identity Provider
|
67
|
+
#
|
68
|
+
# @params id [string] IDPS ID
|
69
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
70
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
71
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
72
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
73
|
+
# @param options [Hash] Optional. Body params for request.
|
74
|
+
# @return HTTP 204 No Content
|
75
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#delete-identity-provider
|
76
|
+
# @example
|
77
|
+
# Oktakit.delete_identity_provider('id')
|
78
|
+
def delete_identity_provider(id, options = {})
|
79
|
+
delete("/idps/#{id}", options)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Activate Identity Provider
|
83
|
+
#
|
84
|
+
# @params id [string] IDPS ID
|
85
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
86
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
87
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
88
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
89
|
+
# @param options [Hash] Optional. Body params for request.
|
90
|
+
# @return [Hash<Sawyer::Resource>] Activated Identity Provider
|
91
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#activate-identity-provider
|
92
|
+
# @example
|
93
|
+
# Oktakit.activate_identity_provider('id')
|
94
|
+
def activate_identity_provider(id, options = {})
|
95
|
+
post("/idps/#{id}/lifecycle/activate", options)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Deactivate Identity Provider
|
99
|
+
#
|
100
|
+
# @params id [string] IDPS ID
|
101
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
102
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
103
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
104
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
105
|
+
# @param options [Hash] Optional. Body params for request.
|
106
|
+
# @return [Hash<Sawyer::Resource>] Deactivated Identity Provider
|
107
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#deactivate-identity-provider
|
108
|
+
# @example
|
109
|
+
# Oktakit.deactivate_identity_provider('id')
|
110
|
+
def deactivate_identity_provider(id, options = {})
|
111
|
+
post("/idps/#{id}/lifecycle/deactivate", options)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Get Identity Provider Transaction
|
115
|
+
#
|
116
|
+
# @params transaction_id [string] Transaction ID
|
117
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
118
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
119
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
120
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
121
|
+
# @param options [Hash] Optional. Body params for request.
|
122
|
+
# @return [Hash<Sawyer::Resource>] Identity Provider Transaction
|
123
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#get-identity-provider-transaction
|
124
|
+
# @example
|
125
|
+
# Oktakit.get_identity_provider_transaction('transaction_id')
|
126
|
+
def get_identity_provider_transaction(transaction_id, options = {})
|
127
|
+
get("/idps/tx/#{transaction_id}", options)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Get Source IdP User for IdP Transaction
|
131
|
+
#
|
132
|
+
# @params transaction_id [string] Transaction ID
|
133
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
134
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
135
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
136
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
137
|
+
# @param options [Hash] Optional. Body params for request.
|
138
|
+
# @return [Hash<Sawyer::Resource>] Identity Provider User
|
139
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#get-source-idp-user-for-idp-transaction
|
140
|
+
# @example
|
141
|
+
# Oktakit.get_source_idp_user_for_idp_transaction('transaction_id')
|
142
|
+
def get_source_idp_user_for_idp_transaction(transaction_id, options = {})
|
143
|
+
get("/idps/tx/#{transaction_id}/source", options)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Get Target User for IdP Provision Transaction
|
147
|
+
#
|
148
|
+
# @params transaction_id [string] Transaction ID
|
149
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
150
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
151
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
152
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
153
|
+
# @param options [Hash] Optional. Body params for request.
|
154
|
+
# @return [Hash<Sawyer::Resource>] Trasformed Okta User Profile
|
155
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#get-target-user-for-idp-provision-transaction
|
156
|
+
# @example
|
157
|
+
# Oktakit.get_target_user_for_idp_provision_transaction('transaction_id')
|
158
|
+
def get_target_user_for_idp_provision_transaction(transaction_id, options = {})
|
159
|
+
get("/idps/tx/#{transaction_id}/target", options)
|
160
|
+
end
|
161
|
+
|
162
|
+
# List Users for IdP Link Transaction
|
163
|
+
#
|
164
|
+
# @params transaction_id [string] Transaction ID
|
165
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
166
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
167
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
168
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
169
|
+
# @param options [Hash] Optional. Body params for request.
|
170
|
+
# @return [Array<Sawyer::Resource>] Array of Okta User
|
171
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#list-users-for-idp-link-transaction
|
172
|
+
# @example
|
173
|
+
# Oktakit.list_users_for_idp_link_transaction('transaction_id')
|
174
|
+
def list_users_for_idp_link_transaction(transaction_id, options = {})
|
175
|
+
get("/idps/tx/#{transaction_id}/users", options)
|
176
|
+
end
|
177
|
+
|
178
|
+
# Provision IdP User
|
179
|
+
#
|
180
|
+
# @params transaction_id [string] Transaction ID
|
181
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
182
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
183
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
184
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
185
|
+
# @param options [Hash] Optional. Body params for request.
|
186
|
+
# @return [Hash<Sawyer::Resource>] Identity Provider Transaction
|
187
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#provision-idp-user
|
188
|
+
# @example
|
189
|
+
# Oktakit.provision_idp_user('transaction_id')
|
190
|
+
def provision_idp_user(transaction_id, options = {})
|
191
|
+
post("/idps/tx/#{transaction_id}/lifecycle/provision", options)
|
192
|
+
end
|
193
|
+
|
194
|
+
# Link IdP User
|
195
|
+
#
|
196
|
+
# @params transaction_id [string] Transaction ID
|
197
|
+
# @params user_id [string] User ID
|
198
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
199
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
200
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
201
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
202
|
+
# @param options [Hash] Optional. Body params for request.
|
203
|
+
# @return [Hash<Sawyer::Resource>] Identity Provider Transaction
|
204
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#link-idp-user
|
205
|
+
# @example
|
206
|
+
# Oktakit.link_idp_user('user_id', 'transaction_id')
|
207
|
+
def link_idp_user(transaction_id, user_id, options = {})
|
208
|
+
post("/idps/tx/#{transaction_id}/lifecycle/confirm/#{user_id}", options)
|
209
|
+
end
|
210
|
+
|
211
|
+
# Add X.509 Certificate Public Key
|
212
|
+
#
|
213
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
214
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
215
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
216
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
217
|
+
# @param options [Hash] Optional. Body params for request.
|
218
|
+
# @return [Hash<Sawyer::Resource>] Identity Provider Key Credential
|
219
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#add-x509-certificate-public-key
|
220
|
+
# @example
|
221
|
+
# Oktakit.add_x509_certificate_public_key
|
222
|
+
def add_x509_certificate_public_key(options = {})
|
223
|
+
post('/idps/credentials/keys', options)
|
224
|
+
end
|
225
|
+
|
226
|
+
# Get Key
|
227
|
+
#
|
228
|
+
# @params key_id [string] Key ID
|
229
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
230
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
231
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
232
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
233
|
+
# @param options [Hash] Optional. Body params for request.
|
234
|
+
# @return [Hash<Sawyer::Resource>] Identity Provider Key Credential
|
235
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#get-key
|
236
|
+
# @example
|
237
|
+
# Oktakit.get_key('key_id')
|
238
|
+
def get_key(key_id, options = {})
|
239
|
+
get("/idps/credentials/keys/#{key_id}", options)
|
240
|
+
end
|
241
|
+
|
242
|
+
# List Keys
|
243
|
+
#
|
244
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
245
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
246
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
247
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
248
|
+
# @param options [Hash] Optional. Body params for request.
|
249
|
+
# @return [Array<Sawyer::Resource>] Array of Identity Provider Key Credential
|
250
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#list-keys
|
251
|
+
# @example
|
252
|
+
# Oktakit.list_keys
|
253
|
+
def list_keys(options = {})
|
254
|
+
get('/idps/credentials/keys', options)
|
255
|
+
end
|
256
|
+
|
257
|
+
# Delete Key
|
258
|
+
#
|
259
|
+
# @params key_id [string] Key ID
|
260
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
261
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
262
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
263
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
264
|
+
# @param options [Hash] Optional. Body params for request.
|
265
|
+
# @return HTTP 204 No Content
|
266
|
+
# @see http://developer.okta.com/docs/api/resources/idps.html#delete-key
|
267
|
+
# @example
|
268
|
+
# Oktakit.delete_key('key_id')
|
269
|
+
def delete_key(key_id, options = {})
|
270
|
+
delete("/idps/credentials/keys/#{key_id}", options)
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module Oktakit
|
2
|
+
class Client
|
3
|
+
module Schemas
|
4
|
+
# Get User Schema
|
5
|
+
#
|
6
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
7
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
8
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
9
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
10
|
+
# @param options [Hash] Optional. Body params for request.
|
11
|
+
# @return [Hash<Sawyer::Resource>] User Schema
|
12
|
+
# @see http://developer.okta.com/docs/api/resources/schemas.html#get-user-schema
|
13
|
+
# @example
|
14
|
+
# Oktakit.get_user_schema
|
15
|
+
def get_user_schema(options = {})
|
16
|
+
get('/meta/schemas/user/default', options)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Add Property to User Profile Schema
|
20
|
+
#
|
21
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
22
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
23
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
24
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
25
|
+
# @param options [Hash] Optional. Body params for request.
|
26
|
+
# @return [Hash<Sawyer::Resource>] User Schema
|
27
|
+
# @see http://developer.okta.com/docs/api/resources/schemas.html#add-property-to-user-profile-schema
|
28
|
+
# @example
|
29
|
+
# Oktakit.add_property_to_user_profile_schema
|
30
|
+
def add_property_to_user_profile_schema(options = {})
|
31
|
+
post('/meta/schemas/user/default', options)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Update User Profile Schema Property
|
35
|
+
#
|
36
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
37
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
38
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
39
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
40
|
+
# @param options [Hash] Optional. Body params for request.
|
41
|
+
# @return [Hash<Sawyer::Resource>] User Schema
|
42
|
+
# @see http://developer.okta.com/docs/api/resources/schemas.html#update-user-profile-schema-property
|
43
|
+
# @example
|
44
|
+
# Oktakit.update_user_profile_schema_property
|
45
|
+
def update_user_profile_schema_property(options = {})
|
46
|
+
post('/meta/schemas/user/default', options)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Remove Property from User Profile Schema
|
50
|
+
#
|
51
|
+
# @param options[:query] [Hash] Optional. Query params for request
|
52
|
+
# @param options[:headers] [Hash] Optional. Header params for the request.
|
53
|
+
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
|
54
|
+
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
|
55
|
+
# @param options [Hash] Optional. Body params for request.
|
56
|
+
# @return [Hash<Sawyer::Resource>] User Schema
|
57
|
+
# @see http://developer.okta.com/docs/api/resources/schemas.html#remove-property-from-user-profile-schema
|
58
|
+
# @example
|
59
|
+
# Oktakit.remove_property_from_user_profile_schema
|
60
|
+
def remove_property_from_user_profile_schema(options = {})
|
61
|
+
post('/meta/schemas/user/default', options)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|