Skip to content

Commit

Permalink
OKTA-619080 & OKTA-588345 regen from latest spec (#366)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
bryanapellanes-okta authored Aug 23, 2023
1 parent 0e71c4d commit b7f12ea
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ jobs:
name: Build
command: python setup.py build
- run:
name: Run Tests
command: pytest
name: Run Unit Tests
command: pytest tests/unit
- run:
name: Run Integration Tests
command: pytest tests/integration
workflows:
"Circle CI Tests":
jobs:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
flake8 okta/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 okta/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
- name: Unit test with pytest
run: |
pytest tests/unit
- name: Integration test with pytest
run: |
pytest tests/integration
31 changes: 30 additions & 1 deletion okta/models/application_settings_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,40 @@ class ApplicationSettingsApplication(

def __init__(self, config=None):
super().__init__(config)
pass
if config:
self.acs_url = config["acsUrl"]\
if "acsUrl" in config else None
self.button_field = config["buttonField"]\
if "buttonField" in config else None
self.login_url_regex = config["loginUrlRegex"]\
if "loginUrlRegex" in config else None
self.org_name = config["orgName"]\
if "orgName" in config else None
self.password_field = config["passwordField"]\
if "passwordField" in config else None
self.url = config["url"]\
if "url" in config else None
self.username_field = config["usernameField"]\
if "usernameField" in config else None
else:
self.acs_url = None
self.button_field = None
self.login_url_regex = None
self.org_name = None
self.password_field = None
self.url = None
self.username_field = None

def request_format(self):
parent_req_format = super().request_format()
current_obj_format = {
"acsUrl": self.acs_url,
"buttonField": self.button_field,
"loginUrlRegex": self.login_url_regex,
"orgName": self.org_name,
"passwordField": self.password_field,
"url": self.url,
"usernameField": self.username_field
}
parent_req_format.update(current_obj_format)
return parent_req_format
1 change: 1 addition & 0 deletions okta/models/factor_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class FactorType(
HOTP = "hotp", "HOTP"
PUSH = "push", "PUSH"
QUESTION = "question", "QUESTION"
SIGNED_NONCE = "signed_nonce", "SIGNED_NONCE"
SMS = "sms", "SMS"
TOKEN_HARDWARE = "token:hardware", "TOKEN:HARDWARE"
TOKEN_HOTP = "token:hotp", "TOKEN:HOTP"
Expand Down
3 changes: 3 additions & 0 deletions regen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

./openapi/node_modules/.bin/okta-sdk-generator -t openapi/templates/ -o .
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ pytest-asyncio
pytest-mock
pytest-recording
pyfakefs
aenum
aenum==3.1.11
pydash
3 changes: 3 additions & 0 deletions run_unit_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

pytest tests/unit/
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_version():
"yarl",
"pycryptodomex",
"python-jose",
"aenum",
"aenum==3.1.11",
"pydash"
]
)

0 comments on commit b7f12ea

Please sign in to comment.