Skip to content

Commit 4916076

Browse files
committed
- Added integration tests for the following api files.
- okta/api/authenticator_api.py - okta/api/authorization_server_assoc_api.py - okta/api/authorization_server_clients_api.py - okta/api/authorization_server_rules_api.py - okta/api/custom_domain_api.py - okta/api/custom_pages_api.py
1 parent 4d9cd16 commit 4916076

21 files changed

+12102
-96
lines changed

okta/__init__.py

Lines changed: 1108 additions & 96 deletions
Large diffs are not rendered by default.

tests/integration/cassettes/test_authenticator_it/TestAuthenticatorResource.test_authenticator_lifecycle.yaml

Lines changed: 2330 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/json
7+
Authorization:
8+
- SSWS myAPIToken
9+
User-Agent:
10+
- OpenAPI-Generator/1.0.0/python
11+
method: GET
12+
uri: https://test.okta.com/api/v1/authenticators
13+
response:
14+
body:
15+
string: '[{"type":"email","id":"autnwmp13v5jQ3JQJ5d7","key":"okta_email","status":"ACTIVE","name":"Email","created":"2025-03-19T09:20:46.000Z","lastUpdated":"2026-01-07T07:56:23.000Z","settings":{"allowedFor":"recovery","tokenLifetimeInMinutes":5},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13v5jQ3JQJ5d7","hints":{"allow":["GET","PUT"]}},"deactivate":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13v5jQ3JQJ5d7/lifecycle/deactivate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13v5jQ3JQJ5d7/methods","hints":{"allow":["GET"]}}}},{"type":"app","id":"autnwmp13zQdsgAUg5d7","key":"okta_verify","status":"ACTIVE","name":"Okta
16+
Verify","created":"2025-03-19T09:20:46.000Z","lastUpdated":"2025-03-19T09:20:47.000Z","settings":{"compliance":{"fips":"OPTIONAL"},"channelBinding":{"style":"NUMBER_CHALLENGE","required":"NEVER"},"userVerification":"PREFERRED","userVerificationMethods":["PIN","BIOMETRICS"],"appInstanceId":""},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7","hints":{"allow":["GET","PUT"]}},"deactivate":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7/lifecycle/deactivate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7/methods","hints":{"allow":["GET"]}},"enroll":{"href":"https://test.okta.com/idp/authenticators","hints":{"allow":["POST"]}}}},{"type":"password","id":"autnwmp13uwJXWgn95d7","key":"okta_password","status":"ACTIVE","name":"Password","created":"2025-03-19T09:20:46.000Z","lastUpdated":"2025-03-19T09:20:46.000Z","_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13uwJXWgn95d7","hints":{"allow":["GET","PUT"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13uwJXWgn95d7/methods","hints":{"allow":["GET"]}}}},{"type":"phone","id":"autnwmp13wasLMLyj5d7","key":"phone_number","status":"INACTIVE","name":"Phone","created":"2025-03-19T09:20:46.000Z","lastUpdated":"2025-03-19T09:20:46.000Z","settings":{"allowedFor":"recovery"},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13wasLMLyj5d7","hints":{"allow":["GET","PUT"]}},"activate":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13wasLMLyj5d7/lifecycle/activate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13wasLMLyj5d7/methods","hints":{"allow":["GET"]}}}},{"type":"security_key","id":"autnwmp13yvMCFKh25d7","key":"webauthn","status":"INACTIVE","name":"Security
17+
Key or Biometric","created":"2025-03-19T09:20:46.000Z","lastUpdated":"2025-03-19T09:20:46.000Z","_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13yvMCFKh25d7","hints":{"allow":["GET","PUT"]}},"activate":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13yvMCFKh25d7/lifecycle/activate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13yvMCFKh25d7/methods","hints":{"allow":["GET"]}}}},{"type":"security_question","id":"autnwmp13xx9bcDg95d7","key":"security_question","status":"ACTIVE","name":"Security
18+
Question","created":"2025-03-19T09:20:46.000Z","lastUpdated":"2026-01-07T07:56:20.000Z","settings":{"allowedFor":"recovery"},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13xx9bcDg95d7","hints":{"allow":["GET","PUT"]}},"deactivate":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13xx9bcDg95d7/lifecycle/deactivate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13xx9bcDg95d7/methods","hints":{"allow":["GET"]}}}}]'
19+
headers:
20+
Cache-Control:
21+
- no-cache, no-store
22+
Connection:
23+
- keep-alive
24+
Content-Encoding:
25+
- gzip
26+
Content-Type:
27+
- application/json
28+
Date:
29+
- Wed, 07 Jan 2026 09:37:13 GMT
30+
Expires:
31+
- '0'
32+
Pragma:
33+
- no-cache
34+
Server:
35+
- nginx
36+
Set-Cookie:
37+
- sid="";Version=1;Path=/;Max-Age=0
38+
- xids="";Version=1;Path=/;Max-Age=0
39+
- autolaunch_triggered=""; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/
40+
- activate_ca_modal_triggered=""; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/
41+
- JSESSIONID=3B2B64C2EDCC6C7139FBEAFA437C5FE9; Path=/; Secure; HttpOnly
42+
Strict-Transport-Security:
43+
- max-age=315360000; includeSubDomains
44+
Transfer-Encoding:
45+
- chunked
46+
Vary:
47+
- Accept-Encoding
48+
accept-ch:
49+
- Sec-CH-UA-Platform-Version
50+
content-security-policy:
51+
- 'default-src ''self'' dev-20982288.okta.com *.oktacdn.com; connect-src ''self''
52+
dev-20982288.okta.com dev-20982288-admin.okta.com *.oktacdn.com *.mixpanel.com
53+
*.mapbox.com dev-20982288.kerberos.okta.com *.authenticatorlocalprod.com:8769
54+
http://localhost:8769 http://127.0.0.1:8769 *.authenticatorlocalprod.com:65111
55+
http://localhost:65111 http://127.0.0.1:65111 *.authenticatorlocalprod.com:65121
56+
http://localhost:65121 http://127.0.0.1:65121 *.authenticatorlocalprod.com:65131
57+
http://localhost:65131 http://127.0.0.1:65131 *.authenticatorlocalprod.com:65141
58+
http://localhost:65141 http://127.0.0.1:65141 *.authenticatorlocalprod.com:65151
59+
http://localhost:65151 http://127.0.0.1:65151 https://oinmanager.okta.com
60+
data: *.ingest.sentry.io; script-src ''unsafe-inline'' ''self'' ''report-sample''
61+
dev-20982288.okta.com *.oktacdn.com; style-src ''unsafe-inline'' ''self''
62+
''report-sample'' dev-20982288.okta.com *.oktacdn.com; frame-src ''self''
63+
dev-20982288.okta.com dev-20982288-admin.okta.com login.okta.com *.vidyard.com
64+
com-okta-authenticator:; img-src ''self'' dev-20982288.okta.com *.oktacdn.com
65+
*.tiles.mapbox.com *.mapbox.com *.vidyard.com data: blob:; font-src ''self''
66+
dev-20982288.okta.com data: *.oktacdn.com fonts.gstatic.com; frame-ancestors
67+
''self'''
68+
p3p:
69+
- CP="HONK"
70+
referrer-policy:
71+
- strict-origin-when-cross-origin
72+
x-content-type-options:
73+
- nosniff
74+
x-okta-request-id:
75+
- a54f1912abf735bada4996f49c529d08
76+
x-rate-limit-limit:
77+
- '50'
78+
x-rate-limit-remaining:
79+
- '49'
80+
x-rate-limit-reset:
81+
- '1767778693'
82+
x-xss-protection:
83+
- '0'
84+
status:
85+
code: 200
86+
message: OK
87+
- request:
88+
body: null
89+
headers:
90+
Accept:
91+
- application/json
92+
Authorization:
93+
- SSWS myAPIToken
94+
User-Agent:
95+
- OpenAPI-Generator/1.0.0/python
96+
method: GET
97+
uri: https://test.okta.com/api/v1/authenticators/autnwmp13v5jQ3JQJ5d7/methods
98+
response:
99+
body:
100+
string: '[{"type":"email","status":"ACTIVE","_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13v5jQ3JQJ5d7/methods/email","hints":{"allow":["GET","PUT"]}}}}]'
101+
headers:
102+
Cache-Control:
103+
- no-cache, no-store
104+
Connection:
105+
- keep-alive
106+
Content-Encoding:
107+
- gzip
108+
Content-Type:
109+
- application/json
110+
Date:
111+
- Wed, 07 Jan 2026 09:37:15 GMT
112+
Expires:
113+
- '0'
114+
Pragma:
115+
- no-cache
116+
Server:
117+
- nginx
118+
Set-Cookie:
119+
- sid="";Version=1;Path=/;Max-Age=0
120+
- xids="";Version=1;Path=/;Max-Age=0
121+
- autolaunch_triggered=""; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/
122+
- activate_ca_modal_triggered=""; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/
123+
- JSESSIONID=46AEB9EF439347DF18AEFB528F1EFDF0; Path=/; Secure; HttpOnly
124+
Strict-Transport-Security:
125+
- max-age=315360000; includeSubDomains
126+
Transfer-Encoding:
127+
- chunked
128+
Vary:
129+
- Accept-Encoding
130+
accept-ch:
131+
- Sec-CH-UA-Platform-Version
132+
content-security-policy:
133+
- 'default-src ''self'' dev-20982288.okta.com *.oktacdn.com; connect-src ''self''
134+
dev-20982288.okta.com dev-20982288-admin.okta.com *.oktacdn.com *.mixpanel.com
135+
*.mapbox.com dev-20982288.kerberos.okta.com *.authenticatorlocalprod.com:8769
136+
http://localhost:8769 http://127.0.0.1:8769 *.authenticatorlocalprod.com:65111
137+
http://localhost:65111 http://127.0.0.1:65111 *.authenticatorlocalprod.com:65121
138+
http://localhost:65121 http://127.0.0.1:65121 *.authenticatorlocalprod.com:65131
139+
http://localhost:65131 http://127.0.0.1:65131 *.authenticatorlocalprod.com:65141
140+
http://localhost:65141 http://127.0.0.1:65141 *.authenticatorlocalprod.com:65151
141+
http://localhost:65151 http://127.0.0.1:65151 https://oinmanager.okta.com
142+
data: *.ingest.sentry.io; script-src ''unsafe-inline'' ''self'' ''report-sample''
143+
dev-20982288.okta.com *.oktacdn.com; style-src ''unsafe-inline'' ''self''
144+
''report-sample'' dev-20982288.okta.com *.oktacdn.com; frame-src ''self''
145+
dev-20982288.okta.com dev-20982288-admin.okta.com login.okta.com *.vidyard.com
146+
com-okta-authenticator:; img-src ''self'' dev-20982288.okta.com *.oktacdn.com
147+
*.tiles.mapbox.com *.mapbox.com *.vidyard.com data: blob:; font-src ''self''
148+
dev-20982288.okta.com data: *.oktacdn.com fonts.gstatic.com; frame-ancestors
149+
''self'''
150+
p3p:
151+
- CP="HONK"
152+
referrer-policy:
153+
- strict-origin-when-cross-origin
154+
x-content-type-options:
155+
- nosniff
156+
x-okta-request-id:
157+
- f64f498f30f9002328daffaf344a7614
158+
x-rate-limit-limit:
159+
- '50'
160+
x-rate-limit-remaining:
161+
- '48'
162+
x-rate-limit-reset:
163+
- '1767778693'
164+
x-xss-protection:
165+
- '0'
166+
status:
167+
code: 200
168+
message: OK
169+
- request:
170+
body: null
171+
headers:
172+
Accept:
173+
- application/json
174+
Authorization:
175+
- SSWS myAPIToken
176+
User-Agent:
177+
- OpenAPI-Generator/1.0.0/python
178+
method: GET
179+
uri: https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7/methods
180+
response:
181+
body:
182+
string: '[{"type":"totp","status":"ACTIVE","settings":{"timeIntervalInSeconds":30,"encoding":"Base32","algorithm":"HMACSHA1","passCodeLength":6},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7/methods/totp","hints":{"allow":["GET","PUT"]}}}},{"type":"push","status":"INACTIVE","settings":{"algorithms":["ES256","RS256"],"keyProtection":"ANY","transactionTypes":["LOGIN"]},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7/methods/push","hints":{"allow":["GET","PUT"]}},"activate":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7/methods/push/lifecycle/activate","hints":{"allow":["POST"]}}}},{"type":"signed_nonce","status":"INACTIVE","settings":{"algorithms":["ES256","RS256"],"keyProtection":"ANY","showSignInWithOV":"NEVER"},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7/methods/signed_nonce","hints":{"allow":["GET","PUT"]}},"activate":{"href":"https://test.okta.com/api/v1/authenticators/autnwmp13zQdsgAUg5d7/methods/signed_nonce/lifecycle/activate","hints":{"allow":["POST"]}}}}]'
183+
headers:
184+
Cache-Control:
185+
- no-cache, no-store
186+
Connection:
187+
- keep-alive
188+
Content-Encoding:
189+
- gzip
190+
Content-Type:
191+
- application/json
192+
Date:
193+
- Wed, 07 Jan 2026 09:37:16 GMT
194+
Expires:
195+
- '0'
196+
Pragma:
197+
- no-cache
198+
Server:
199+
- nginx
200+
Set-Cookie:
201+
- sid="";Version=1;Path=/;Max-Age=0
202+
- xids="";Version=1;Path=/;Max-Age=0
203+
- autolaunch_triggered=""; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/
204+
- activate_ca_modal_triggered=""; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/
205+
- JSESSIONID=67FCBBA6AF6B3FADB28C60C48172810B; Path=/; Secure; HttpOnly
206+
Strict-Transport-Security:
207+
- max-age=315360000; includeSubDomains
208+
Transfer-Encoding:
209+
- chunked
210+
Vary:
211+
- Accept-Encoding
212+
accept-ch:
213+
- Sec-CH-UA-Platform-Version
214+
content-security-policy:
215+
- 'default-src ''self'' dev-20982288.okta.com *.oktacdn.com; connect-src ''self''
216+
dev-20982288.okta.com dev-20982288-admin.okta.com *.oktacdn.com *.mixpanel.com
217+
*.mapbox.com dev-20982288.kerberos.okta.com *.authenticatorlocalprod.com:8769
218+
http://localhost:8769 http://127.0.0.1:8769 *.authenticatorlocalprod.com:65111
219+
http://localhost:65111 http://127.0.0.1:65111 *.authenticatorlocalprod.com:65121
220+
http://localhost:65121 http://127.0.0.1:65121 *.authenticatorlocalprod.com:65131
221+
http://localhost:65131 http://127.0.0.1:65131 *.authenticatorlocalprod.com:65141
222+
http://localhost:65141 http://127.0.0.1:65141 *.authenticatorlocalprod.com:65151
223+
http://localhost:65151 http://127.0.0.1:65151 https://oinmanager.okta.com
224+
data: *.ingest.sentry.io; script-src ''unsafe-inline'' ''self'' ''report-sample''
225+
dev-20982288.okta.com *.oktacdn.com; style-src ''unsafe-inline'' ''self''
226+
''report-sample'' dev-20982288.okta.com *.oktacdn.com; frame-src ''self''
227+
dev-20982288.okta.com dev-20982288-admin.okta.com login.okta.com *.vidyard.com
228+
com-okta-authenticator:; img-src ''self'' dev-20982288.okta.com *.oktacdn.com
229+
*.tiles.mapbox.com *.mapbox.com *.vidyard.com data: blob:; font-src ''self''
230+
dev-20982288.okta.com data: *.oktacdn.com fonts.gstatic.com; frame-ancestors
231+
''self'''
232+
p3p:
233+
- CP="HONK"
234+
referrer-policy:
235+
- strict-origin-when-cross-origin
236+
x-content-type-options:
237+
- nosniff
238+
x-okta-request-id:
239+
- b9bd6126c6e41ba3342ee44b8b08ff87
240+
x-rate-limit-limit:
241+
- '50'
242+
x-rate-limit-remaining:
243+
- '47'
244+
x-rate-limit-reset:
245+
- '1767778693'
246+
x-xss-protection:
247+
- '0'
248+
status:
249+
code: 200
250+
message: OK
251+
version: 1
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
interactions:
2+
- request:
3+
body: '{"key": "okta_email", "name": "Test Email Authenticator", "type": "email"}'
4+
headers:
5+
Accept:
6+
- application/json
7+
Authorization:
8+
- SSWS myAPIToken
9+
Content-Type:
10+
- application/json
11+
User-Agent:
12+
- OpenAPI-Generator/1.0.0/python
13+
method: POST
14+
uri: https://test.okta.com/api/v1/authenticators
15+
response:
16+
body:
17+
string: '{"errorCode":"E0000001","errorSummary":"Api validation failed: com.okta.services.factors.iface.dto.AuthenticatorCatalog","errorLink":"E0000001","errorId":"oaeOfQYcwwoRRKPZxxdFn-Zzg","errorCauses":[{"errorSummary":"The
18+
field has an invalid value"}]}'
19+
headers:
20+
Cache-Control:
21+
- no-cache, no-store
22+
Connection:
23+
- keep-alive
24+
Content-Type:
25+
- application/json
26+
Date:
27+
- Wed, 07 Jan 2026 09:36:03 GMT
28+
Expires:
29+
- '0'
30+
Pragma:
31+
- no-cache
32+
Server:
33+
- nginx
34+
Set-Cookie:
35+
- sid="";Version=1;Path=/;Max-Age=0
36+
- xids="";Version=1;Path=/;Max-Age=0
37+
- autolaunch_triggered=""; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/
38+
- activate_ca_modal_triggered=""; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/
39+
- JSESSIONID=F59AA05D44C2CF2D341CD2819D8AD2D7; Path=/; Secure; HttpOnly
40+
Strict-Transport-Security:
41+
- max-age=315360000; includeSubDomains
42+
Transfer-Encoding:
43+
- chunked
44+
accept-ch:
45+
- Sec-CH-UA-Platform-Version
46+
content-security-policy:
47+
- 'default-src ''self'' dev-20982288.okta.com *.oktacdn.com; connect-src ''self''
48+
dev-20982288.okta.com dev-20982288-admin.okta.com *.oktacdn.com *.mixpanel.com
49+
*.mapbox.com dev-20982288.kerberos.okta.com *.authenticatorlocalprod.com:8769
50+
http://localhost:8769 http://127.0.0.1:8769 *.authenticatorlocalprod.com:65111
51+
http://localhost:65111 http://127.0.0.1:65111 *.authenticatorlocalprod.com:65121
52+
http://localhost:65121 http://127.0.0.1:65121 *.authenticatorlocalprod.com:65131
53+
http://localhost:65131 http://127.0.0.1:65131 *.authenticatorlocalprod.com:65141
54+
http://localhost:65141 http://127.0.0.1:65141 *.authenticatorlocalprod.com:65151
55+
http://localhost:65151 http://127.0.0.1:65151 https://oinmanager.okta.com
56+
data: *.ingest.sentry.io; script-src ''unsafe-inline'' ''self'' ''report-sample''
57+
dev-20982288.okta.com *.oktacdn.com; style-src ''unsafe-inline'' ''self''
58+
''report-sample'' dev-20982288.okta.com *.oktacdn.com; frame-src ''self''
59+
dev-20982288.okta.com dev-20982288-admin.okta.com login.okta.com *.vidyard.com
60+
com-okta-authenticator:; img-src ''self'' dev-20982288.okta.com *.oktacdn.com
61+
*.tiles.mapbox.com *.mapbox.com *.vidyard.com data: blob:; font-src ''self''
62+
dev-20982288.okta.com data: *.oktacdn.com fonts.gstatic.com; frame-ancestors
63+
''self'''
64+
p3p:
65+
- CP="HONK"
66+
referrer-policy:
67+
- strict-origin-when-cross-origin
68+
x-content-type-options:
69+
- nosniff
70+
x-okta-request-id:
71+
- 04b1fa1febafaa9241fed1c42c074d0a
72+
x-rate-limit-limit:
73+
- '50'
74+
x-rate-limit-remaining:
75+
- '49'
76+
x-rate-limit-reset:
77+
- '1767778623'
78+
x-xss-protection:
79+
- '0'
80+
status:
81+
code: 400
82+
message: Bad Request
83+
version: 1

0 commit comments

Comments
 (0)