Module: Simpleokta::Client::AuthServers
- Included in:
- Simpleokta::Client
- Defined in:
- lib/simpleokta/auth_servers.rb
Instance Method Summary collapse
-
#activate_auth_server(auth_server_id) ⇒ Object
Activate an Authorization Server in the okta instance.
-
#auth_server(auth_server_id) ⇒ Hash<Authorization Server Object>
Get an Authorization Server in the okta instance.
-
#auth_servers ⇒ Array<Authorization Server Object>
Return all Authorization Servers in the okta instance.
-
#create_auth_server(auth_server_data) ⇒ Hash<Authorization Server Object>
Create an Authorization Server in the okta instance.
-
#create_policy(auth_server_id, policy_data) ⇒ Hash<Policy Object>
Create a Policy for a given Authorization Server.
-
#deactivate_auth_server(auth_server_id) ⇒ Object
Deactivate an Authorization Server in the okta instance.
-
#delete_auth_server(auth_server_id) ⇒ Object
Delete an Authorization Server in the okta instance.
-
#delete_policy(auth_server_id, policy_id) ⇒ Object
Delete a Policy for a given Authorization Server.
-
#policies(auth_server_id) ⇒ Array<Policy Object>
Return all Policies attached to a given Authorization Server in the okta instance.
-
#policy(auth_server_id, _policy_id) ⇒ Hash<Policy Object>
Return a specific Policy for a given Authorization Server in the okta instance.
-
#update_auth_server(auth_server_id, auth_server_data) ⇒ Hash<Authorization Server Object>
Update an Authorization Server in the okta instance.
-
#update_policy(auth_server_id, policy_id, policy_data) ⇒ Hash<Policy Object>
Update a Policy for a given Authorization Server.
Instance Method Details
#activate_auth_server(auth_server_id) ⇒ Object
Activate an Authorization Server in the okta instance.
75 76 77 78 79 80 |
# File 'lib/simpleokta/auth_servers.rb', line 75 def activate_auth_server(auth_server_id) call_with_token( 'post', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}/lifecycle/activate" ) end |
#auth_server(auth_server_id) ⇒ Hash<Authorization Server Object>
Get an Authorization Server in the okta instance.
12 13 14 15 16 17 18 |
# File 'lib/simpleokta/auth_servers.rb', line 12 def auth_server(auth_server_id) response = call_with_token( 'get', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}" ) JSON.parse(response.body) end |
#auth_servers ⇒ Array<Authorization Server Object>
Return all Authorization Servers in the okta instance.
23 24 25 26 27 28 29 |
# File 'lib/simpleokta/auth_servers.rb', line 23 def auth_servers response = call_with_token( 'get', Constants::AUTH_SERVER_API_BASE_PATH ) JSON.parse(response.body) end |
#create_auth_server(auth_server_data) ⇒ Hash<Authorization Server Object>
Create an Authorization Server in the okta instance.
36 37 38 39 40 41 42 43 |
# File 'lib/simpleokta/auth_servers.rb', line 36 def create_auth_server(auth_server_data) response = call_with_token( 'post', Constants::AUTH_SERVER_API_BASE_PATH, auth_server_data ) JSON.parse(response.body) end |
#create_policy(auth_server_id, policy_data) ⇒ Hash<Policy Object>
Create a Policy for a given Authorization Server
127 128 129 130 131 132 133 134 |
# File 'lib/simpleokta/auth_servers.rb', line 127 def create_policy(auth_server_id, policy_data) response = call_with_token( 'post', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}/policies", policy_data ) JSON.parse(response.body) end |
#deactivate_auth_server(auth_server_id) ⇒ Object
Deactivate an Authorization Server in the okta instance.
86 87 88 89 90 91 |
# File 'lib/simpleokta/auth_servers.rb', line 86 def deactivate_auth_server(auth_server_id) call_with_token( 'post', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}/lifecycle/deactivate" ) end |
#delete_auth_server(auth_server_id) ⇒ Object
Delete an Authorization Server in the okta instance.
64 65 66 67 68 69 |
# File 'lib/simpleokta/auth_servers.rb', line 64 def delete_auth_server(auth_server_id) call_with_token( 'delete', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}" ) end |
#delete_policy(auth_server_id, policy_id) ⇒ Object
Delete a Policy for a given Authorization Server
158 159 160 161 162 163 |
# File 'lib/simpleokta/auth_servers.rb', line 158 def delete_policy(auth_server_id, policy_id) call_with_token( 'delete', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}/policies/#{policy_id}" ) end |
#policies(auth_server_id) ⇒ Array<Policy Object>
Return all Policies attached to a given Authorization Server in the okta instance.
99 100 101 102 103 104 105 |
# File 'lib/simpleokta/auth_servers.rb', line 99 def policies(auth_server_id) response = call_with_token( 'get', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}/policies" ) JSON.parse(response.body) end |
#policy(auth_server_id, _policy_id) ⇒ Hash<Policy Object>
Return a specific Policy for a given Authorization Server in the okta instance.
113 114 115 116 117 118 119 |
# File 'lib/simpleokta/auth_servers.rb', line 113 def policy(auth_server_id, _policy_id) response = call_with_token( 'get', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}/policies" ) JSON.parse(response.body) end |
#update_auth_server(auth_server_id, auth_server_data) ⇒ Hash<Authorization Server Object>
Update an Authorization Server in the okta instance.
51 52 53 54 55 56 57 58 |
# File 'lib/simpleokta/auth_servers.rb', line 51 def update_auth_server(auth_server_id, auth_server_data) response = call_with_token( 'put', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}", auth_server_data ) JSON.parse(response.body) end |
#update_policy(auth_server_id, policy_id, policy_data) ⇒ Hash<Policy Object>
Update a Policy for a given Authorization Server
143 144 145 146 147 148 149 150 |
# File 'lib/simpleokta/auth_servers.rb', line 143 def update_policy(auth_server_id, policy_id, policy_data) response = call_with_token( 'put', "#{Constants::AUTH_SERVER_API_BASE_PATH}/#{auth_server_id}/policies/#{policy_id}", policy_data ) JSON.parse(response.body) end |