Skip to content

Commit b7f12ea

Browse files
OKTA-619080 & OKTA-588345 regen from latest spec (#366)
- Add missing properties to applicationsettingsapplication per the reference docs: https://developer.okta.com/docs/reference/api/apps/#settings-4 - Add signed_nonce factor type per the reference docs: https://developer.okta.com/docs/reference/api/factors/#factor-type
1 parent 0e71c4d commit b7f12ea

File tree

8 files changed

+48
-6
lines changed

8 files changed

+48
-6
lines changed

.circleci/config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ jobs:
1515
name: Build
1616
command: python setup.py build
1717
- run:
18-
name: Run Tests
19-
command: pytest
18+
name: Run Unit Tests
19+
command: pytest tests/unit
20+
- run:
21+
name: Run Integration Tests
22+
command: pytest tests/integration
2023
workflows:
2124
"Circle CI Tests":
2225
jobs:

.github/workflows/python-package.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
flake8 okta/ --count --select=E9,F63,F7,F82 --show-source --statistics
3636
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3737
flake8 okta/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38-
- name: Test with pytest
38+
- name: Unit test with pytest
39+
run: |
40+
pytest tests/unit
41+
- name: Integration test with pytest
3942
run: |
4043
pytest tests/integration

okta/models/application_settings_application.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,40 @@ class ApplicationSettingsApplication(
3030

3131
def __init__(self, config=None):
3232
super().__init__(config)
33-
pass
33+
if config:
34+
self.acs_url = config["acsUrl"]\
35+
if "acsUrl" in config else None
36+
self.button_field = config["buttonField"]\
37+
if "buttonField" in config else None
38+
self.login_url_regex = config["loginUrlRegex"]\
39+
if "loginUrlRegex" in config else None
40+
self.org_name = config["orgName"]\
41+
if "orgName" in config else None
42+
self.password_field = config["passwordField"]\
43+
if "passwordField" in config else None
44+
self.url = config["url"]\
45+
if "url" in config else None
46+
self.username_field = config["usernameField"]\
47+
if "usernameField" in config else None
48+
else:
49+
self.acs_url = None
50+
self.button_field = None
51+
self.login_url_regex = None
52+
self.org_name = None
53+
self.password_field = None
54+
self.url = None
55+
self.username_field = None
3456

3557
def request_format(self):
3658
parent_req_format = super().request_format()
3759
current_obj_format = {
60+
"acsUrl": self.acs_url,
61+
"buttonField": self.button_field,
62+
"loginUrlRegex": self.login_url_regex,
63+
"orgName": self.org_name,
64+
"passwordField": self.password_field,
65+
"url": self.url,
66+
"usernameField": self.username_field
3867
}
3968
parent_req_format.update(current_obj_format)
4069
return parent_req_format

okta/models/factor_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class FactorType(
3434
HOTP = "hotp", "HOTP"
3535
PUSH = "push", "PUSH"
3636
QUESTION = "question", "QUESTION"
37+
SIGNED_NONCE = "signed_nonce", "SIGNED_NONCE"
3738
SMS = "sms", "SMS"
3839
TOKEN_HARDWARE = "token:hardware", "TOKEN:HARDWARE"
3940
TOKEN_HOTP = "token:hotp", "TOKEN:HOTP"

regen.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
./openapi/node_modules/.bin/okta-sdk-generator -t openapi/templates/ -o .

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ pytest-asyncio
1515
pytest-mock
1616
pytest-recording
1717
pyfakefs
18-
aenum
18+
aenum==3.1.11
1919
pydash

run_unit_tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
pytest tests/unit/

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_version():
4343
"yarl",
4444
"pycryptodomex",
4545
"python-jose",
46-
"aenum",
46+
"aenum==3.1.11",
4747
"pydash"
4848
]
4949
)

0 commit comments

Comments
 (0)