From a01001b3b2086e9c4c6abb576623d76a79269f2a Mon Sep 17 00:00:00 2001 From: FonzMP Date: Tue, 3 May 2022 14:54:48 -0600 Subject: [PATCH 1/5] adds authorization_servers --- lib/oktakit/client.rb | 6 +- lib/oktakit/client/authorization_servers.rb | 148 ++++++++++++++++++++ 2 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 lib/oktakit/client/authorization_servers.rb diff --git a/lib/oktakit/client.rb b/lib/oktakit/client.rb index 0705b7b..5ae7dc9 100644 --- a/lib/oktakit/client.rb +++ b/lib/oktakit/client.rb @@ -2,6 +2,7 @@ require 'oktakit/response/raise_error' require 'oktakit/client/admin_roles' require 'oktakit/client/apps' +require 'oktakit/client/authorization_servers' require 'oktakit/client/events' require 'oktakit/client/factors' require 'oktakit/client/groups' @@ -15,6 +16,7 @@ module Oktakit class Client include AdminRoles include Apps + include AuthorizationServers include Events include Factors include Groups @@ -189,8 +191,8 @@ def sawyer_agent http.headers[:accept] = 'application/json' http.headers[:content_type] = 'application/json' http.headers[:user_agent] = "Oktakit v#{Oktakit::VERSION}" - http.authorization('SSWS ', @token) if @token - http.authorization(:Bearer, @access_token) if @access_token + http.headers[:authorization] = "SSWS #{@token}" if @token + http.headers[:authorization] = "Bearer #{@access_token}" if @access_token end end diff --git a/lib/oktakit/client/authorization_servers.rb b/lib/oktakit/client/authorization_servers.rb new file mode 100644 index 0000000..6de2128 --- /dev/null +++ b/lib/oktakit/client/authorization_servers.rb @@ -0,0 +1,148 @@ +module Oktakit + class Client + module AuthorizationServers + # Add Authorization Server + # + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] All responses return the created Authorization Server. + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#create-authorization-server + # @example + # Oktakit.add_authorization_server + def add_authorization_server(options = {}) + post('/authorizationServers', options) + end + + # Get Authorization Server + # + # @params id [string] Authorization Server ID + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] Fetched Authorization Server + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#get-authorization-server + # @example + # Oktakit.get_authorization_server('id') + def get_authorization_server(id, options = {}) + get("/authorizationServers/#{id}", options) + end + + # List Authorization Servers + # + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] Array of Authorization Servers + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#list-authorization-servers + # @example + # Oktakit.list_authorization_servers + def list_authorization_servers(options = {}) + get("/authorizationServers", options) + end + + # List Authorization Server Policies + # + # @params id [string] Authorization Server ID + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] Array of Authorization Server Policies + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#get-all-policies + # @example + # Oktakit.list_authorization_server_policies('id') + def list_authorization_server_policies(id, options = {}) + get("/authorizationServers/#{id}/policies", options) + end + + # Update Authorization Server + # + # @params id [string] Authorization Server ID + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] Updated Authorization Server + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#update-authorization-server + # @example + # Oktakit.update_authorization_server('id') + def update_authorization_server(id, options = {}) + put("/authorizationServers/#{id}", options) + end + + # Update Authorization Server Policy + # + # @params id [string] Authorization Server ID + # @params policy_id [string] Authorization Server Policy ID + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] Updated Authorization Server Policy + # @see http://developer.okta.com/docs/api/resources/apps.html#get-application + # @example + # Oktakit.update_authorization_server_policy('id', 'policy_id') + def update_authorization_server_policy(id, policy_id, options = {}) + put("/authorizationServers/#{id}/policies/#{policy_id}", options) + end + + # Delete Authorization Server + # + # @params id [string] Authorization Server ID + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] An empty JSON object {} + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#delete-authorization-server + # @example + # Oktakit.delete_authorization_server('id) + def delete_authorization_server(id, options = {}) + delete("/authorizationServers/#{id}", options) + end + + # Activate Authorization Server + # + # @params id [string] Authorization Server ID + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] An empty JSON object {} + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#activate-authorization-server + # @example + # Oktakit.activate_authorization_server('id') + def activate_authorization_server(id, options = {}) + post("/authorizationServers/#{id}/lifecycle/activate") + end + + # Deactivate Authorization Server + # + # @params id [string] Authorization Server ID + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] An empty JSON object {} + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#deactivate-authorization-server + # @example + # Oktakit.deactivate_authorization_server('id') + def deactivate_authorization_server(id, options = {}) + post("/authorizationServers/#{id}/lifecycle/deactivate") + end + end + end +end From a44ffd7580387d3c9556e8bd0bc10876e0bdb895 Mon Sep 17 00:00:00 2001 From: FonzMP Date: Wed, 4 May 2022 10:58:13 -0600 Subject: [PATCH 2/5] include add and update doc --- lib/oktakit/client/authorization_servers.rb | 26 +++++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/oktakit/client/authorization_servers.rb b/lib/oktakit/client/authorization_servers.rb index 6de2128..3470707 100644 --- a/lib/oktakit/client/authorization_servers.rb +++ b/lib/oktakit/client/authorization_servers.rb @@ -8,7 +8,7 @@ module AuthorizationServers # @param options[:accept] [String] Optional. The content type to accept. Default application/json # @param options[:content_type] [String] Optional. The content type for the request. Default application/json # @param options [Hash] Optional. Body params for request. - # @return [Hash] All responses return the created Authorization Server. + # @return [Hash] The created Authorization Server # @see https://developer.okta.com/docs/reference/api/authorization-servers/#create-authorization-server # @example # Oktakit.add_authorization_server @@ -63,6 +63,22 @@ def list_authorization_server_policies(id, options = {}) get("/authorizationServers/#{id}/policies", options) end + # Add Authorization Server Policy + # + # @params id [string] Authorization Server ID + # @param options[:query] [Hash] Optional. Query params for request + # @param options[:headers] [Hash] Optional. Header params for the request. + # @param options[:accept] [String] Optional. The content type to accept. Default application/json + # @param options[:content_type] [String] Optional. The content type for the request. Default application/json + # @param options [Hash] Optional. Body params for request. + # @return [Hash] The Created Authorization Server Policy + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#create-a-policy + # @example + # Oktakit.add_authorization_server_policy('id') + def add_authorization_server_policy(id, options = {}) + post("/authorizationServers/#{id}/policies", options) + end + # Update Authorization Server # # @params id [string] Authorization Server ID @@ -89,7 +105,7 @@ def update_authorization_server(id, options = {}) # @param options[:content_type] [String] Optional. The content type for the request. Default application/json # @param options [Hash] Optional. Body params for request. # @return [Hash] Updated Authorization Server Policy - # @see http://developer.okta.com/docs/api/resources/apps.html#get-application + # @see https://developer.okta.com/docs/reference/api/authorization-servers/#update-a-policy # @example # Oktakit.update_authorization_server_policy('id', 'policy_id') def update_authorization_server_policy(id, policy_id, options = {}) @@ -104,7 +120,7 @@ def update_authorization_server_policy(id, policy_id, options = {}) # @param options[:accept] [String] Optional. The content type to accept. Default application/json # @param options[:content_type] [String] Optional. The content type for the request. Default application/json # @param options [Hash] Optional. Body params for request. - # @return [Hash] An empty JSON object {} + # @return [Hash] HTTP 204 No Content # @see https://developer.okta.com/docs/reference/api/authorization-servers/#delete-authorization-server # @example # Oktakit.delete_authorization_server('id) @@ -120,7 +136,7 @@ def delete_authorization_server(id, options = {}) # @param options[:accept] [String] Optional. The content type to accept. Default application/json # @param options[:content_type] [String] Optional. The content type for the request. Default application/json # @param options [Hash] Optional. Body params for request. - # @return [Hash] An empty JSON object {} + # @return [Hash] HTTP 204 No Content # @see https://developer.okta.com/docs/reference/api/authorization-servers/#activate-authorization-server # @example # Oktakit.activate_authorization_server('id') @@ -136,7 +152,7 @@ def activate_authorization_server(id, options = {}) # @param options[:accept] [String] Optional. The content type to accept. Default application/json # @param options[:content_type] [String] Optional. The content type for the request. Default application/json # @param options [Hash] Optional. Body params for request. - # @return [Hash] An empty JSON object {} + # @return [Hash] HTTP 204 No Content # @see https://developer.okta.com/docs/reference/api/authorization-servers/#deactivate-authorization-server # @example # Oktakit.deactivate_authorization_server('id') From 9f5cf7b5dce9438209e07f5d69ef1f68745767b5 Mon Sep 17 00:00:00 2001 From: FonzMP Date: Wed, 4 May 2022 11:00:52 -0600 Subject: [PATCH 3/5] rubocop corrections --- lib/oktakit/client/authorization_servers.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/oktakit/client/authorization_servers.rb b/lib/oktakit/client/authorization_servers.rb index 3470707..83d7d87 100644 --- a/lib/oktakit/client/authorization_servers.rb +++ b/lib/oktakit/client/authorization_servers.rb @@ -13,7 +13,7 @@ module AuthorizationServers # @example # Oktakit.add_authorization_server def add_authorization_server(options = {}) - post('/authorizationServers', options) + post("/authorizationServers", options) end # Get Authorization Server @@ -127,7 +127,7 @@ def update_authorization_server_policy(id, policy_id, options = {}) def delete_authorization_server(id, options = {}) delete("/authorizationServers/#{id}", options) end - + # Activate Authorization Server # # @params id [string] Authorization Server ID @@ -143,7 +143,7 @@ def delete_authorization_server(id, options = {}) def activate_authorization_server(id, options = {}) post("/authorizationServers/#{id}/lifecycle/activate") end - + # Deactivate Authorization Server # # @params id [string] Authorization Server ID From f5f5caf8429062abe1caf39fdb037ea8e57e183d Mon Sep 17 00:00:00 2001 From: FonzMP Date: Wed, 4 May 2022 11:03:22 -0600 Subject: [PATCH 4/5] auth server spec --- spec/client/authorization_servers_spec.rb | 121 ++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 spec/client/authorization_servers_spec.rb diff --git a/spec/client/authorization_servers_spec.rb b/spec/client/authorization_servers_spec.rb new file mode 100644 index 0000000..7672a42 --- /dev/null +++ b/spec/client/authorization_servers_spec.rb @@ -0,0 +1,121 @@ +require "spec_helper" + +describe Oktakit::Client::AuthorizationServers do + AUTH_SERVER_ID = "aus4wmezfewflnJvd5d7" + POLICY_ID = "00p4wmrrbjdlgXfcn5d7" + + describe "#add_authorization_server" do + it "returns the created authorization server" do + params = { "name" => "Sample Authorization Server", + "description" => "Sample Authorization Server description", + "audiences" => ["api://default"], } + + VCR.use_cassette("add_authorization_server") do + resp, = client.add_authorization_server(params) + expect(resp.id).to(be == AUTH_SERVER_ID) + end + end + end + + describe "#get_authorization_server" do + it "returns an authorization server" do + VCR.use_cassette("get_authorization_server") do + resp, = client.get_authorization_server(AUTH_SERVER_ID) + expect(resp.id).to(be == AUTH_SERVER_ID) + end + end + end + + describe "#list_authorization_servers" do + it "returns an array of authorization servers" do + VCR.use_cassette("list_authorization_servers") do + resp, = client.list_authorization_servers + expect(resp.map(&:id)).to(include(AUTH_SERVER_ID)) + end + end + end + + describe "#list_authorization_server_policies" do + it "returns an array of policies for an authorization server" do + VCR.use_cassette("list_authorization_server_policies") do + resp, = client.list_authorization_server_policies(AUTH_SERVER_ID) + expect(resp.map(&:id)).to(include(POLICY_ID)) + end + end + end + + describe "#add_authorization_server_policy" do + it "creates a policy within an authorization server" do + params = { "type" => "OAUTH_AUTHORIZATION_POLICY", + "status" => "ACTIVE", + "name" => "Default Policy", + "description" => "Default policy description", + "priority" => 1, + "conditions" => { "clients" => { "include" => ["ALL_CLIENTS"] } }, } + + VCR.use_cassette("add_authorization_server_policy") do + resp, = client.add_authorization_server_policy(AUTH_SERVER_ID, params) + expect(resp.id).to(be == POLICY_ID) + end + end + end + + describe "#update_authorization_server" do + it "updates an authorization server" do + params = { "name" => "New Authorization Server", + "description" => "Authorization Server New Description", + "issuerMode" => "ORG_URL", + "audiences" => ["api://default"], } + + VCR.use_cassette("update_authorization_server") do + resp, = client.update_authorization_server(AUTH_SERVER_ID, params) + expect(resp.id).to(be == AUTH_SERVER_ID) + end + end + end + + describe "#delete_authorization_server" do + it "deletes the respective authorization server" do + VCR.use_cassette("delete_authorization_server") do + _, code = client.delete_authorization_server(AUTH_SERVER_ID) + expect(code).to(eq(204)) + end + end + end + + describe "#update_authorization_server_policy" do + it "updates a policy within an authorization server" do + params = { "type" => "OAUTH_AUTHORIZATION_POLICY", + "id" => POLICY_ID, + "status" => "ACTIVE", + "name" => "default", + "description" => "default policy", + "priority" => 1, + "system" => false, + "conditions" => { "clients" => { "include" => ["ALL_CLIENTS"] } }, } + + VCR.use_cassette("update_authorization_server_policy") do + resp, = client.update_authorization_server_policy(AUTH_SERVER_ID, POLICY_ID, params) + expect(resp.id).to(be == POLICY_ID) + end + end + end + + describe "#activate_authorization_server" do + it "activates an authorization server" do + VCR.use_cassette("activate_authorization_server") do + _, code = client.activate_authorization_server(AUTH_SERVER_ID) + expect(code).to(eq(204)) + end + end + end + + describe "#deactivate_authorization_server" do + it "deactivates an authorization server" do + VCR.use_cassette("deactivate_authorization_server") do + _, code = client.deactivate_authorization_server(AUTH_SERVER_ID) + expect(code).to(eq(204)) + end + end + end +end From ffbce1aa80f6abd2846bbd94e4b9f775e38ec811 Mon Sep 17 00:00:00 2001 From: FonzMP Date: Wed, 4 May 2022 11:19:46 -0600 Subject: [PATCH 5/5] add cassettes --- .../activate_authorization_server.yml | 61 ++++++++++++++++ spec/cassettes/add_authorization_server.yml | 65 +++++++++++++++++ .../add_authorization_server_policy.yml | 67 +++++++++++++++++ .../deactivate_authorization_server.yml | 63 ++++++++++++++++ .../cassettes/delete_authorization_server.yml | 61 ++++++++++++++++ spec/cassettes/get_authorization_server.yml | 70 ++++++++++++++++++ .../list_authorization_server_policies.yml | 70 ++++++++++++++++++ spec/cassettes/list_authorization_servers.yml | 73 +++++++++++++++++++ .../cassettes/update_authorization_server.yml | 69 ++++++++++++++++++ .../update_authorization_server_policy.yml | 69 ++++++++++++++++++ 10 files changed, 668 insertions(+) create mode 100644 spec/cassettes/activate_authorization_server.yml create mode 100644 spec/cassettes/add_authorization_server.yml create mode 100644 spec/cassettes/add_authorization_server_policy.yml create mode 100644 spec/cassettes/deactivate_authorization_server.yml create mode 100644 spec/cassettes/delete_authorization_server.yml create mode 100644 spec/cassettes/get_authorization_server.yml create mode 100644 spec/cassettes/list_authorization_server_policies.yml create mode 100644 spec/cassettes/list_authorization_servers.yml create mode 100644 spec/cassettes/update_authorization_server.yml create mode 100644 spec/cassettes/update_authorization_server_policy.yml diff --git a/spec/cassettes/activate_authorization_server.yml b/spec/cassettes/activate_authorization_server.yml new file mode 100644 index 0000000..d262ad1 --- /dev/null +++ b/spec/cassettes/activate_authorization_server.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/lifecycle/activate + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 204 + message: No Content + headers: + date: + - Tue, 03 May 2022 22:01:59 GMT + connection: + - keep-alive + server: + - nginx + x-okta-request-id: + - YnGmV5MAn6-Gyo2Ykg9FPgAACfk + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '98' + x-rate-limit-reset: + - '1651615326' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + x-frame-options: + - SAMEORIGIN + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=A27B77E4F8DA9AF3CEF95D10F17B4F61; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 03 May 2022 22:01:59 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/add_authorization_server.yml b/spec/cassettes/add_authorization_server.yml new file mode 100644 index 0000000..ca789cc --- /dev/null +++ b/spec/cassettes/add_authorization_server.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: post + uri: https://okta-test.okta.com/api/v1/authorizationServers + body: + encoding: UTF-8 + string: '{"name":"Sample Authorization Server","description":"Sample Authorization + Server description","audiences":["api://default"]}' + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 201 + message: Created + headers: + date: + - Tue, 03 May 2022 21:12:24 GMT + content-type: + - application/json + transfer-encoding: + - chunked + connection: + - keep-alive + server: + - nginx + x-okta-request-id: + - YnGauFyhLn5S37M46vmY2gAABSk + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1651612404' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + x-content-type-options: + - nosniff + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=2A9C9DFEF43449AD9C4F2C8EB94531B8; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '{"id":"aus4wmezfewflnJvd5d7","name":"Sample Authorization Server","description":"Sample + Authorization Server description","audiences":["api://default"],"issuer":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7","issuerMode":"DYNAMIC","status":"ACTIVE","created":"2022-05-03T21:12:24.000Z","lastUpdated":"2022-05-03T21:12:24.000Z","credentials":{"signing":{"kid":"gFiUvGTKoo6ksMgpOHaNQG8hdBuKHbZLE2GWsgW2f00","rotationMode":"AUTO","lastRotated":"2022-05-03T21:12:24.000Z","nextRotation":"2022-08-01T21:12:24.000Z"}},"_links":{"rotateKey":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/credentials/lifecycle/keyRotate","hints":{"allow":["POST"]}},"metadata":[{"name":"oauth-authorization-server","href":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7/.well-known/oauth-authorization-server","hints":{"allow":["GET"]}},{"name":"openid-configuration","href":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7/.well-known/openid-configuration","hints":{"allow":["GET"]}}],"keys":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/credentials/keys","hints":{"allow":["GET"]}},"claims":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/claims","hints":{"allow":["GET","POST"]}},"policies":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies","hints":{"allow":["GET","POST"]}},"self":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7","hints":{"allow":["GET","DELETE","PUT"]}},"scopes":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/scopes","hints":{"allow":["GET","POST"]}},"deactivate":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/lifecycle/deactivate","hints":{"allow":["POST"]}}}}' + recorded_at: Tue, 03 May 2022 21:12:24 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/add_authorization_server_policy.yml b/spec/cassettes/add_authorization_server_policy.yml new file mode 100644 index 0000000..6aa6f41 --- /dev/null +++ b/spec/cassettes/add_authorization_server_policy.yml @@ -0,0 +1,67 @@ +--- +http_interactions: +- request: + method: post + uri: https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies + body: + encoding: UTF-8 + string: '{"type":"OAUTH_AUTHORIZATION_POLICY","status":"ACTIVE","name":"Default + Policy","description":"Default policy description","priority":1,"conditions":{"clients":{"include":["ALL_CLIENTS"]}}}' + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 201 + message: Created + headers: + date: + - Tue, 03 May 2022 21:43:09 GMT + content-type: + - application/json + transfer-encoding: + - chunked + connection: + - keep-alive + server: + - nginx + x-okta-request-id: + - YnGh7eskj45wgfW21rUl@wAABuw + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1651614249' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + x-content-type-options: + - nosniff + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=72EED461C6B98253F0494A7C51176B57; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '{"id":"00p4wmrrbjdlgXfcn5d7","status":"ACTIVE","name":"Default Policy","description":"Default + policy description","priority":1,"system":false,"conditions":{"clients":{"include":["ALL_CLIENTS"]}},"created":"2022-05-03T21:43:09.000Z","lastUpdated":"2022-05-03T21:43:09.000Z","_links":{"self":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7","hints":{"allow":["GET","PUT","DELETE"]}},"rules":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7/rules","hints":{"allow":["GET"]}},"deactivate":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7/lifecycle/deactivate","hints":{"allow":["POST"]}}},"type":"OAUTH_AUTHORIZATION_POLICY"}' + recorded_at: Tue, 03 May 2022 21:43:09 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/deactivate_authorization_server.yml b/spec/cassettes/deactivate_authorization_server.yml new file mode 100644 index 0000000..def7dac --- /dev/null +++ b/spec/cassettes/deactivate_authorization_server.yml @@ -0,0 +1,63 @@ +--- +http_interactions: +- request: + method: post + uri: https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/lifecycle/deactivate + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 204 + message: No Content + headers: + date: + - Tue, 03 May 2022 22:01:06 GMT + connection: + - keep-alive + server: + - nginx + x-okta-request-id: + - YnGmInNHtcbPC2ehwxvlMgAABI0 + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1651615326' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + report-to: + - '{"group":"csp","max_age":31536000,"endpoints":[{"url":"https://okta.report-uri.com/a/d/g"}],"include_subdomains":true}' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + x-frame-options: + - SAMEORIGIN + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=6AB57DC7A3867A9EA864D5ECE6F344BE; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 03 May 2022 22:01:06 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/delete_authorization_server.yml b/spec/cassettes/delete_authorization_server.yml new file mode 100644 index 0000000..f351f12 --- /dev/null +++ b/spec/cassettes/delete_authorization_server.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: delete + uri: https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7 + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 204 + message: No Content + headers: + date: + - Tue, 03 May 2022 22:04:32 GMT + connection: + - keep-alive + server: + - nginx + x-okta-request-id: + - YnGm8PNb9ZR0EOG6oO1@2QAAB8Y + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '97' + x-rate-limit-reset: + - '1651615523' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + x-frame-options: + - SAMEORIGIN + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=E802682186E78E46A710BAD3D5904E42; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 03 May 2022 22:04:32 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/get_authorization_server.yml b/spec/cassettes/get_authorization_server.yml new file mode 100644 index 0000000..b997fab --- /dev/null +++ b/spec/cassettes/get_authorization_server.yml @@ -0,0 +1,70 @@ +--- +http_interactions: +- request: + method: get + uri: https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 200 + message: OK + headers: + date: + - Tue, 03 May 2022 21:18:47 GMT + content-type: + - application/json + transfer-encoding: + - chunked + connection: + - keep-alive + server: + - nginx + vary: + - Accept-Encoding + x-okta-request-id: + - YnGcNkVtdpPXxQnGAmPiSQAAA9c + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1651612786' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + report-to: + - '{"group":"csp","max_age":31536000,"endpoints":[{"url":"https://okta.report-uri.com/a/d/g"}],"include_subdomains":true}' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + x-content-type-options: + - nosniff + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=67939889CEDABC74F2F6CE13DB495584; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '{"id":"aus4wmezfewflnJvd5d7","name":"Sample Authorization Server","description":"Sample + Authorization Server description","audiences":["api://default"],"issuer":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7","issuerMode":"DYNAMIC","status":"ACTIVE","created":"2022-05-03T21:12:24.000Z","lastUpdated":"2022-05-03T21:12:24.000Z","credentials":{"signing":{"kid":"gFiUvGTKoo6ksMgpOHaNQG8hdBuKHbZLE2GWsgW2f00","rotationMode":"AUTO","lastRotated":"2022-05-03T21:12:24.000Z","nextRotation":"2022-08-01T21:12:24.000Z"}},"_links":{"rotateKey":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/credentials/lifecycle/keyRotate","hints":{"allow":["POST"]}},"metadata":[{"name":"oauth-authorization-server","href":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7/.well-known/oauth-authorization-server","hints":{"allow":["GET"]}},{"name":"openid-configuration","href":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7/.well-known/openid-configuration","hints":{"allow":["GET"]}}],"keys":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/credentials/keys","hints":{"allow":["GET"]}},"claims":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/claims","hints":{"allow":["GET","POST"]}},"policies":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies","hints":{"allow":["GET","POST"]}},"self":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7","hints":{"allow":["GET","DELETE","PUT"]}},"scopes":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/scopes","hints":{"allow":["GET","POST"]}},"deactivate":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/lifecycle/deactivate","hints":{"allow":["POST"]}}}}' + recorded_at: Tue, 03 May 2022 21:18:47 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/list_authorization_server_policies.yml b/spec/cassettes/list_authorization_server_policies.yml new file mode 100644 index 0000000..f63ed5e --- /dev/null +++ b/spec/cassettes/list_authorization_server_policies.yml @@ -0,0 +1,70 @@ +--- +http_interactions: +- request: + method: get + uri: https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 200 + message: OK + headers: + date: + - Tue, 03 May 2022 21:44:12 GMT + content-type: + - application/json + transfer-encoding: + - chunked + connection: + - keep-alive + server: + - nginx + vary: + - Accept-Encoding + x-okta-request-id: + - YnGiLOqxOYDf2QeMVfjS-QAADuw + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1651614312' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + report-to: + - '{"group":"csp","max_age":31536000,"endpoints":[{"url":"https://okta.report-uri.com/a/d/g"}],"include_subdomains":true}' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + x-content-type-options: + - nosniff + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=FE2F2BEDC84C50416A0170307804FFA5; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '[{"id":"00p4wmrrbjdlgXfcn5d7","status":"ACTIVE","name":"Default Policy","description":"Default + policy description","priority":1,"system":false,"conditions":{"clients":{"include":["ALL_CLIENTS"]}},"created":"2022-05-03T21:43:09.000Z","lastUpdated":"2022-05-03T21:43:09.000Z","_links":{"self":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7","hints":{"allow":["GET","PUT","DELETE"]}},"rules":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7/rules","hints":{"allow":["GET"]}},"deactivate":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7/lifecycle/deactivate","hints":{"allow":["POST"]}}},"type":"OAUTH_AUTHORIZATION_POLICY"}]' + recorded_at: Tue, 03 May 2022 21:44:12 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/list_authorization_servers.yml b/spec/cassettes/list_authorization_servers.yml new file mode 100644 index 0000000..0cfd406 --- /dev/null +++ b/spec/cassettes/list_authorization_servers.yml @@ -0,0 +1,73 @@ +--- +http_interactions: +- request: + method: get + uri: https://okta-test.okta.com/api/v1/authorizationServers + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 200 + message: OK + headers: + date: + - Tue, 03 May 2022 21:28:38 GMT + content-type: + - application/json + transfer-encoding: + - chunked + connection: + - keep-alive + server: + - nginx + vary: + - Accept-Encoding + x-okta-request-id: + - YnGehVhdKuxdG5l0zqK3QgAADHI + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1651613377' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + link: + - ; rel="self", + ; + rel="next" + x-content-type-options: + - nosniff + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=0B94C161FF78713CC4E5C59A7F5D95F1; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '[{"id":"aus2hb5ut7J9TaWsJ5d7","name":"default","description":"Default + Authorization Server for your Applications","audiences":["api://default"],"issuer":"https://okta-test.okta.com/oauth2/default","issuerMode":"ORG_URL","status":"ACTIVE","created":"2021-11-02T19:45:09.000Z","lastUpdated":"2021-11-02T19:45:09.000Z","credentials":{"signing":{"kid":"a5MbTY-hmvv-yi3WXFFSZTew6pfTd5ZkXoSnPoPyZaA","rotationMode":"AUTO","lastRotated":"2022-05-03T03:36:21.000Z","nextRotation":"2022-08-01T03:36:21.000Z"}},"_links":{"rotateKey":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/default/credentials/lifecycle/keyRotate","hints":{"allow":["POST"]}},"metadata":[{"name":"oauth-authorization-server","href":"https://okta-test.okta.com/oauth2/default/.well-known/oauth-authorization-server","hints":{"allow":["GET"]}},{"name":"openid-configuration","href":"https://okta-test.okta.com/oauth2/default/.well-known/openid-configuration","hints":{"allow":["GET"]}}],"keys":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/default/credentials/keys","hints":{"allow":["GET"]}},"claims":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/default/claims","hints":{"allow":["GET","POST"]}},"policies":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/default/policies","hints":{"allow":["GET","POST"]}},"self":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/default","hints":{"allow":["GET","DELETE","PUT"]}},"scopes":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/default/scopes","hints":{"allow":["GET","POST"]}},"deactivate":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/default/lifecycle/deactivate","hints":{"allow":["POST"]}}}},{"id":"aus4wmezfewflnJvd5d7","name":"Sample + Authorization Server","description":"Sample Authorization Server description","audiences":["api://default"],"issuer":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7","issuerMode":"DYNAMIC","status":"ACTIVE","created":"2022-05-03T21:12:24.000Z","lastUpdated":"2022-05-03T21:12:24.000Z","credentials":{"signing":{"kid":"gFiUvGTKoo6ksMgpOHaNQG8hdBuKHbZLE2GWsgW2f00","rotationMode":"AUTO","lastRotated":"2022-05-03T21:12:24.000Z","nextRotation":"2022-08-01T21:12:24.000Z"}},"_links":{"rotateKey":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/credentials/lifecycle/keyRotate","hints":{"allow":["POST"]}},"metadata":[{"name":"oauth-authorization-server","href":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7/.well-known/oauth-authorization-server","hints":{"allow":["GET"]}},{"name":"openid-configuration","href":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7/.well-known/openid-configuration","hints":{"allow":["GET"]}}],"keys":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/credentials/keys","hints":{"allow":["GET"]}},"claims":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/claims","hints":{"allow":["GET","POST"]}},"policies":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies","hints":{"allow":["GET","POST"]}},"self":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7","hints":{"allow":["GET","DELETE","PUT"]}},"scopes":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/scopes","hints":{"allow":["GET","POST"]}},"deactivate":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/lifecycle/deactivate","hints":{"allow":["POST"]}}}}]' + recorded_at: Tue, 03 May 2022 21:28:38 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/update_authorization_server.yml b/spec/cassettes/update_authorization_server.yml new file mode 100644 index 0000000..17f5dbd --- /dev/null +++ b/spec/cassettes/update_authorization_server.yml @@ -0,0 +1,69 @@ +--- +http_interactions: +- request: + method: put + uri: https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7 + body: + encoding: UTF-8 + string: '{"name":"New Authorization Server","description":"Authorization Server + New Description","issuerMode":"ORG_URL","audiences":["api://default"]}' + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 200 + message: OK + headers: + date: + - Tue, 03 May 2022 21:53:34 GMT + content-type: + - application/json + transfer-encoding: + - chunked + connection: + - keep-alive + server: + - nginx + vary: + - Accept-Encoding + x-okta-request-id: + - YnGkXgsoWyB-uZQpAey@NwAABEk + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1651614874' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + x-content-type-options: + - nosniff + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=26B4E566102F23CCACB3332009E6A5B3; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '{"id":"aus4wmezfewflnJvd5d7","name":"New Authorization Server","description":"Authorization + Server New Description","audiences":["api://default"],"issuer":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7","issuerMode":"ORG_URL","status":"ACTIVE","created":"2022-05-03T21:12:24.000Z","lastUpdated":"2022-05-03T21:53:34.000Z","credentials":{"signing":{"kid":"gFiUvGTKoo6ksMgpOHaNQG8hdBuKHbZLE2GWsgW2f00","rotationMode":"AUTO","lastRotated":"2022-05-03T21:12:24.000Z","nextRotation":"2022-08-01T21:12:24.000Z"}},"_links":{"rotateKey":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/credentials/lifecycle/keyRotate","hints":{"allow":["POST"]}},"metadata":[{"name":"oauth-authorization-server","href":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7/.well-known/oauth-authorization-server","hints":{"allow":["GET"]}},{"name":"openid-configuration","href":"https://okta-test.okta.com/oauth2/aus4wmezfewflnJvd5d7/.well-known/openid-configuration","hints":{"allow":["GET"]}}],"keys":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/credentials/keys","hints":{"allow":["GET"]}},"claims":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/claims","hints":{"allow":["GET","POST"]}},"policies":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies","hints":{"allow":["GET","POST"]}},"self":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7","hints":{"allow":["GET","DELETE","PUT"]}},"scopes":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/scopes","hints":{"allow":["GET","POST"]}},"deactivate":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/lifecycle/deactivate","hints":{"allow":["POST"]}}}}' + recorded_at: Tue, 03 May 2022 21:53:34 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/cassettes/update_authorization_server_policy.yml b/spec/cassettes/update_authorization_server_policy.yml new file mode 100644 index 0000000..7fda60d --- /dev/null +++ b/spec/cassettes/update_authorization_server_policy.yml @@ -0,0 +1,69 @@ +--- +http_interactions: +- request: + method: put + uri: https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7 + body: + encoding: UTF-8 + string: '{"type":"OAUTH_AUTHORIZATION_POLICY","id":"00p4wmrrbjdlgXfcn5d7","status":"ACTIVE","name":"default","description":"default + policy","priority":1,"system":false,"conditions":{"clients":{"include":["ALL_CLIENTS"]}}}' + headers: + User-Agent: + - Oktakit v0.3.1 + Accept: + - application/json + Content-Type: + - application/json + Authorization: + - SSWS <> + response: + status: + code: 200 + message: OK + headers: + date: + - Tue, 03 May 2022 21:58:35 GMT + content-type: + - application/json + transfer-encoding: + - chunked + connection: + - keep-alive + server: + - nginx + vary: + - Accept-Encoding + x-okta-request-id: + - YnGli5baO-JL8Hj@QysuvgAACOc + x-xss-protection: + - '0' + p3p: + - CP="HONK" + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1651615175' + cache-control: + - no-cache, no-store + pragma: + - no-cache + expires: + - '0' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + x-content-type-options: + - nosniff + strict-transport-security: + - max-age=315360000; includeSubDomains + set-cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, autolaunch_triggered=""; + Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=5E3AEB39E68BA35A928D7E40041C4523; + Path=/; Secure; HttpOnly + body: + encoding: UTF-8 + string: '{"id":"00p4wmrrbjdlgXfcn5d7","status":"ACTIVE","name":"default","description":"default + policy","priority":1,"system":false,"conditions":{"clients":{"include":["ALL_CLIENTS"]}},"created":"2022-05-03T21:43:09.000Z","lastUpdated":"2022-05-03T21:58:35.000Z","_links":{"self":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7","hints":{"allow":["GET","PUT","DELETE"]}},"rules":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7/rules","hints":{"allow":["GET"]}},"deactivate":{"href":"https://okta-test.okta.com/api/v1/authorizationServers/aus4wmezfewflnJvd5d7/policies/00p4wmrrbjdlgXfcn5d7/lifecycle/deactivate","hints":{"allow":["POST"]}}},"type":"OAUTH_AUTHORIZATION_POLICY"}' + recorded_at: Tue, 03 May 2022 21:58:35 GMT +recorded_with: VCR 6.0.0