diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b88b682..37a7a9db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # Okta Python SDK Changelog +## v2.3.0 +- Regenerate code using the [open API spec v2.9.1](https://github.com/okta/okta-management-openapi-spec/releases/tag/openapi-2.9.1). +- Allow next for all requests +- Allow upload files within FormData +- Add updateOrgLogo operation to Org resource (Org appeared in v2.2.0) +- Allow custom SSL Context settings + +_New resources:_ +* Brand + +_New models:_ +AccessPolicy +AccessPolicyConstraint +AccessPolicyConstraints +AccessPolicyRule +AccessPolicyRuleActions +AccessPolicyRuleApplicationSignOn +AccessPolicyRuleConditions +AccessPolicyRuleCustomCondition +AuthenticatorProvider +AuthenticatorProviderConfiguration +AuthenticatorProviderConfigurationUserNamePlate +Brand +ChannelBinding +Compliance +DeviceAccessPolicyRuleCondition +EmailTemplateTouchPointVariant +EndUserDashboardTouchPointVariant +ErrorPageTouchPointVariant +FipsEnum +ImageUploadResponse +KnowledgeConstraint +PossessionConstraint +PreRegistrationInlineHook +ProfileEnrollmentPolicy +ProfileEnrollmentPolicyRule +ProfileEnrollmentPolicyRuleAction +ProfileEnrollmentPolicyRuleActions +ProfileEnrollmentPolicyRuleActivationRequirement +ProfileEnrollmentPolicyRuleProfileAttribute +RequiredEnum +SignInPageTouchPointVariant +Theme +ThemeResponse +UserTypeCondition +UserVerificationEnum +VerificationMethod + ## v2.2.0 - Regenerate code using the [open API spec v2.7.0](https://github.com/okta/okta-management-openapi-spec/releases/tag/openapi-2.7.0). - Allow Bearer auth diff --git a/README.md b/README.md index 4883af1b..faeac06b 100644 --- a/README.md +++ b/README.md @@ -1017,6 +1017,28 @@ Each one of the configuration values above can be turned into an environment var - `OKTA_CLIENT_RATELIMIT_MAXRETRIES` - `OKTA_TESTING_TESTINGDISABLEHTTPSCHECK` +### Other configuration options + +Starting with SDK v2.3.0 you can provide custom SSL context: + +```py +import asyncio +import ssl + +from okta.client import Client as OktaClient + + +async def main(): + # create default context for demo purpose + ssl_context = ssl.create_default_context() + client = OktaClient({"sslContext": ssl_context}) + users, resp, err = await client.list_users() + print(users) + +loop = asyncio.get_event_loop() +loop.run_until_complete(main()) +``` + ## Rate Limiting The Okta API will return 429 responses if too many requests are made within a given time. Please see [Rate Limiting at Okta][rate-limiting-okta] for a complete list of which endpoints are rate limited. When a 429 error is received, the X-Rate-Limit-Reset header will tell you the time at which you can retry. This section discusses the method for handling rate limiting with this SDK. diff --git a/okta/__init__.py b/okta/__init__.py index 04188a16..82190396 100644 --- a/okta/__init__.py +++ b/okta/__init__.py @@ -1 +1 @@ -__version__ = '2.2.0' +__version__ = '2.3.0' diff --git a/okta/api_response.py b/okta/api_response.py index 13321f88..861711b0 100644 --- a/okta/api_response.py +++ b/okta/api_response.py @@ -2,6 +2,7 @@ import xmltodict from okta.api_client import APIClient +from okta.utils import convert_absolute_url_into_relative_url class OktaAPIResponse(): @@ -104,15 +105,12 @@ def extract_pagination(self, links): links (dict): Dictionary object of values in the 'Link' header """ - API = "/api/" # Check for 'self' link if "self" in links: - self._self = API + \ - links["self"]["url"].human_repr().partition(API)[2] + self._self = convert_absolute_url_into_relative_url(links["self"]["url"].human_repr()) # Check for 'next' link if "next" in links: - self._next = API + \ - links["next"]["url"].human_repr().partition(API)[2] + self._next = convert_absolute_url_into_relative_url(links["next"]["url"].human_repr()) def has_next(self): """ diff --git a/okta/client.py b/okta/client.py index 897dc2d0..eb0f1354 100644 --- a/okta/client.py +++ b/okta/client.py @@ -31,6 +31,8 @@ import AuthenticatorClient from okta.resource_clients.authorization_server_client\ import AuthorizationServerClient +from okta.resource_clients.brand_client\ + import BrandClient from okta.resource_clients.domain_client\ import DomainClient from okta.resource_clients.event_hook_client\ @@ -79,6 +81,7 @@ class Client( ApplicationClient, AuthenticatorClient, AuthorizationServerClient, + BrandClient, DomainClient, EventHookClient, FeatureClient, diff --git a/okta/constants.py b/okta/constants.py index 16ea652a..a82bf9fe 100644 --- a/okta/constants.py +++ b/okta/constants.py @@ -77,10 +77,12 @@ def find_factor_model(factor_type): OKTA_POLICY_TYPE_TO_MODEL = { + PT.ACCESS_POLICY: models.AccessPolicy, PT.IDP_DISCOVERY: models.IdentityProviderPolicy, PT.OAUTH_AUTHORIZATION_POLICY: models.OAuthAuthorizationPolicy, PT.OKTA_SIGN_ON: models.OktaSignOnPolicy, - PT.PASSWORD: models.PasswordPolicy + PT.PASSWORD: models.PasswordPolicy, + PT.PROFILE_ENROLLMENT: models.ProfileEnrollmentPolicy } @@ -89,7 +91,9 @@ def find_policy_model(policy_type): OKTA_POLICY_RULE_TYPE_TO_MODEL = { + "ACCESS_POLICY": models.AccessPolicyRule, "PASSWORD": models.PasswordPolicyRule, + "PROFILE_ENROLLMENT": models.ProfileEnrollmentPolicyRule, "SIGN_ON": models.OktaSignOnPolicyRule } diff --git a/okta/http_client.py b/okta/http_client.py index e28c7ea4..228e6571 100644 --- a/okta/http_client.py +++ b/okta/http_client.py @@ -31,6 +31,10 @@ def __init__(self, http_config={}): self._proxy = self._setup_proxy(http_config["proxy"]) else: self._proxy = None + if "sslContext" in http_config: + self._ssl_context = http_config["sslContext"] + else: + self._ssl_context = None async def send_request(self, request): """ @@ -57,6 +61,8 @@ async def send_request(self, request): 'headers': self._default_headers} if request['data']: params['data'] = json.dumps(request['data']) + elif request['form']: + params['data'] = request['form'] json_data = request.get('json') # empty json param may cause issue, so include it if needed only # more details: https://github.com/okta/okta-sdk-python/issues/131 @@ -66,12 +72,15 @@ async def send_request(self, request): params['timeout'] = self._timeout if self._proxy: params['proxy'] = self._proxy + if self._ssl_context: + params['ssl_context'] = self._ssl_context # Fire request - async with aiohttp.request(**params) as response: - return (response.request_info, - response, - await response.text(), - None) + async with aiohttp.ClientSession() as session: + async with session.request(**params) as response: + return (response.request_info, + response, + await response.text(), + None) except (aiohttp.ClientError, asyncio.TimeoutError) as error: # Return error if arises logger.exception(error) diff --git a/okta/models/__init__.py b/okta/models/__init__.py index 98480689..dcaca870 100644 --- a/okta/models/__init__.py +++ b/okta/models/__init__.py @@ -18,6 +18,22 @@ # AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY # SEE CONTRIBUTOR DOCUMENTATION +from okta.models import access_policy as access_policy +AccessPolicy = access_policy.AccessPolicy +from okta.models import access_policy_constraint as access_policy_constraint +AccessPolicyConstraint = access_policy_constraint.AccessPolicyConstraint +from okta.models import access_policy_constraints as access_policy_constraints +AccessPolicyConstraints = access_policy_constraints.AccessPolicyConstraints +from okta.models import access_policy_rule as access_policy_rule +AccessPolicyRule = access_policy_rule.AccessPolicyRule +from okta.models import access_policy_rule_actions as access_policy_rule_actions +AccessPolicyRuleActions = access_policy_rule_actions.AccessPolicyRuleActions +from okta.models import access_policy_rule_application_sign_on as access_policy_rule_application_sign_on +AccessPolicyRuleApplicationSignOn = access_policy_rule_application_sign_on.AccessPolicyRuleApplicationSignOn +from okta.models import access_policy_rule_conditions as access_policy_rule_conditions +AccessPolicyRuleConditions = access_policy_rule_conditions.AccessPolicyRuleConditions +from okta.models import access_policy_rule_custom_condition as access_policy_rule_custom_condition +AccessPolicyRuleCustomCondition = access_policy_rule_custom_condition.AccessPolicyRuleCustomCondition from okta.models import acs_endpoint as acs_endpoint AcsEndpoint = acs_endpoint.AcsEndpoint from okta.models import activate_factor_request as activate_factor_request @@ -84,6 +100,12 @@ AuthenticationProviderType = authentication_provider_type.AuthenticationProviderType from okta.models import authenticator as authenticator Authenticator = authenticator.Authenticator +from okta.models import authenticator_provider as authenticator_provider +AuthenticatorProvider = authenticator_provider.AuthenticatorProvider +from okta.models import authenticator_provider_configuration as authenticator_provider_configuration +AuthenticatorProviderConfiguration = authenticator_provider_configuration.AuthenticatorProviderConfiguration +from okta.models import authenticator_provider_configuration_user_name_plate as authenticator_provider_configuration_user_name_plate +AuthenticatorProviderConfigurationUserNamePlate = authenticator_provider_configuration_user_name_plate.AuthenticatorProviderConfigurationUserNamePlate from okta.models import authenticator_settings as authenticator_settings AuthenticatorSettings = authenticator_settings.AuthenticatorSettings from okta.models import authenticator_status as authenticator_status @@ -128,6 +150,8 @@ BookmarkApplicationSettings = bookmark_application_settings.BookmarkApplicationSettings from okta.models import bookmark_application_settings_application as bookmark_application_settings_application BookmarkApplicationSettingsApplication = bookmark_application_settings_application.BookmarkApplicationSettingsApplication +from okta.models import brand as brand +Brand = brand.Brand from okta.models import browser_plugin_application as browser_plugin_application BrowserPluginApplication = browser_plugin_application.BrowserPluginApplication from okta.models import call_user_factor as call_user_factor @@ -140,8 +164,12 @@ CatalogApplicationStatus = catalog_application_status.CatalogApplicationStatus from okta.models import change_password_request as change_password_request ChangePasswordRequest = change_password_request.ChangePasswordRequest +from okta.models import channel_binding as channel_binding +ChannelBinding = channel_binding.ChannelBinding from okta.models import client_policy_condition as client_policy_condition ClientPolicyCondition = client_policy_condition.ClientPolicyCondition +from okta.models import compliance as compliance +Compliance = compliance.Compliance from okta.models import context_policy_rule_condition as context_policy_rule_condition ContextPolicyRuleCondition = context_policy_rule_condition.ContextPolicyRuleCondition from okta.models import create_session_request as create_session_request @@ -164,6 +192,8 @@ DnsRecord = dns_record.DnsRecord from okta.models import dns_record_type as dns_record_type DnsRecordType = dns_record_type.DnsRecordType +from okta.models import device_access_policy_rule_condition as device_access_policy_rule_condition +DeviceAccessPolicyRuleCondition = device_access_policy_rule_condition.DeviceAccessPolicyRuleCondition from okta.models import device_policy_rule_condition as device_policy_rule_condition DevicePolicyRuleCondition = device_policy_rule_condition.DevicePolicyRuleCondition from okta.models import device_policy_rule_condition_platform as device_policy_rule_condition_platform @@ -184,12 +214,18 @@ DomainValidationStatus = domain_validation_status.DomainValidationStatus from okta.models import duration as duration Duration = duration.Duration +from okta.models import email_template_touch_point_variant as email_template_touch_point_variant +EmailTemplateTouchPointVariant = email_template_touch_point_variant.EmailTemplateTouchPointVariant from okta.models import email_user_factor as email_user_factor EmailUserFactor = email_user_factor.EmailUserFactor from okta.models import email_user_factor_profile as email_user_factor_profile EmailUserFactorProfile = email_user_factor_profile.EmailUserFactorProfile from okta.models import enabled_status as enabled_status EnabledStatus = enabled_status.EnabledStatus +from okta.models import end_user_dashboard_touch_point_variant as end_user_dashboard_touch_point_variant +EndUserDashboardTouchPointVariant = end_user_dashboard_touch_point_variant.EndUserDashboardTouchPointVariant +from okta.models import error_page_touch_point_variant as error_page_touch_point_variant +ErrorPageTouchPointVariant = error_page_touch_point_variant.ErrorPageTouchPointVariant from okta.models import event_hook as event_hook EventHook = event_hook.EventHook from okta.models import event_hook_channel as event_hook_channel @@ -222,6 +258,8 @@ FeatureStageValue = feature_stage_value.FeatureStageValue from okta.models import feature_type as feature_type FeatureType = feature_type.FeatureType +from okta.models import fips_enum as fips_enum +FipsEnum = fips_enum.FipsEnum from okta.models import forgot_password_response as forgot_password_response ForgotPasswordResponse = forgot_password_response.ForgotPasswordResponse from okta.models import grant_type_policy_rule_condition as grant_type_policy_rule_condition @@ -286,6 +324,8 @@ IdentityProviderPolicy = identity_provider_policy.IdentityProviderPolicy from okta.models import identity_provider_policy_rule_condition as identity_provider_policy_rule_condition IdentityProviderPolicyRuleCondition = identity_provider_policy_rule_condition.IdentityProviderPolicyRuleCondition +from okta.models import image_upload_response as image_upload_response +ImageUploadResponse = image_upload_response.ImageUploadResponse from okta.models import inactivity_policy_rule_condition as inactivity_policy_rule_condition InactivityPolicyRuleCondition = inactivity_policy_rule_condition.InactivityPolicyRuleCondition from okta.models import inline_hook as inline_hook @@ -318,6 +358,8 @@ JsonWebKey = json_web_key.JsonWebKey from okta.models import jwk_use as jwk_use JwkUse = jwk_use.JwkUse +from okta.models import knowledge_constraint as knowledge_constraint +KnowledgeConstraint = knowledge_constraint.KnowledgeConstraint from okta.models import lifecycle_expiration_policy_rule_condition as lifecycle_expiration_policy_rule_condition LifecycleExpirationPolicyRuleCondition = lifecycle_expiration_policy_rule_condition.LifecycleExpirationPolicyRuleCondition from okta.models import linked_object as linked_object @@ -562,6 +604,22 @@ PolicyType = policy_type.PolicyType from okta.models import policy_user_name_template as policy_user_name_template PolicyUserNameTemplate = policy_user_name_template.PolicyUserNameTemplate +from okta.models import possession_constraint as possession_constraint +PossessionConstraint = possession_constraint.PossessionConstraint +from okta.models import pre_registration_inline_hook as pre_registration_inline_hook +PreRegistrationInlineHook = pre_registration_inline_hook.PreRegistrationInlineHook +from okta.models import profile_enrollment_policy as profile_enrollment_policy +ProfileEnrollmentPolicy = profile_enrollment_policy.ProfileEnrollmentPolicy +from okta.models import profile_enrollment_policy_rule as profile_enrollment_policy_rule +ProfileEnrollmentPolicyRule = profile_enrollment_policy_rule.ProfileEnrollmentPolicyRule +from okta.models import profile_enrollment_policy_rule_action as profile_enrollment_policy_rule_action +ProfileEnrollmentPolicyRuleAction = profile_enrollment_policy_rule_action.ProfileEnrollmentPolicyRuleAction +from okta.models import profile_enrollment_policy_rule_actions as profile_enrollment_policy_rule_actions +ProfileEnrollmentPolicyRuleActions = profile_enrollment_policy_rule_actions.ProfileEnrollmentPolicyRuleActions +from okta.models import profile_enrollment_policy_rule_activation_requirement as profile_enrollment_policy_rule_activation_requirement +ProfileEnrollmentPolicyRuleActivationRequirement = profile_enrollment_policy_rule_activation_requirement.ProfileEnrollmentPolicyRuleActivationRequirement +from okta.models import profile_enrollment_policy_rule_profile_attribute as profile_enrollment_policy_rule_profile_attribute +ProfileEnrollmentPolicyRuleProfileAttribute = profile_enrollment_policy_rule_profile_attribute.ProfileEnrollmentPolicyRuleProfileAttribute from okta.models import profile_mapping as profile_mapping ProfileMapping = profile_mapping.ProfileMapping from okta.models import profile_mapping_property as profile_mapping_property @@ -604,6 +662,8 @@ PushUserFactorProfile = push_user_factor_profile.PushUserFactorProfile from okta.models import recovery_question_credential as recovery_question_credential RecoveryQuestionCredential = recovery_question_credential.RecoveryQuestionCredential +from okta.models import required_enum as required_enum +RequiredEnum = required_enum.RequiredEnum from okta.models import reset_password_token as reset_password_token ResetPasswordToken = reset_password_token.ResetPasswordToken from okta.models import response_links as response_links @@ -658,6 +718,8 @@ SessionIdentityProviderType = session_identity_provider_type.SessionIdentityProviderType from okta.models import session_status as session_status SessionStatus = session_status.SessionStatus +from okta.models import sign_in_page_touch_point_variant as sign_in_page_touch_point_variant +SignInPageTouchPointVariant = sign_in_page_touch_point_variant.SignInPageTouchPointVariant from okta.models import sign_on_inline_hook as sign_on_inline_hook SignOnInlineHook = sign_on_inline_hook.SignOnInlineHook from okta.models import single_logout as single_logout @@ -690,6 +752,10 @@ SwaThreeFieldApplicationSettingsApplication = swa_three_field_application_settings_application.SwaThreeFieldApplicationSettingsApplication from okta.models import temp_password as temp_password TempPassword = temp_password.TempPassword +from okta.models import theme as theme +Theme = theme.Theme +from okta.models import theme_response as theme_response +ThemeResponse = theme_response.ThemeResponse from okta.models import threat_insight_configuration as threat_insight_configuration ThreatInsightConfiguration = threat_insight_configuration.ThreatInsightConfiguration from okta.models import token_authorization_server_policy_rule_action as token_authorization_server_policy_rule_action @@ -778,6 +844,12 @@ UserStatusPolicyRuleCondition = user_status_policy_rule_condition.UserStatusPolicyRuleCondition from okta.models import user_type as user_type UserType = user_type.UserType +from okta.models import user_type_condition as user_type_condition +UserTypeCondition = user_type_condition.UserTypeCondition +from okta.models import user_verification_enum as user_verification_enum +UserVerificationEnum = user_verification_enum.UserVerificationEnum +from okta.models import verification_method as verification_method +VerificationMethod = verification_method.VerificationMethod from okta.models import verify_factor_request as verify_factor_request VerifyFactorRequest = verify_factor_request.VerifyFactorRequest from okta.models import verify_user_factor_response as verify_user_factor_response diff --git a/okta/models/access_policy.py b/okta/models/access_policy.py new file mode 100644 index 00000000..c215f906 --- /dev/null +++ b/okta/models/access_policy.py @@ -0,0 +1,42 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.policy\ + import Policy +from okta.models.policy_type import PolicyType + + +class AccessPolicy( + Policy +): + """ + A class for AccessPolicy objects. + """ + + def __init__(self, config=None): + super().__init__(config) + pass + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/access_policy_constraint.py b/okta/models/access_policy_constraint.py new file mode 100644 index 00000000..e6014899 --- /dev/null +++ b/okta/models/access_policy_constraint.py @@ -0,0 +1,60 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.okta_collection import OktaCollection + + +class AccessPolicyConstraint( + OktaObject +): + """ + A class for AccessPolicyConstraint objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.methods = OktaCollection.form_list( + config["methods"] if "methods"\ + in config else [], + str + ) + self.reauthenticate_in = config["reauthenticateIn"]\ + if "reauthenticateIn" in config else None + self.types = OktaCollection.form_list( + config["types"] if "types"\ + in config else [], + str + ) + else: + self.methods = [] + self.reauthenticate_in = None + self.types = [] + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "methods": self.methods, + "reauthenticateIn": self.reauthenticate_in, + "types": self.types + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/access_policy_constraints.py b/okta/models/access_policy_constraints.py new file mode 100644 index 00000000..2fcb84ba --- /dev/null +++ b/okta/models/access_policy_constraints.py @@ -0,0 +1,73 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.models import knowledge_constraint\ + as knowledge_constraint +from okta.models import possession_constraint\ + as possession_constraint + + +class AccessPolicyConstraints( + OktaObject +): + """ + A class for AccessPolicyConstraints objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + if "knowledge" in config: + if isinstance(config["knowledge"], + knowledge_constraint.KnowledgeConstraint): + self.knowledge = config["knowledge"] + elif config["knowledge"] is not None: + self.knowledge = knowledge_constraint.KnowledgeConstraint( + config["knowledge"] + ) + else: + self.knowledge = None + else: + self.knowledge = None + if "possession" in config: + if isinstance(config["possession"], + possession_constraint.PossessionConstraint): + self.possession = config["possession"] + elif config["possession"] is not None: + self.possession = possession_constraint.PossessionConstraint( + config["possession"] + ) + else: + self.possession = None + else: + self.possession = None + else: + self.knowledge = None + self.possession = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "knowledge": self.knowledge, + "possession": self.possession + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/access_policy_rule.py b/okta/models/access_policy_rule.py new file mode 100644 index 00000000..ab290d82 --- /dev/null +++ b/okta/models/access_policy_rule.py @@ -0,0 +1,79 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.policy_rule\ + import PolicyRule +from okta.models import access_policy_rule_actions\ + as access_policy_rule_actions +from okta.models import access_policy_rule_conditions\ + as access_policy_rule_conditions + + +class AccessPolicyRule( + PolicyRule +): + """ + A class for AccessPolicyRule objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.type = "ACCESS_POLICY" + if "actions" in config: + if isinstance(config["actions"], + access_policy_rule_actions.AccessPolicyRuleActions): + self.actions = config["actions"] + elif config["actions"] is not None: + self.actions = access_policy_rule_actions.AccessPolicyRuleActions( + config["actions"] + ) + else: + self.actions = None + else: + self.actions = None + if "conditions" in config: + if isinstance(config["conditions"], + access_policy_rule_conditions.AccessPolicyRuleConditions): + self.conditions = config["conditions"] + elif config["conditions"] is not None: + self.conditions = access_policy_rule_conditions.AccessPolicyRuleConditions( + config["conditions"] + ) + else: + self.conditions = None + else: + self.conditions = None + self.name = config["name"]\ + if "name" in config else None + else: + self.actions = None + self.conditions = None + self.name = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "actions": self.actions, + "conditions": self.conditions, + "name": self.name + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/access_policy_rule_actions.py b/okta/models/access_policy_rule_actions.py new file mode 100644 index 00000000..2635ff6e --- /dev/null +++ b/okta/models/access_policy_rule_actions.py @@ -0,0 +1,58 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.policy_rule_actions\ + import PolicyRuleActions +from okta.models import access_policy_rule_application_sign_on\ + as access_policy_rule_application_sign_on + + +class AccessPolicyRuleActions( + PolicyRuleActions +): + """ + A class for AccessPolicyRuleActions objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + if "appSignOn" in config: + if isinstance(config["appSignOn"], + access_policy_rule_application_sign_on.AccessPolicyRuleApplicationSignOn): + self.app_sign_on = config["appSignOn"] + elif config["appSignOn"] is not None: + self.app_sign_on = access_policy_rule_application_sign_on.AccessPolicyRuleApplicationSignOn( + config["appSignOn"] + ) + else: + self.app_sign_on = None + else: + self.app_sign_on = None + else: + self.app_sign_on = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "appSignOn": self.app_sign_on + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/access_policy_rule_application_sign_on.py b/okta/models/access_policy_rule_application_sign_on.py new file mode 100644 index 00000000..5c21f13b --- /dev/null +++ b/okta/models/access_policy_rule_application_sign_on.py @@ -0,0 +1,61 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.models import verification_method\ + as verification_method + + +class AccessPolicyRuleApplicationSignOn( + OktaObject +): + """ + A class for AccessPolicyRuleApplicationSignOn objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.access = config["access"]\ + if "access" in config else None + if "verificationMethod" in config: + if isinstance(config["verificationMethod"], + verification_method.VerificationMethod): + self.verification_method = config["verificationMethod"] + elif config["verificationMethod"] is not None: + self.verification_method = verification_method.VerificationMethod( + config["verificationMethod"] + ) + else: + self.verification_method = None + else: + self.verification_method = None + else: + self.access = None + self.verification_method = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "access": self.access, + "verificationMethod": self.verification_method + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/access_policy_rule_conditions.py b/okta/models/access_policy_rule_conditions.py new file mode 100644 index 00000000..9692eb83 --- /dev/null +++ b/okta/models/access_policy_rule_conditions.py @@ -0,0 +1,90 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.policy_rule_conditions\ + import PolicyRuleConditions +from okta.models import device_access_policy_rule_condition\ + as device_access_policy_rule_condition +from okta.models import access_policy_rule_custom_condition\ + as access_policy_rule_custom_condition +from okta.models import user_type_condition\ + as user_type_condition + + +class AccessPolicyRuleConditions( + PolicyRuleConditions +): + """ + A class for AccessPolicyRuleConditions objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + if "device" in config: + if isinstance(config["device"], + device_access_policy_rule_condition.DeviceAccessPolicyRuleCondition): + self.device = config["device"] + elif config["device"] is not None: + self.device = device_access_policy_rule_condition.DeviceAccessPolicyRuleCondition( + config["device"] + ) + else: + self.device = None + else: + self.device = None + if "elCondition" in config: + if isinstance(config["elCondition"], + access_policy_rule_custom_condition.AccessPolicyRuleCustomCondition): + self.el_condition = config["elCondition"] + elif config["elCondition"] is not None: + self.el_condition = access_policy_rule_custom_condition.AccessPolicyRuleCustomCondition( + config["elCondition"] + ) + else: + self.el_condition = None + else: + self.el_condition = None + if "userType" in config: + if isinstance(config["userType"], + user_type_condition.UserTypeCondition): + self.user_type = config["userType"] + elif config["userType"] is not None: + self.user_type = user_type_condition.UserTypeCondition( + config["userType"] + ) + else: + self.user_type = None + else: + self.user_type = None + else: + self.device = None + self.el_condition = None + self.user_type = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "device": self.device, + "elCondition": self.el_condition, + "userType": self.user_type + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/access_policy_rule_custom_condition.py b/okta/models/access_policy_rule_custom_condition.py new file mode 100644 index 00000000..3e0332da --- /dev/null +++ b/okta/models/access_policy_rule_custom_condition.py @@ -0,0 +1,45 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject + + +class AccessPolicyRuleCustomCondition( + OktaObject +): + """ + A class for AccessPolicyRuleCustomCondition objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.condition = config["condition"]\ + if "condition" in config else None + else: + self.condition = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "condition": self.condition + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/application_credentials_username_template.py b/okta/models/application_credentials_username_template.py index f34c68f3..20f4822e 100644 --- a/okta/models/application_credentials_username_template.py +++ b/okta/models/application_credentials_username_template.py @@ -31,6 +31,8 @@ class ApplicationCredentialsUsernameTemplate( def __init__(self, config=None): super().__init__(config) if config: + self.push_status = config["pushStatus"]\ + if "pushStatus" in config else None self.suffix = config["suffix"]\ if "suffix" in config else None self.template = config["template"]\ @@ -38,6 +40,7 @@ def __init__(self, config=None): self.type = config["type"]\ if "type" in config else None else: + self.push_status = None self.suffix = None self.template = None self.type = None @@ -45,6 +48,7 @@ def __init__(self, config=None): def request_format(self): parent_req_format = super().request_format() current_obj_format = { + "pushStatus": self.push_status, "suffix": self.suffix, "template": self.template, "type": self.type diff --git a/okta/models/authenticator.py b/okta/models/authenticator.py index 53565453..2425ffe4 100644 --- a/okta/models/authenticator.py +++ b/okta/models/authenticator.py @@ -19,6 +19,8 @@ # SEE CONTRIBUTOR DOCUMENTATION from okta.okta_object import OktaObject +from okta.models import authenticator_provider\ + as authenticator_provider from okta.models import authenticator_settings\ as authenticator_settings from okta.models import authenticator_status\ @@ -49,6 +51,18 @@ def __init__(self, config=None): if "lastUpdated" in config else None self.name = config["name"]\ if "name" in config else None + if "provider" in config: + if isinstance(config["provider"], + authenticator_provider.AuthenticatorProvider): + self.provider = config["provider"] + elif config["provider"] is not None: + self.provider = authenticator_provider.AuthenticatorProvider( + config["provider"] + ) + else: + self.provider = None + else: + self.provider = None if "settings" in config: if isinstance(config["settings"], authenticator_settings.AuthenticatorSettings): @@ -92,6 +106,7 @@ def __init__(self, config=None): self.key = None self.last_updated = None self.name = None + self.provider = None self.settings = None self.status = None self.type = None @@ -105,6 +120,7 @@ def request_format(self): "key": self.key, "lastUpdated": self.last_updated, "name": self.name, + "provider": self.provider, "settings": self.settings, "status": self.status, "type": self.type diff --git a/okta/models/authenticator_provider.py b/okta/models/authenticator_provider.py new file mode 100644 index 00000000..fa1b1444 --- /dev/null +++ b/okta/models/authenticator_provider.py @@ -0,0 +1,61 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.models import authenticator_provider_configuration\ + as authenticator_provider_configuration + + +class AuthenticatorProvider( + OktaObject +): + """ + A class for AuthenticatorProvider objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + if "configuration" in config: + if isinstance(config["configuration"], + authenticator_provider_configuration.AuthenticatorProviderConfiguration): + self.configuration = config["configuration"] + elif config["configuration"] is not None: + self.configuration = authenticator_provider_configuration.AuthenticatorProviderConfiguration( + config["configuration"] + ) + else: + self.configuration = None + else: + self.configuration = None + self.type = config["type"]\ + if "type" in config else None + else: + self.configuration = None + self.type = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "configuration": self.configuration, + "type": self.type + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/authenticator_provider_configuration.py b/okta/models/authenticator_provider_configuration.py new file mode 100644 index 00000000..da90466e --- /dev/null +++ b/okta/models/authenticator_provider_configuration.py @@ -0,0 +1,73 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.models import authenticator_provider_configuration_user_name_plate\ + as authenticator_provider_configuration_user_name_plate + + +class AuthenticatorProviderConfiguration( + OktaObject +): + """ + A class for AuthenticatorProviderConfiguration objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.auth_port = config["authPort"]\ + if "authPort" in config else None + self.host_name = config["hostName"]\ + if "hostName" in config else None + self.instance_id = config["instanceId"]\ + if "instanceId" in config else None + self.shared_secret = config["sharedSecret"]\ + if "sharedSecret" in config else None + if "userNameTemplate" in config: + if isinstance(config["userNameTemplate"], + authenticator_provider_configuration_user_name_plate.AuthenticatorProviderConfigurationUserNamePlate): + self.user_name_template = config["userNameTemplate"] + elif config["userNameTemplate"] is not None: + self.user_name_template = authenticator_provider_configuration_user_name_plate.AuthenticatorProviderConfigurationUserNamePlate( + config["userNameTemplate"] + ) + else: + self.user_name_template = None + else: + self.user_name_template = None + else: + self.auth_port = None + self.host_name = None + self.instance_id = None + self.shared_secret = None + self.user_name_template = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "authPort": self.auth_port, + "hostName": self.host_name, + "instanceId": self.instance_id, + "sharedSecret": self.shared_secret, + "userNameTemplate": self.user_name_template + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/authenticator_provider_configuration_user_name_plate.py b/okta/models/authenticator_provider_configuration_user_name_plate.py new file mode 100644 index 00000000..be23be6d --- /dev/null +++ b/okta/models/authenticator_provider_configuration_user_name_plate.py @@ -0,0 +1,45 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject + + +class AuthenticatorProviderConfigurationUserNamePlate( + OktaObject +): + """ + A class for AuthenticatorProviderConfigurationUserNamePlate objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.template = config["template"]\ + if "template" in config else None + else: + self.template = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "template": self.template + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/authenticator_settings.py b/okta/models/authenticator_settings.py index aab52d5a..ab3b29eb 100644 --- a/okta/models/authenticator_settings.py +++ b/okta/models/authenticator_settings.py @@ -21,6 +21,12 @@ from okta.okta_object import OktaObject from okta.models import allowed_for_enum\ as allowed_for_enum +from okta.models import channel_binding\ + as channel_binding +from okta.models import compliance\ + as compliance +from okta.models import user_verification_enum\ + as user_verification_enum class AuthenticatorSettings( @@ -45,17 +51,63 @@ def __init__(self, config=None): self.allowed_for = None else: self.allowed_for = None + self.app_instance_id = config["appInstanceId"]\ + if "appInstanceId" in config else None + if "channelBinding" in config: + if isinstance(config["channelBinding"], + channel_binding.ChannelBinding): + self.channel_binding = config["channelBinding"] + elif config["channelBinding"] is not None: + self.channel_binding = channel_binding.ChannelBinding( + config["channelBinding"] + ) + else: + self.channel_binding = None + else: + self.channel_binding = None + if "compliance" in config: + if isinstance(config["compliance"], + compliance.Compliance): + self.compliance = config["compliance"] + elif config["compliance"] is not None: + self.compliance = compliance.Compliance( + config["compliance"] + ) + else: + self.compliance = None + else: + self.compliance = None self.token_lifetime_in_minutes = config["tokenLifetimeInMinutes"]\ if "tokenLifetimeInMinutes" in config else None + if "userVerification" in config: + if isinstance(config["userVerification"], + user_verification_enum.UserVerificationEnum): + self.user_verification = config["userVerification"] + elif config["userVerification"] is not None: + self.user_verification = user_verification_enum.UserVerificationEnum( + config["userVerification"].upper() + ) + else: + self.user_verification = None + else: + self.user_verification = None else: self.allowed_for = None + self.app_instance_id = None + self.channel_binding = None + self.compliance = None self.token_lifetime_in_minutes = None + self.user_verification = None def request_format(self): parent_req_format = super().request_format() current_obj_format = { "allowedFor": self.allowed_for, - "tokenLifetimeInMinutes": self.token_lifetime_in_minutes + "appInstanceId": self.app_instance_id, + "channelBinding": self.channel_binding, + "compliance": self.compliance, + "tokenLifetimeInMinutes": self.token_lifetime_in_minutes, + "userVerification": self.user_verification } parent_req_format.update(current_obj_format) return parent_req_format diff --git a/okta/models/authenticator_type.py b/okta/models/authenticator_type.py index 0f1e60ce..cfccd3a6 100644 --- a/okta/models/authenticator_type.py +++ b/okta/models/authenticator_type.py @@ -35,3 +35,4 @@ class AuthenticatorType( PHONE = "phone", "PHONE" EMAIL = "email", "EMAIL" SECURITY_KEY = "security_key", "SECURITY_KEY" + FEDERATED = "federated", "FEDERATED" diff --git a/okta/models/brand.py b/okta/models/brand.py new file mode 100644 index 00000000..ebdbf5e0 --- /dev/null +++ b/okta/models/brand.py @@ -0,0 +1,61 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject + + +class Brand( + OktaObject +): + """ + A class for Brand objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.links = config["links"]\ + if "links" in config else None + self.agree_to_custom_privacy_policy = config["agreeToCustomPrivacyPolicy"]\ + if "agreeToCustomPrivacyPolicy" in config else None + self.custom_privacy_policy_url = config["customPrivacyPolicyUrl"]\ + if "customPrivacyPolicyUrl" in config else None + self.id = config["id"]\ + if "id" in config else None + self.remove_powered_by_okta = config["removePoweredByOkta"]\ + if "removePoweredByOkta" in config else None + else: + self.links = None + self.agree_to_custom_privacy_policy = None + self.custom_privacy_policy_url = None + self.id = None + self.remove_powered_by_okta = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "_links": self.links, + "agreeToCustomPrivacyPolicy": self.agree_to_custom_privacy_policy, + "customPrivacyPolicyUrl": self.custom_privacy_policy_url, + "id": self.id, + "removePoweredByOkta": self.remove_powered_by_okta + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/channel_binding.py b/okta/models/channel_binding.py new file mode 100644 index 00000000..c88b4f79 --- /dev/null +++ b/okta/models/channel_binding.py @@ -0,0 +1,61 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.models import required_enum\ + as required_enum + + +class ChannelBinding( + OktaObject +): + """ + A class for ChannelBinding objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + if "required" in config: + if isinstance(config["required"], + required_enum.RequiredEnum): + self.required = config["required"] + elif config["required"] is not None: + self.required = required_enum.RequiredEnum( + config["required"].upper() + ) + else: + self.required = None + else: + self.required = None + self.style = config["style"]\ + if "style" in config else None + else: + self.required = None + self.style = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "required": self.required, + "style": self.style + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/compliance.py b/okta/models/compliance.py new file mode 100644 index 00000000..62f56322 --- /dev/null +++ b/okta/models/compliance.py @@ -0,0 +1,57 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.models import fips_enum\ + as fips_enum + + +class Compliance( + OktaObject +): + """ + A class for Compliance objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + if "fips" in config: + if isinstance(config["fips"], + fips_enum.FipsEnum): + self.fips = config["fips"] + elif config["fips"] is not None: + self.fips = fips_enum.FipsEnum( + config["fips"].upper() + ) + else: + self.fips = None + else: + self.fips = None + else: + self.fips = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "fips": self.fips + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/device_access_policy_rule_condition.py b/okta/models/device_access_policy_rule_condition.py new file mode 100644 index 00000000..b835cf77 --- /dev/null +++ b/okta/models/device_access_policy_rule_condition.py @@ -0,0 +1,49 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject + + +class DeviceAccessPolicyRuleCondition( + OktaObject +): + """ + A class for DeviceAccessPolicyRuleCondition objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.managed = config["managed"]\ + if "managed" in config else None + self.registered = config["registered"]\ + if "registered" in config else None + else: + self.managed = None + self.registered = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "managed": self.managed, + "registered": self.registered + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/email_template_touch_point_variant.py b/okta/models/email_template_touch_point_variant.py new file mode 100644 index 00000000..f38113ce --- /dev/null +++ b/okta/models/email_template_touch_point_variant.py @@ -0,0 +1,33 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from aenum import MultiValueEnum + + +class EmailTemplateTouchPointVariant( + str, + MultiValueEnum +): + """ + An enumeration class for EmailTemplateTouchPointVariant. + """ + + OKTA_DEFAULT = "OKTA_DEFAULT", "okta_default" + FULL_THEME = "FULL_THEME", "full_theme" diff --git a/okta/models/end_user_dashboard_touch_point_variant.py b/okta/models/end_user_dashboard_touch_point_variant.py new file mode 100644 index 00000000..e986e5b1 --- /dev/null +++ b/okta/models/end_user_dashboard_touch_point_variant.py @@ -0,0 +1,35 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from aenum import MultiValueEnum + + +class EndUserDashboardTouchPointVariant( + str, + MultiValueEnum +): + """ + An enumeration class for EndUserDashboardTouchPointVariant. + """ + + OKTA_DEFAULT = "OKTA_DEFAULT", "okta_default" + WHITE_LOGO_BACKGROUND = "WHITE_LOGO_BACKGROUND", "white_logo_background" + FULL_THEME = "FULL_THEME", "full_theme" + LOGO_ON_FULL_WHITE_BACKGROUND = "LOGO_ON_FULL_WHITE_BACKGROUND", "logo_on_full_white_background" diff --git a/okta/models/error_page_touch_point_variant.py b/okta/models/error_page_touch_point_variant.py new file mode 100644 index 00000000..211f8048 --- /dev/null +++ b/okta/models/error_page_touch_point_variant.py @@ -0,0 +1,34 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from aenum import MultiValueEnum + + +class ErrorPageTouchPointVariant( + str, + MultiValueEnum +): + """ + An enumeration class for ErrorPageTouchPointVariant. + """ + + OKTA_DEFAULT = "OKTA_DEFAULT", "okta_default" + BACKGROUND_SECONDARY_COLOR = "BACKGROUND_SECONDARY_COLOR", "background_secondary_color" + BACKGROUND_IMAGE = "BACKGROUND_IMAGE", "background_image" diff --git a/okta/models/fips_enum.py b/okta/models/fips_enum.py new file mode 100644 index 00000000..a1a6b58d --- /dev/null +++ b/okta/models/fips_enum.py @@ -0,0 +1,33 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from aenum import MultiValueEnum + + +class FipsEnum( + str, + MultiValueEnum +): + """ + An enumeration class for FipsEnum. + """ + + REQUIRED = "REQUIRED", "required" + OPTIONAL = "OPTIONAL", "optional" diff --git a/okta/models/image_upload_response.py b/okta/models/image_upload_response.py new file mode 100644 index 00000000..5b585c93 --- /dev/null +++ b/okta/models/image_upload_response.py @@ -0,0 +1,45 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject + + +class ImageUploadResponse( + OktaObject +): + """ + A class for ImageUploadResponse objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.url = config["url"]\ + if "url" in config else None + else: + self.url = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "url": self.url + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/knowledge_constraint.py b/okta/models/knowledge_constraint.py new file mode 100644 index 00000000..a1bbe713 --- /dev/null +++ b/okta/models/knowledge_constraint.py @@ -0,0 +1,41 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.access_policy_constraint\ + import AccessPolicyConstraint + + +class KnowledgeConstraint( + AccessPolicyConstraint +): + """ + A class for KnowledgeConstraint objects. + """ + + def __init__(self, config=None): + super().__init__(config) + pass + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/policy_type.py b/okta/models/policy_type.py index d196f5d2..e37f12e7 100644 --- a/okta/models/policy_type.py +++ b/okta/models/policy_type.py @@ -33,3 +33,5 @@ class PolicyType( OKTA_SIGN_ON = "OKTA_SIGN_ON", "okta_sign_on" PASSWORD = "PASSWORD", "password" IDP_DISCOVERY = "IDP_DISCOVERY", "idp_discovery" + PROFILE_ENROLLMENT = "PROFILE_ENROLLMENT", "profile_enrollment" + ACCESS_POLICY = "ACCESS_POLICY", "access_policy" diff --git a/okta/models/possession_constraint.py b/okta/models/possession_constraint.py new file mode 100644 index 00000000..b16b0ab5 --- /dev/null +++ b/okta/models/possession_constraint.py @@ -0,0 +1,58 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.access_policy_constraint\ + import AccessPolicyConstraint + + +class PossessionConstraint( + AccessPolicyConstraint +): + """ + A class for PossessionConstraint objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.device_bound = config["deviceBound"]\ + if "deviceBound" in config else None + self.hardware_protection = config["hardwareProtection"]\ + if "hardwareProtection" in config else None + self.phishing_resistant = config["phishingResistant"]\ + if "phishingResistant" in config else None + self.user_presence = config["userPresence"]\ + if "userPresence" in config else None + else: + self.device_bound = None + self.hardware_protection = None + self.phishing_resistant = None + self.user_presence = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "deviceBound": self.device_bound, + "hardwareProtection": self.hardware_protection, + "phishingResistant": self.phishing_resistant, + "userPresence": self.user_presence + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/pre_registration_inline_hook.py b/okta/models/pre_registration_inline_hook.py new file mode 100644 index 00000000..c7b67171 --- /dev/null +++ b/okta/models/pre_registration_inline_hook.py @@ -0,0 +1,45 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject + + +class PreRegistrationInlineHook( + OktaObject +): + """ + A class for PreRegistrationInlineHook objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.inline_hook_id = config["inlineHookId"]\ + if "inlineHookId" in config else None + else: + self.inline_hook_id = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "inlineHookId": self.inline_hook_id + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/profile_enrollment_policy.py b/okta/models/profile_enrollment_policy.py new file mode 100644 index 00000000..ff1bfee6 --- /dev/null +++ b/okta/models/profile_enrollment_policy.py @@ -0,0 +1,42 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.policy\ + import Policy +from okta.models.policy_type import PolicyType + + +class ProfileEnrollmentPolicy( + Policy +): + """ + A class for ProfileEnrollmentPolicy objects. + """ + + def __init__(self, config=None): + super().__init__(config) + pass + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/profile_enrollment_policy_rule.py b/okta/models/profile_enrollment_policy_rule.py new file mode 100644 index 00000000..76deda7c --- /dev/null +++ b/okta/models/profile_enrollment_policy_rule.py @@ -0,0 +1,63 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.policy_rule\ + import PolicyRule +from okta.models import profile_enrollment_policy_rule_actions\ + as profile_enrollment_policy_rule_actions + + +class ProfileEnrollmentPolicyRule( + PolicyRule +): + """ + A class for ProfileEnrollmentPolicyRule objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.type = "PROFILE_ENROLLMENT" + if "actions" in config: + if isinstance(config["actions"], + profile_enrollment_policy_rule_actions.ProfileEnrollmentPolicyRuleActions): + self.actions = config["actions"] + elif config["actions"] is not None: + self.actions = profile_enrollment_policy_rule_actions.ProfileEnrollmentPolicyRuleActions( + config["actions"] + ) + else: + self.actions = None + else: + self.actions = None + self.name = config["name"]\ + if "name" in config else None + else: + self.actions = None + self.name = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "actions": self.actions, + "name": self.name + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/profile_enrollment_policy_rule_action.py b/okta/models/profile_enrollment_policy_rule_action.py new file mode 100644 index 00000000..4901c51c --- /dev/null +++ b/okta/models/profile_enrollment_policy_rule_action.py @@ -0,0 +1,91 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.okta_collection import OktaCollection +from okta.models import profile_enrollment_policy_rule_activation_requirement\ + as profile_enrollment_policy_rule_activation_requirement +from okta.models import pre_registration_inline_hook\ + as pre_registration_inline_hook +from okta.models import profile_enrollment_policy_rule_profile_attribute\ + as profile_enrollment_policy_rule_profile_attribute + + +class ProfileEnrollmentPolicyRuleAction( + OktaObject +): + """ + A class for ProfileEnrollmentPolicyRuleAction objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.access = config["access"]\ + if "access" in config else None + if "activationRequirements" in config: + if isinstance(config["activationRequirements"], + profile_enrollment_policy_rule_activation_requirement.ProfileEnrollmentPolicyRuleActivationRequirement): + self.activation_requirements = config["activationRequirements"] + elif config["activationRequirements"] is not None: + self.activation_requirements = profile_enrollment_policy_rule_activation_requirement.ProfileEnrollmentPolicyRuleActivationRequirement( + config["activationRequirements"] + ) + else: + self.activation_requirements = None + else: + self.activation_requirements = None + self.pre_registration_inline_hooks = OktaCollection.form_list( + config["preRegistrationInlineHooks"] if "preRegistrationInlineHooks"\ + in config else [], + pre_registration_inline_hook.PreRegistrationInlineHook + ) + self.profile_attributes = OktaCollection.form_list( + config["profileAttributes"] if "profileAttributes"\ + in config else [], + profile_enrollment_policy_rule_profile_attribute.ProfileEnrollmentPolicyRuleProfileAttribute + ) + self.target_group_ids = OktaCollection.form_list( + config["targetGroupIds"] if "targetGroupIds"\ + in config else [], + str + ) + self.unknown_user_action = config["unknownUserAction"]\ + if "unknownUserAction" in config else None + else: + self.access = None + self.activation_requirements = None + self.pre_registration_inline_hooks = [] + self.profile_attributes = [] + self.target_group_ids = [] + self.unknown_user_action = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "access": self.access, + "activationRequirements": self.activation_requirements, + "preRegistrationInlineHooks": self.pre_registration_inline_hooks, + "profileAttributes": self.profile_attributes, + "targetGroupIds": self.target_group_ids, + "unknownUserAction": self.unknown_user_action + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/profile_enrollment_policy_rule_actions.py b/okta/models/profile_enrollment_policy_rule_actions.py new file mode 100644 index 00000000..56d9d3f0 --- /dev/null +++ b/okta/models/profile_enrollment_policy_rule_actions.py @@ -0,0 +1,58 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.policy_rule_actions\ + import PolicyRuleActions +from okta.models import profile_enrollment_policy_rule_action\ + as profile_enrollment_policy_rule_action + + +class ProfileEnrollmentPolicyRuleActions( + PolicyRuleActions +): + """ + A class for ProfileEnrollmentPolicyRuleActions objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + if "profileEnrollment" in config: + if isinstance(config["profileEnrollment"], + profile_enrollment_policy_rule_action.ProfileEnrollmentPolicyRuleAction): + self.profile_enrollment = config["profileEnrollment"] + elif config["profileEnrollment"] is not None: + self.profile_enrollment = profile_enrollment_policy_rule_action.ProfileEnrollmentPolicyRuleAction( + config["profileEnrollment"] + ) + else: + self.profile_enrollment = None + else: + self.profile_enrollment = None + else: + self.profile_enrollment = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "profileEnrollment": self.profile_enrollment + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/profile_enrollment_policy_rule_activation_requirement.py b/okta/models/profile_enrollment_policy_rule_activation_requirement.py new file mode 100644 index 00000000..7cc01b5d --- /dev/null +++ b/okta/models/profile_enrollment_policy_rule_activation_requirement.py @@ -0,0 +1,45 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject + + +class ProfileEnrollmentPolicyRuleActivationRequirement( + OktaObject +): + """ + A class for ProfileEnrollmentPolicyRuleActivationRequirement objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.email_verification = config["emailVerification"]\ + if "emailVerification" in config else None + else: + self.email_verification = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "emailVerification": self.email_verification + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/profile_enrollment_policy_rule_profile_attribute.py b/okta/models/profile_enrollment_policy_rule_profile_attribute.py new file mode 100644 index 00000000..6cd49472 --- /dev/null +++ b/okta/models/profile_enrollment_policy_rule_profile_attribute.py @@ -0,0 +1,53 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject + + +class ProfileEnrollmentPolicyRuleProfileAttribute( + OktaObject +): + """ + A class for ProfileEnrollmentPolicyRuleProfileAttribute objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.label = config["label"]\ + if "label" in config else None + self.name = config["name"]\ + if "name" in config else None + self.required = config["required"]\ + if "required" in config else None + else: + self.label = None + self.name = None + self.required = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "label": self.label, + "name": self.name, + "required": self.required + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/required_enum.py b/okta/models/required_enum.py new file mode 100644 index 00000000..6034d03d --- /dev/null +++ b/okta/models/required_enum.py @@ -0,0 +1,34 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from aenum import MultiValueEnum + + +class RequiredEnum( + str, + MultiValueEnum +): + """ + An enumeration class for RequiredEnum. + """ + + ALWAYS = "ALWAYS", "always" + HIGH_RISK_ONLY = "HIGH_RISK_ONLY", "high_risk_only" + NEVER = "NEVER", "never" diff --git a/okta/models/sign_in_page_touch_point_variant.py b/okta/models/sign_in_page_touch_point_variant.py new file mode 100644 index 00000000..9dc4c9e4 --- /dev/null +++ b/okta/models/sign_in_page_touch_point_variant.py @@ -0,0 +1,34 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from aenum import MultiValueEnum + + +class SignInPageTouchPointVariant( + str, + MultiValueEnum +): + """ + An enumeration class for SignInPageTouchPointVariant. + """ + + OKTA_DEFAULT = "OKTA_DEFAULT", "okta_default" + BACKGROUND_SECONDARY_COLOR = "BACKGROUND_SECONDARY_COLOR", "background_secondary_color" + BACKGROUND_IMAGE = "BACKGROUND_IMAGE", "background_image" diff --git a/okta/models/swa_application_settings_application.py b/okta/models/swa_application_settings_application.py index 7b7cd9c0..bb2153bd 100644 --- a/okta/models/swa_application_settings_application.py +++ b/okta/models/swa_application_settings_application.py @@ -34,18 +34,24 @@ def __init__(self, config=None): if config: self.button_field = config["buttonField"]\ if "buttonField" in config else None + self.checkbox = config["checkbox"]\ + if "checkbox" in config else None self.login_url_regex = config["loginUrlRegex"]\ if "loginUrlRegex" in config else None self.password_field = config["passwordField"]\ if "passwordField" in config else None + self.redirect_url = config["redirectUrl"]\ + if "redirectUrl" 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.button_field = None + self.checkbox = None self.login_url_regex = None self.password_field = None + self.redirect_url = None self.url = None self.username_field = None @@ -53,8 +59,10 @@ def request_format(self): parent_req_format = super().request_format() current_obj_format = { "buttonField": self.button_field, + "checkbox": self.checkbox, "loginUrlRegex": self.login_url_regex, "passwordField": self.password_field, + "redirectUrl": self.redirect_url, "url": self.url, "usernameField": self.username_field } diff --git a/okta/models/theme.py b/okta/models/theme.py new file mode 100644 index 00000000..690bfdf8 --- /dev/null +++ b/okta/models/theme.py @@ -0,0 +1,129 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.models import email_template_touch_point_variant\ + as email_template_touch_point_variant +from okta.models import end_user_dashboard_touch_point_variant\ + as end_user_dashboard_touch_point_variant +from okta.models import error_page_touch_point_variant\ + as error_page_touch_point_variant +from okta.models import sign_in_page_touch_point_variant\ + as sign_in_page_touch_point_variant + + +class Theme( + OktaObject +): + """ + A class for Theme objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.links = config["links"]\ + if "links" in config else None + self.background_image = config["backgroundImage"]\ + if "backgroundImage" in config else None + if "emailTemplateTouchPointVariant" in config: + if isinstance(config["emailTemplateTouchPointVariant"], + email_template_touch_point_variant.EmailTemplateTouchPointVariant): + self.email_template_touch_point_variant = config["emailTemplateTouchPointVariant"] + elif config["emailTemplateTouchPointVariant"] is not None: + self.email_template_touch_point_variant = email_template_touch_point_variant.EmailTemplateTouchPointVariant( + config["emailTemplateTouchPointVariant"].upper() + ) + else: + self.email_template_touch_point_variant = None + else: + self.email_template_touch_point_variant = None + if "endUserDashboardTouchPointVariant" in config: + if isinstance(config["endUserDashboardTouchPointVariant"], + end_user_dashboard_touch_point_variant.EndUserDashboardTouchPointVariant): + self.end_user_dashboard_touch_point_variant = config["endUserDashboardTouchPointVariant"] + elif config["endUserDashboardTouchPointVariant"] is not None: + self.end_user_dashboard_touch_point_variant = end_user_dashboard_touch_point_variant.EndUserDashboardTouchPointVariant( + config["endUserDashboardTouchPointVariant"].upper() + ) + else: + self.end_user_dashboard_touch_point_variant = None + else: + self.end_user_dashboard_touch_point_variant = None + if "errorPageTouchPointVariant" in config: + if isinstance(config["errorPageTouchPointVariant"], + error_page_touch_point_variant.ErrorPageTouchPointVariant): + self.error_page_touch_point_variant = config["errorPageTouchPointVariant"] + elif config["errorPageTouchPointVariant"] is not None: + self.error_page_touch_point_variant = error_page_touch_point_variant.ErrorPageTouchPointVariant( + config["errorPageTouchPointVariant"].upper() + ) + else: + self.error_page_touch_point_variant = None + else: + self.error_page_touch_point_variant = None + self.primary_color_contrast_hex = config["primaryColorContrastHex"]\ + if "primaryColorContrastHex" in config else None + self.primary_color_hex = config["primaryColorHex"]\ + if "primaryColorHex" in config else None + self.secondary_color_contrast_hex = config["secondaryColorContrastHex"]\ + if "secondaryColorContrastHex" in config else None + self.secondary_color_hex = config["secondaryColorHex"]\ + if "secondaryColorHex" in config else None + if "signInPageTouchPointVariant" in config: + if isinstance(config["signInPageTouchPointVariant"], + sign_in_page_touch_point_variant.SignInPageTouchPointVariant): + self.sign_in_page_touch_point_variant = config["signInPageTouchPointVariant"] + elif config["signInPageTouchPointVariant"] is not None: + self.sign_in_page_touch_point_variant = sign_in_page_touch_point_variant.SignInPageTouchPointVariant( + config["signInPageTouchPointVariant"].upper() + ) + else: + self.sign_in_page_touch_point_variant = None + else: + self.sign_in_page_touch_point_variant = None + else: + self.links = None + self.background_image = None + self.email_template_touch_point_variant = None + self.end_user_dashboard_touch_point_variant = None + self.error_page_touch_point_variant = None + self.primary_color_contrast_hex = None + self.primary_color_hex = None + self.secondary_color_contrast_hex = None + self.secondary_color_hex = None + self.sign_in_page_touch_point_variant = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "_links": self.links, + "backgroundImage": self.background_image, + "emailTemplateTouchPointVariant": self.email_template_touch_point_variant, + "endUserDashboardTouchPointVariant": self.end_user_dashboard_touch_point_variant, + "errorPageTouchPointVariant": self.error_page_touch_point_variant, + "primaryColorContrastHex": self.primary_color_contrast_hex, + "primaryColorHex": self.primary_color_hex, + "secondaryColorContrastHex": self.secondary_color_contrast_hex, + "secondaryColorHex": self.secondary_color_hex, + "signInPageTouchPointVariant": self.sign_in_page_touch_point_variant + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/theme_response.py b/okta/models/theme_response.py new file mode 100644 index 00000000..a4649e42 --- /dev/null +++ b/okta/models/theme_response.py @@ -0,0 +1,141 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.models import email_template_touch_point_variant\ + as email_template_touch_point_variant +from okta.models import end_user_dashboard_touch_point_variant\ + as end_user_dashboard_touch_point_variant +from okta.models import error_page_touch_point_variant\ + as error_page_touch_point_variant +from okta.models import sign_in_page_touch_point_variant\ + as sign_in_page_touch_point_variant + + +class ThemeResponse( + OktaObject +): + """ + A class for ThemeResponse objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.links = config["links"]\ + if "links" in config else None + self.background_image = config["backgroundImage"]\ + if "backgroundImage" in config else None + if "emailTemplateTouchPointVariant" in config: + if isinstance(config["emailTemplateTouchPointVariant"], + email_template_touch_point_variant.EmailTemplateTouchPointVariant): + self.email_template_touch_point_variant = config["emailTemplateTouchPointVariant"] + elif config["emailTemplateTouchPointVariant"] is not None: + self.email_template_touch_point_variant = email_template_touch_point_variant.EmailTemplateTouchPointVariant( + config["emailTemplateTouchPointVariant"].upper() + ) + else: + self.email_template_touch_point_variant = None + else: + self.email_template_touch_point_variant = None + if "endUserDashboardTouchPointVariant" in config: + if isinstance(config["endUserDashboardTouchPointVariant"], + end_user_dashboard_touch_point_variant.EndUserDashboardTouchPointVariant): + self.end_user_dashboard_touch_point_variant = config["endUserDashboardTouchPointVariant"] + elif config["endUserDashboardTouchPointVariant"] is not None: + self.end_user_dashboard_touch_point_variant = end_user_dashboard_touch_point_variant.EndUserDashboardTouchPointVariant( + config["endUserDashboardTouchPointVariant"].upper() + ) + else: + self.end_user_dashboard_touch_point_variant = None + else: + self.end_user_dashboard_touch_point_variant = None + if "errorPageTouchPointVariant" in config: + if isinstance(config["errorPageTouchPointVariant"], + error_page_touch_point_variant.ErrorPageTouchPointVariant): + self.error_page_touch_point_variant = config["errorPageTouchPointVariant"] + elif config["errorPageTouchPointVariant"] is not None: + self.error_page_touch_point_variant = error_page_touch_point_variant.ErrorPageTouchPointVariant( + config["errorPageTouchPointVariant"].upper() + ) + else: + self.error_page_touch_point_variant = None + else: + self.error_page_touch_point_variant = None + self.favicon = config["favicon"]\ + if "favicon" in config else None + self.id = config["id"]\ + if "id" in config else None + self.logo = config["logo"]\ + if "logo" in config else None + self.primary_color_contrast_hex = config["primaryColorContrastHex"]\ + if "primaryColorContrastHex" in config else None + self.primary_color_hex = config["primaryColorHex"]\ + if "primaryColorHex" in config else None + self.secondary_color_contrast_hex = config["secondaryColorContrastHex"]\ + if "secondaryColorContrastHex" in config else None + self.secondary_color_hex = config["secondaryColorHex"]\ + if "secondaryColorHex" in config else None + if "signInPageTouchPointVariant" in config: + if isinstance(config["signInPageTouchPointVariant"], + sign_in_page_touch_point_variant.SignInPageTouchPointVariant): + self.sign_in_page_touch_point_variant = config["signInPageTouchPointVariant"] + elif config["signInPageTouchPointVariant"] is not None: + self.sign_in_page_touch_point_variant = sign_in_page_touch_point_variant.SignInPageTouchPointVariant( + config["signInPageTouchPointVariant"].upper() + ) + else: + self.sign_in_page_touch_point_variant = None + else: + self.sign_in_page_touch_point_variant = None + else: + self.links = None + self.background_image = None + self.email_template_touch_point_variant = None + self.end_user_dashboard_touch_point_variant = None + self.error_page_touch_point_variant = None + self.favicon = None + self.id = None + self.logo = None + self.primary_color_contrast_hex = None + self.primary_color_hex = None + self.secondary_color_contrast_hex = None + self.secondary_color_hex = None + self.sign_in_page_touch_point_variant = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "_links": self.links, + "backgroundImage": self.background_image, + "emailTemplateTouchPointVariant": self.email_template_touch_point_variant, + "endUserDashboardTouchPointVariant": self.end_user_dashboard_touch_point_variant, + "errorPageTouchPointVariant": self.error_page_touch_point_variant, + "favicon": self.favicon, + "id": self.id, + "logo": self.logo, + "primaryColorContrastHex": self.primary_color_contrast_hex, + "primaryColorHex": self.primary_color_hex, + "secondaryColorContrastHex": self.secondary_color_contrast_hex, + "secondaryColorHex": self.secondary_color_hex, + "signInPageTouchPointVariant": self.sign_in_page_touch_point_variant + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/user_id_string.py b/okta/models/user_id_string.py index 38de24ca..03451de7 100644 --- a/okta/models/user_id_string.py +++ b/okta/models/user_id_string.py @@ -18,11 +18,12 @@ # AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY # SEE CONTRIBUTOR DOCUMENTATION -from okta.okta_object import OktaObject +from okta.models.org_contact_user\ + import OrgContactUser class UserIdString( - OktaObject + OrgContactUser ): """ A class for UserIdString objects. diff --git a/okta/models/user_type_condition.py b/okta/models/user_type_condition.py new file mode 100644 index 00000000..3f985678 --- /dev/null +++ b/okta/models/user_type_condition.py @@ -0,0 +1,56 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.okta_collection import OktaCollection + + +class UserTypeCondition( + OktaObject +): + """ + A class for UserTypeCondition objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.exclude = OktaCollection.form_list( + config["exclude"] if "exclude"\ + in config else [], + str + ) + self.include = OktaCollection.form_list( + config["include"] if "include"\ + in config else [], + str + ) + else: + self.exclude = [] + self.include = [] + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "exclude": self.exclude, + "include": self.include + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/models/user_verification_enum.py b/okta/models/user_verification_enum.py new file mode 100644 index 00000000..57f99745 --- /dev/null +++ b/okta/models/user_verification_enum.py @@ -0,0 +1,33 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from aenum import MultiValueEnum + + +class UserVerificationEnum( + str, + MultiValueEnum +): + """ + An enumeration class for UserVerificationEnum. + """ + + REQUIRED = "REQUIRED", "required" + PREFERRED = "PREFERRED", "preferred" diff --git a/okta/models/verification_method.py b/okta/models/verification_method.py new file mode 100644 index 00000000..ea33acd9 --- /dev/null +++ b/okta/models/verification_method.py @@ -0,0 +1,63 @@ +# flake8: noqa +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.okta_object import OktaObject +from okta.okta_collection import OktaCollection +from okta.models import access_policy_constraints\ + as access_policy_constraints + + +class VerificationMethod( + OktaObject +): + """ + A class for VerificationMethod objects. + """ + + def __init__(self, config=None): + super().__init__(config) + if config: + self.constraints = OktaCollection.form_list( + config["constraints"] if "constraints"\ + in config else [], + access_policy_constraints.AccessPolicyConstraints + ) + self.factor_mode = config["factorMode"]\ + if "factorMode" in config else None + self.reauthenticate_in = config["reauthenticateIn"]\ + if "reauthenticateIn" in config else None + self.type = config["type"]\ + if "type" in config else None + else: + self.constraints = [] + self.factor_mode = None + self.reauthenticate_in = None + self.type = None + + def request_format(self): + parent_req_format = super().request_format() + current_obj_format = { + "constraints": self.constraints, + "factorMode": self.factor_mode, + "reauthenticateIn": self.reauthenticate_in, + "type": self.type + } + parent_req_format.update(current_obj_format) + return parent_req_format diff --git a/okta/request_executor.py b/okta/request_executor.py index 43040644..62963018 100644 --- a/okta/request_executor.py +++ b/okta/request_executor.py @@ -67,8 +67,8 @@ def __init__(self, config, cache, http_client=None): self._http_client = http_client_impl({ 'requestTimeout': self._request_timeout, 'headers': self._default_headers, - 'proxy': self._config["client"]["proxy"] if "proxy" - in self._config["client"] else None + 'proxy': self._config["client"].get("proxy"), + 'sslContext': self._config["client"].get("sslContext") }) HTTPClient.raise_exception = \ self._config['client'].get("raiseException", False) @@ -95,7 +95,7 @@ def clear_empty_params(self, body: dict): return body async def create_request(self, method: str, url: str, body: dict = None, - headers: dict = {}, oauth=False, keep_empty_params=False): + headers: dict = {}, form: dict = {}, oauth=False, keep_empty_params=False): """ Creates request for request executor's HTTP client. @@ -141,7 +141,7 @@ async def create_request(self, method: str, url: str, body: dict = None, self._cache.add("OKTA_ACCESS_TOKEN", access_token) # Add content type header if request body exists - if body is not None: + if body: headers.update({"Content-Type": "application/json"}) if not keep_empty_params: body = self.clear_empty_params(body) @@ -150,6 +150,7 @@ async def create_request(self, method: str, url: str, body: dict = None, request["headers"] = headers request["url"] = url request["data"] = body + request["form"] = form return (request, None) diff --git a/okta/resource_clients/application_client.py b/okta/resource_clients/application_client.py index 2152407c..354ceec7 100644 --- a/okta/resource_clients/application_client.py +++ b/okta/resource_clients/application_client.py @@ -76,9 +76,10 @@ async def list_applications( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -132,9 +133,10 @@ async def create_application( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -172,9 +174,10 @@ async def delete_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -213,9 +216,10 @@ async def get_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -262,9 +266,10 @@ async def update_application( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -305,9 +310,10 @@ async def list_csrs_for_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -356,9 +362,10 @@ async def generate_csr_for_application( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -397,9 +404,10 @@ async def revoke_csr_from_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -434,9 +442,10 @@ async def get_csr_for_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -486,9 +495,10 @@ async def publish_cer_cert( "Accept": "application/json", "Content-Type": "application/x-x509-ca-cert" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -535,9 +545,10 @@ async def publish_binary_cer_cert( "Accept": "application/json", "Content-Type": "application/x-x509-ca-cert" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -587,9 +598,10 @@ async def publish_der_cert( "Accept": "application/json", "Content-Type": "application/pkix-cert" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -636,9 +648,10 @@ async def publish_binary_der_cert( "Accept": "application/json", "Content-Type": "application/pkix-cert" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -685,9 +698,10 @@ async def publish_binary_pem_cert( "Accept": "application/json", "Content-Type": "application/x-pem-file" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -726,9 +740,10 @@ async def list_application_keys( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -775,9 +790,10 @@ async def generate_application_key( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -817,9 +833,10 @@ async def get_application_key( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -865,9 +882,10 @@ async def clone_application_key( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -911,9 +929,10 @@ async def list_scope_consent_grants( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -962,9 +981,10 @@ async def grant_consent_to_scope( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1003,9 +1023,10 @@ async def revoke_scope_consent_grant( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1045,9 +1066,10 @@ async def get_scope_consent_grant( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1094,9 +1116,10 @@ async def list_application_group_assignments( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1136,9 +1159,10 @@ async def delete_application_group_assignment( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1177,9 +1201,10 @@ async def get_application_group_assignment( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1226,9 +1251,10 @@ async def create_application_group_assignment( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1265,9 +1291,10 @@ async def activate_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1298,9 +1325,10 @@ async def deactivate_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1331,9 +1359,10 @@ async def revoke_o_auth_2_tokens_for_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1373,9 +1402,10 @@ async def list_o_auth_2_tokens_for_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1416,9 +1446,10 @@ async def revoke_o_auth_2_token_for_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1457,9 +1488,10 @@ async def get_o_auth_2_token_for_application( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1509,9 +1541,10 @@ async def list_application_users( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1564,9 +1597,10 @@ async def assign_user_to_application( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1609,9 +1643,10 @@ async def delete_application_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1651,9 +1686,10 @@ async def get_application_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1700,9 +1736,10 @@ async def update_application_user( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/authenticator_client.py b/okta/resource_clients/authenticator_client.py index 19b25480..79b87911 100644 --- a/okta/resource_clients/authenticator_client.py +++ b/okta/resource_clients/authenticator_client.py @@ -48,9 +48,10 @@ async def list_authenticators( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -90,9 +91,59 @@ async def get_authenticator( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, Authenticator) + + if error: + return (None, response, error) + + try: + result = Authenticator( + self.form_response_body(response.get_body()) + ) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def update_authenticator( + self, authenticatorId, authenticator, + keep_empty_params=False + ): + """ + Updates an authenticator + Args: + authenticator_id {str} + {authenticator} + Returns: + Authenticator + """ + http_method = "put".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/authenticators/{authenticatorId} + """) + + if isinstance(authenticator, dict): + body = authenticator + else: + body = authenticator.as_dict() + headers = { + "Accept": "application/json", + "Content-Type": "application/json" + } + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -131,9 +182,10 @@ async def activate_authenticator( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -172,9 +224,10 @@ async def deactivate_authenticator( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/authorization_server_client.py b/okta/resource_clients/authorization_server_client.py index bf348024..be5dd7ea 100644 --- a/okta/resource_clients/authorization_server_client.py +++ b/okta/resource_clients/authorization_server_client.py @@ -70,9 +70,10 @@ async def list_authorization_servers( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -118,9 +119,10 @@ async def create_authorization_server( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -156,9 +158,10 @@ async def delete_authorization_server( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -190,9 +193,10 @@ async def get_authorization_server( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -237,9 +241,10 @@ async def update_authorization_server( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -277,9 +282,10 @@ async def list_o_auth_2_claims( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -326,9 +332,10 @@ async def create_o_auth_2_claim( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -366,9 +373,10 @@ async def delete_o_auth_2_claim( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -402,9 +410,10 @@ async def get_o_auth_2_claim( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -451,9 +460,10 @@ async def update_o_auth_2_claim( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -491,9 +501,10 @@ async def list_o_auth_2_clients_for_authorization_server( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -533,9 +544,10 @@ async def revoke_refresh_tokens_for_authorization_server_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -576,9 +588,10 @@ async def list_refresh_tokens_for_authorization_server_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -619,9 +632,10 @@ async def revoke_refresh_token_for_authorization_server_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -661,9 +675,10 @@ async def get_refresh_token_for_authorization_server_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -702,9 +717,10 @@ async def list_authorization_server_keys( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -751,9 +767,10 @@ async def rotate_authorization_server_keys( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -792,9 +809,10 @@ async def activate_authorization_server( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -825,9 +843,10 @@ async def deactivate_authorization_server( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -860,9 +879,10 @@ async def list_authorization_server_policies( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -910,9 +930,10 @@ async def create_authorization_server_policy( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -950,9 +971,10 @@ async def delete_authorization_server_policy( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -986,9 +1008,10 @@ async def get_authorization_server_policy( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1035,9 +1058,10 @@ async def update_authorization_server_policy( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1076,9 +1100,10 @@ async def activate_authorization_server_policy( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1111,9 +1136,10 @@ async def deactivate_authorization_server_policy( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1149,9 +1175,10 @@ async def list_authorization_server_policy_rules( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1202,9 +1229,10 @@ async def create_authorization_server_policy_rule( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1245,9 +1273,10 @@ async def delete_authorization_server_policy_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1284,9 +1313,10 @@ async def get_authorization_server_policy_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1336,9 +1366,10 @@ async def update_authorization_server_policy_rule( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1379,9 +1410,10 @@ async def activate_authorization_server_policy_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1416,9 +1448,10 @@ async def deactivate_authorization_server_policy_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1458,9 +1491,10 @@ async def list_o_auth_2_scopes( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1507,9 +1541,10 @@ async def create_o_auth_2_scope( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1547,9 +1582,10 @@ async def delete_o_auth_2_scope( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1583,9 +1619,10 @@ async def get_o_auth_2_scope( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1632,9 +1669,10 @@ async def update_o_auth_2_scope( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/brand_client.py b/okta/resource_clients/brand_client.py new file mode 100644 index 00000000..889465b0 --- /dev/null +++ b/okta/resource_clients/brand_client.py @@ -0,0 +1,551 @@ +""" +Copyright 2021 - Present Okta, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY +# SEE CONTRIBUTOR DOCUMENTATION + +from okta.models.brand\ + import Brand +from okta.models.theme_response\ + import ThemeResponse +from okta.models.image_upload_response\ + import ImageUploadResponse +from okta.utils import format_url +from okta.api_client import APIClient + + +class BrandClient(APIClient): + """ + A Client object for the Brand resource. + """ + + def __init__(self): + self._base_url = "" + + async def list_brands( + self, + keep_empty_params=False + ): + """ + List all the brands in your org. + Args: + Returns: + list: Collection of Brand instances. + """ + http_method = "get".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands + """) + + body = {} + headers = {} + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, Brand) + + if error: + return (None, response, error) + + try: + result = [] + for item in response.get_body(): + result.append(Brand( + self.form_response_body(item) + )) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def get_brand( + self, brandId, + keep_empty_params=False + ): + """ + Fetches a brand by `brandId` + Args: + brand_id {str} + Returns: + Brand + """ + http_method = "get".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId} + """) + + body = {} + headers = {} + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, Brand) + + if error: + return (None, response, error) + + try: + result = Brand( + self.form_response_body(response.get_body()) + ) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def update_brand( + self, brandId, brand, + keep_empty_params=False + ): + """ + Updates a brand by `brandId` + Args: + brand_id {str} + {brand} + Returns: + Brand + """ + http_method = "put".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId} + """) + + if isinstance(brand, dict): + body = brand + else: + body = brand.as_dict() + headers = { + "Accept": "application/json", + "Content-Type": "application/json" + } + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, Brand) + + if error: + return (None, response, error) + + try: + result = Brand( + self.form_response_body(response.get_body()) + ) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def list_brand_themes( + self, brandId, + keep_empty_params=False + ): + """ + List all the themes in your brand + Args: + brand_id {str} + Returns: + list: Collection of ThemeResponse instances. + """ + http_method = "get".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes + """) + + body = {} + headers = {} + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, ThemeResponse) + + if error: + return (None, response, error) + + try: + result = [] + for item in response.get_body(): + result.append(ThemeResponse( + self.form_response_body(item) + )) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def get_brand_theme( + self, brandId, themeId, + keep_empty_params=False + ): + """ + Fetches a theme for a brand + Args: + brand_id {str} + theme_id {str} + Returns: + ThemeResponse + """ + http_method = "get".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes/{themeId} + """) + + body = {} + headers = {} + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, ThemeResponse) + + if error: + return (None, response, error) + + try: + result = ThemeResponse( + self.form_response_body(response.get_body()) + ) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def update_brand_theme( + self, brandId, themeId, theme, + keep_empty_params=False + ): + """ + Updates a theme for a brand + Args: + brand_id {str} + theme_id {str} + {theme} + Returns: + ThemeResponse + """ + http_method = "put".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes/{themeId} + """) + + if isinstance(theme, dict): + body = theme + else: + body = theme.as_dict() + headers = { + "Accept": "application/json", + "Content-Type": "application/json" + } + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, ThemeResponse) + + if error: + return (None, response, error) + + try: + result = ThemeResponse( + self.form_response_body(response.get_body()) + ) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def delete_brand_theme_background_image( + self, brandId, themeId, + keep_empty_params=False + ): + """ + Deletes a Theme background image + Args: + brand_id {str} + theme_id {str} + """ + http_method = "delete".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes/{themeId} + /background-image + """) + + body = {} + headers = {} + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, error) + + response, error = await self._request_executor\ + .execute(request) + + if error: + return (response, error) + + return (response, None) + + async def upload_brand_theme_background_image( + self, brandId, themeId, file, + keep_empty_params=False + ): + """ + Updates the background image for your Theme + Args: + brand_id {str} + theme_id {str} + Returns: + ImageUploadResponse + """ + http_method = "post".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes/{themeId} + /background-image + """) + + body = {} + headers = {} + form = { + "file": file, + } + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, ImageUploadResponse) + + if error: + return (None, response, error) + + try: + result = ImageUploadResponse( + self.form_response_body(response.get_body()) + ) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def delete_brand_theme_favicon( + self, brandId, themeId, + keep_empty_params=False + ): + """ + Deletes a Theme favicon. The org then uses the Okta def + ault favicon. + Args: + brand_id {str} + theme_id {str} + """ + http_method = "delete".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes/{themeId}/favicon + """) + + body = {} + headers = {} + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, error) + + response, error = await self._request_executor\ + .execute(request) + + if error: + return (response, error) + + return (response, None) + + async def upload_brand_theme_favicon( + self, brandId, themeId, file, + keep_empty_params=False + ): + """ + Updates the favicon for your theme + Args: + brand_id {str} + theme_id {str} + Returns: + ImageUploadResponse + """ + http_method = "post".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes/{themeId}/favicon + """) + + body = {} + headers = {} + form = { + "file": file, + } + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, ImageUploadResponse) + + if error: + return (None, response, error) + + try: + result = ImageUploadResponse( + self.form_response_body(response.get_body()) + ) + except Exception as error: + return (None, response, error) + return (result, response, None) + + async def delete_brand_theme_logo( + self, brandId, themeId, + keep_empty_params=False + ): + """ + Deletes a Theme logo. The org then uses the Okta defaul + t logo. + Args: + brand_id {str} + theme_id {str} + """ + http_method = "delete".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes/{themeId}/logo + """) + + body = {} + headers = {} + form = {} + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, error) + + response, error = await self._request_executor\ + .execute(request) + + if error: + return (response, error) + + return (response, None) + + async def upload_brand_theme_logo( + self, brandId, themeId, file, + keep_empty_params=False + ): + """ + Updates the logo for your Theme + Args: + brand_id {str} + theme_id {str} + Returns: + ImageUploadResponse + """ + http_method = "post".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/brands/{brandId}/themes/{themeId}/logo + """) + + body = {} + headers = {} + form = { + "file": file, + } + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, None, error) + + response, error = await self._request_executor\ + .execute(request, ImageUploadResponse) + + if error: + return (None, response, error) + + try: + result = ImageUploadResponse( + self.form_response_body(response.get_body()) + ) + except Exception as error: + return (None, response, error) + return (result, response, None) diff --git a/okta/resource_clients/domain_client.py b/okta/resource_clients/domain_client.py index 801b0c09..1c4396f2 100644 --- a/okta/resource_clients/domain_client.py +++ b/okta/resource_clients/domain_client.py @@ -51,9 +51,10 @@ async def list_domains( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -98,9 +99,10 @@ async def create_domain( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -137,9 +139,10 @@ async def delete_domain( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -172,9 +175,10 @@ async def get_domain( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -218,9 +222,10 @@ async def create_certificate( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -253,9 +258,10 @@ async def verify_domain( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/event_hook_client.py b/okta/resource_clients/event_hook_client.py index e9863fb9..010c2c74 100644 --- a/okta/resource_clients/event_hook_client.py +++ b/okta/resource_clients/event_hook_client.py @@ -48,9 +48,10 @@ async def list_event_hooks( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -96,9 +97,10 @@ async def create_event_hook( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -134,9 +136,10 @@ async def delete_event_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -168,9 +171,10 @@ async def get_event_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -215,9 +219,10 @@ async def update_event_hook( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -255,9 +260,10 @@ async def activate_event_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -296,9 +302,10 @@ async def deactivate_event_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -336,9 +343,10 @@ async def verify_event_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/feature_client.py b/okta/resource_clients/feature_client.py index 9b850f13..684151fc 100644 --- a/okta/resource_clients/feature_client.py +++ b/okta/resource_clients/feature_client.py @@ -49,9 +49,10 @@ async def list_features( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -91,9 +92,10 @@ async def get_feature( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -131,9 +133,10 @@ async def list_feature_dependencies( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -173,9 +176,10 @@ async def list_feature_dependents( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -221,9 +225,10 @@ async def update_feature_lifecycle( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/group_client.py b/okta/resource_clients/group_client.py index f1fb0225..4de4a08d 100644 --- a/okta/resource_clients/group_client.py +++ b/okta/resource_clients/group_client.py @@ -72,9 +72,10 @@ async def list_groups( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -122,9 +123,10 @@ async def create_group( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -170,9 +172,10 @@ async def list_group_rules( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -220,9 +223,10 @@ async def create_group_rule( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -265,9 +269,10 @@ async def delete_group_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -306,9 +311,10 @@ async def get_group_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -355,9 +361,10 @@ async def update_group_rule( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -395,9 +402,10 @@ async def activate_group_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -429,9 +437,10 @@ async def deactivate_group_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -463,9 +472,10 @@ async def delete_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -498,9 +508,10 @@ async def get_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -547,9 +558,10 @@ async def update_group( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -595,9 +607,10 @@ async def list_assigned_applications_for_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -644,9 +657,10 @@ async def list_group_assigned_roles( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -699,9 +713,10 @@ async def assign_role_to_group( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -739,9 +754,10 @@ async def remove_role_from_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -774,9 +790,10 @@ async def get_role( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -827,9 +844,10 @@ async def list_app_targets_for_application_admin_role_for_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -870,9 +888,10 @@ async def remove_app_target_from_application_admin_role_given_to_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -905,9 +924,10 @@ async def add_application_target_to_admin_role_given_to_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -943,9 +963,10 @@ async def remove_app_target_from_admin_role_given_to_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -981,9 +1002,10 @@ async def add_app_instance_target_to_app_admin_role_given_to_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1023,9 +1045,10 @@ async def list_group_targets_for_group_role( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1069,9 +1092,10 @@ async def remove_group_target_from_group_admin_role_given_to_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1107,9 +1131,10 @@ async def add_group_target_to_group_administrator_role_for_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1148,9 +1173,10 @@ async def list_group_users( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1188,9 +1214,10 @@ async def remove_user_from_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1222,9 +1249,10 @@ async def add_user_to_group( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/group_schema_client.py b/okta/resource_clients/group_schema_client.py index 12733fbb..d2f23daa 100644 --- a/okta/resource_clients/group_schema_client.py +++ b/okta/resource_clients/group_schema_client.py @@ -1,5 +1,5 @@ """ -Copyright 2021 - Present Okta, Inc. +Copyright 2020 - Present Okta, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,9 +49,10 @@ async def get_group_schema( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -97,9 +98,10 @@ async def update_group_schema( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/identity_provider_client.py b/okta/resource_clients/identity_provider_client.py index 086c7a00..2878eaf6 100644 --- a/okta/resource_clients/identity_provider_client.py +++ b/okta/resource_clients/identity_provider_client.py @@ -69,9 +69,10 @@ async def list_identity_providers( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -118,9 +119,10 @@ async def create_identity_provider( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -164,9 +166,10 @@ async def list_identity_provider_keys( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -214,9 +217,10 @@ async def create_identity_provider_key( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -254,9 +258,10 @@ async def delete_identity_provider_key( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -289,9 +294,10 @@ async def get_identity_provider_key( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -328,9 +334,10 @@ async def delete_identity_provider( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -363,9 +370,10 @@ async def get_identity_provider( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -411,9 +419,10 @@ async def update_identity_provider( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -452,9 +461,10 @@ async def list_csrs_for_identity_provider( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -503,9 +513,10 @@ async def generate_csr_for_identity_provider( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -544,9 +555,10 @@ async def revoke_csr_for_identity_provider( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -580,9 +592,10 @@ async def get_csr_for_identity_provider( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -632,9 +645,10 @@ async def publish_cer_cert_for_identity_provider( "Accept": "application/json", "Content-Type": "application/x-x509-ca-cert" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -681,9 +695,10 @@ async def publish_binary_cer_cert_for_identity_provider( "Accept": "application/json", "Content-Type": "application/x-x509-ca-cert" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -733,9 +748,10 @@ async def publish_der_cert_for_identity_provider( "Accept": "application/json", "Content-Type": "application/pkix-cert" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -782,9 +798,10 @@ async def publish_binary_der_cert_for_identity_provider( "Accept": "application/json", "Content-Type": "application/pkix-cert" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -831,9 +848,10 @@ async def publish_binary_pem_cert_for_identity_provider( "Accept": "application/json", "Content-Type": "application/x-pem-file" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -872,9 +890,10 @@ async def list_identity_provider_signing_keys( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -922,9 +941,10 @@ async def generate_identity_provider_signing_key( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -964,9 +984,10 @@ async def get_identity_provider_signing_key( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1012,9 +1033,10 @@ async def clone_identity_provider_key( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1053,9 +1075,10 @@ async def activate_identity_provider( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1094,9 +1117,10 @@ async def deactivate_identity_provider( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1135,9 +1159,10 @@ async def list_identity_provider_application_users( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1178,9 +1203,10 @@ async def unlink_user_from_identity_provider( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1214,9 +1240,10 @@ async def get_identity_provider_application_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1265,9 +1292,10 @@ async def link_user_to_identity_provider( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1310,9 +1338,10 @@ async def list_social_auth_tokens( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/inline_hook_client.py b/okta/resource_clients/inline_hook_client.py index 56490a61..ebd6159a 100644 --- a/okta/resource_clients/inline_hook_client.py +++ b/okta/resource_clients/inline_hook_client.py @@ -56,9 +56,10 @@ async def list_inline_hooks( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -104,9 +105,10 @@ async def create_inline_hook( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -146,9 +148,10 @@ async def delete_inline_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -181,9 +184,10 @@ async def get_inline_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -229,9 +233,10 @@ async def update_inline_hook( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -282,9 +287,10 @@ async def execute_inline_hook( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -324,9 +330,10 @@ async def activate_inline_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -366,9 +373,10 @@ async def deactivate_inline_hook( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/linked_object_client.py b/okta/resource_clients/linked_object_client.py index ae916902..19a0c337 100644 --- a/okta/resource_clients/linked_object_client.py +++ b/okta/resource_clients/linked_object_client.py @@ -48,9 +48,10 @@ async def list_linked_object_definitions( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -96,9 +97,10 @@ async def add_linked_object_definition( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -135,9 +137,10 @@ async def delete_linked_object_definition( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -170,9 +173,10 @@ async def get_linked_object_definition( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/log_event_client.py b/okta/resource_clients/log_event_client.py index 902203f1..6cb7cf47 100644 --- a/okta/resource_clients/log_event_client.py +++ b/okta/resource_clients/log_event_client.py @@ -63,9 +63,10 @@ async def get_logs( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/network_zone_client.py b/okta/resource_clients/network_zone_client.py index acc8e3aa..0a32bee2 100644 --- a/okta/resource_clients/network_zone_client.py +++ b/okta/resource_clients/network_zone_client.py @@ -59,9 +59,10 @@ async def list_network_zones( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -108,9 +109,10 @@ async def create_network_zone( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -147,9 +149,10 @@ async def delete_network_zone( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -183,9 +186,10 @@ async def get_network_zone( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -231,9 +235,10 @@ async def update_network_zone( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -272,9 +277,10 @@ async def activate_network_zone( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -313,9 +319,10 @@ async def deactivate_network_zone( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/org_client.py b/okta/resource_clients/org_client.py index 458b7a9b..db995ae1 100644 --- a/okta/resource_clients/org_client.py +++ b/okta/resource_clients/org_client.py @@ -1,5 +1,5 @@ """ -Copyright 2021 - Present Okta, Inc. +Copyright 2020 - Present Okta, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -59,9 +59,10 @@ async def get_org_settings( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -106,9 +107,10 @@ async def partial_update_org_setting( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -153,9 +155,10 @@ async def update_org_setting( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -193,9 +196,10 @@ async def get_org_contact_types( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -237,9 +241,10 @@ async def get_org_contact_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -286,9 +291,10 @@ async def update_org_contact_user( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -308,6 +314,41 @@ async def update_org_contact_user( return (None, response, error) return (result, response, None) + async def update_org_logo( + self, file, + keep_empty_params=False + ): + """ + Updates the logo for your organization. + Args: + """ + http_method = "post".upper() + api_url = format_url(f""" + {self._base_url} + /api/v1/org/logo + """) + + body = {} + headers = {} + form = { + "file": file, + } + + request, error = await self._request_executor.create_request( + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params + ) + + if error: + return (None, error) + + response, error = await self._request_executor\ + .execute(request) + + if error: + return (response, error) + + return (response, None) + async def get_org_preferences( self, keep_empty_params=False @@ -326,9 +367,10 @@ async def get_org_preferences( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -367,9 +409,10 @@ async def hide_okta_ui_footer( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -408,9 +451,10 @@ async def show_okta_ui_footer( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -448,9 +492,10 @@ async def get_okta_communication_settings( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -489,9 +534,10 @@ async def opt_in_users_to_okta_communication_emails( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -530,9 +576,10 @@ async def opt_out_users_from_okta_communication_emails( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -570,9 +617,10 @@ async def get_org_okta_support_settings( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -612,9 +660,10 @@ async def extend_okta_support( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -653,9 +702,10 @@ async def grant_okta_support( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -693,9 +743,10 @@ async def revoke_okta_support( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/policy_client.py b/okta/resource_clients/policy_client.py index 667a19d9..7abc41e8 100644 --- a/okta/resource_clients/policy_client.py +++ b/okta/resource_clients/policy_client.py @@ -61,9 +61,10 @@ async def list_policies( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -117,9 +118,10 @@ async def create_policy( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -155,9 +157,10 @@ async def delete_policy( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -195,9 +198,10 @@ async def get_policy( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -242,9 +246,10 @@ async def update_policy( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -280,9 +285,10 @@ async def activate_policy( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -313,9 +319,10 @@ async def deactivate_policy( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -348,9 +355,10 @@ async def list_policy_rules( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -400,9 +408,10 @@ async def create_policy_rule( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -439,9 +448,10 @@ async def delete_policy_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -475,9 +485,10 @@ async def get_policy_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -523,9 +534,10 @@ async def update_policy_rule( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -563,9 +575,10 @@ async def activate_policy_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -598,9 +611,10 @@ async def deactivate_policy_rule( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/profile_mapping_client.py b/okta/resource_clients/profile_mapping_client.py index c0ae6722..425d41f7 100644 --- a/okta/resource_clients/profile_mapping_client.py +++ b/okta/resource_clients/profile_mapping_client.py @@ -59,9 +59,10 @@ async def list_profile_mappings( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -102,9 +103,10 @@ async def get_profile_mapping( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -151,9 +153,10 @@ async def update_profile_mapping( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/session_client.py b/okta/resource_clients/session_client.py index ee28779e..5064de43 100644 --- a/okta/resource_clients/session_client.py +++ b/okta/resource_clients/session_client.py @@ -61,9 +61,10 @@ async def create_session( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -101,9 +102,10 @@ async def end_session( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -136,9 +138,10 @@ async def get_session( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -178,9 +181,10 @@ async def refresh_session( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/sms_template_client.py b/okta/resource_clients/sms_template_client.py index 2e8765a8..803f2aa5 100644 --- a/okta/resource_clients/sms_template_client.py +++ b/okta/resource_clients/sms_template_client.py @@ -57,9 +57,10 @@ async def list_sms_templates( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -106,9 +107,10 @@ async def create_sms_template( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -145,9 +147,10 @@ async def delete_sms_template( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -180,9 +183,10 @@ async def get_sms_template( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -228,9 +232,10 @@ async def partial_update_sms_template( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -276,9 +281,10 @@ async def update_sms_template( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/threat_insight_client.py b/okta/resource_clients/threat_insight_client.py index 7bea3075..b8e2728a 100644 --- a/okta/resource_clients/threat_insight_client.py +++ b/okta/resource_clients/threat_insight_client.py @@ -49,9 +49,10 @@ async def get_current_configuration( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -96,9 +97,10 @@ async def update_configuration( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/trusted_origin_client.py b/okta/resource_clients/trusted_origin_client.py index f6de2589..7f0e7455 100644 --- a/okta/resource_clients/trusted_origin_client.py +++ b/okta/resource_clients/trusted_origin_client.py @@ -57,9 +57,10 @@ async def list_origins( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -105,9 +106,10 @@ async def create_origin( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -143,9 +145,10 @@ async def delete_origin( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -177,9 +180,10 @@ async def get_origin( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -224,9 +228,10 @@ async def update_origin( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -265,9 +270,10 @@ async def activate_origin( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -306,9 +312,10 @@ async def deactivate_origin( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/user_client.py b/okta/resource_clients/user_client.py index bb2c312d..eb1fd548 100644 --- a/okta/resource_clients/user_client.py +++ b/okta/resource_clients/user_client.py @@ -91,9 +91,10 @@ async def list_users( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -146,9 +147,10 @@ async def create_user( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -190,9 +192,10 @@ async def set_linked_object_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -230,9 +233,10 @@ async def deactivate_or_delete_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -265,9 +269,10 @@ async def get_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -319,9 +324,10 @@ async def partial_update_user( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -373,9 +379,10 @@ async def update_user( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -415,9 +422,10 @@ async def list_app_links( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -459,9 +467,10 @@ async def list_user_clients( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -501,9 +510,10 @@ async def revoke_grants_for_user_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -544,9 +554,10 @@ async def list_grants_for_user_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -587,9 +598,10 @@ async def revoke_tokens_for_user_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -631,9 +643,10 @@ async def list_refresh_tokens_for_user_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -675,9 +688,10 @@ async def revoke_token_for_user_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -721,9 +735,10 @@ async def get_refresh_token_for_user_and_client( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -777,9 +792,10 @@ async def change_password( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -830,9 +846,10 @@ async def change_recovery_question( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -877,9 +894,10 @@ async def forgot_password_generate_one_time_token( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -931,9 +949,10 @@ async def forgot_password_set_new_password( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -970,9 +989,10 @@ async def revoke_user_grants( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1013,9 +1033,10 @@ async def list_user_grants( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1055,9 +1076,10 @@ async def revoke_user_grant( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1096,9 +1118,10 @@ async def get_user_grant( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1137,9 +1160,10 @@ async def list_user_groups( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1180,9 +1204,10 @@ async def list_user_identity_providers( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1235,9 +1260,10 @@ async def activate_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1262,14 +1288,13 @@ async def deactivate_user( keep_empty_params=False ): """ - Deactivates a user. This operation can only be perform - ed on users that do not have a `DEPROVISIONED` status. - Deactivation of a user is an asynchronous operation. - The user will have the `transitioningToStatus` property - with a value of `DEPROVISIONED` during deactivation to - indicate that the user hasn't completed the asynchrono - us operation. The user will have a status of `DEPROVIS - IONED` when the deactivation process is complete. + Deactivates a user. This operation can only be performe + d on users that do not have a `DEPROVISIONED` status. W + hile the asynchronous operation (triggered by HTTP head + er `Prefer: respond-async`) is proceeding the user's `t + ransitioningToStatus` property is `DEPROVISIONED`. The + user's status is `DEPROVISIONED` when the deactivation + process is complete. Args: user_id {str} query_params {dict}: Map of query parameters for request @@ -1286,9 +1311,10 @@ async def deactivate_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1324,9 +1350,10 @@ async def expire_password( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1368,9 +1395,10 @@ async def expire_password_and_get_temporary_password( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1418,9 +1446,10 @@ async def reactivate_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1461,9 +1490,10 @@ async def reset_factors( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1504,9 +1534,10 @@ async def reset_password( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1545,9 +1576,10 @@ async def suspend_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1580,9 +1612,10 @@ async def unlock_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1615,9 +1648,10 @@ async def unsuspend_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1651,9 +1685,10 @@ async def remove_linked_object_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1695,9 +1730,10 @@ async def get_linked_objects_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1743,9 +1779,10 @@ async def list_assigned_roles_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1798,9 +1835,10 @@ async def assign_role_to_user( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1838,9 +1876,10 @@ async def remove_role_from_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1874,9 +1913,10 @@ async def get_user_role( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1927,9 +1967,10 @@ async def list_app_targets_for_application_admin_role_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -1969,9 +2010,10 @@ async def add_all_apps_as_target_to_role( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -2004,9 +2046,10 @@ async def remove_app_target_from_application_admin_role_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -2039,9 +2082,10 @@ async def add_application_target_to_admin_role_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -2077,9 +2121,10 @@ async def remove_application_target_from_administrator_role_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -2115,9 +2160,10 @@ async def add_application_target_to_app_admin_role_for_user( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -2157,9 +2203,10 @@ async def list_group_targets_for_role( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -2200,9 +2247,10 @@ async def remove_group_target_from_role( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -2235,9 +2283,10 @@ async def add_group_target_to_role( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -2276,9 +2325,10 @@ async def clear_user_sessions( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/user_factor_client.py b/okta/resource_clients/user_factor_client.py index 3e689b0d..36d85646 100644 --- a/okta/resource_clients/user_factor_client.py +++ b/okta/resource_clients/user_factor_client.py @@ -57,9 +57,10 @@ async def list_factors( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -117,9 +118,10 @@ async def enroll_factor( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -158,9 +160,10 @@ async def list_supported_factors( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -204,9 +207,10 @@ async def list_supported_security_questions( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -247,9 +251,10 @@ async def delete_factor( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -283,9 +288,10 @@ async def get_factor( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -333,9 +339,10 @@ async def activate_factor( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -376,9 +383,10 @@ async def get_factor_transaction_status( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -432,9 +440,10 @@ async def verify_factor( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/user_schema_client.py b/okta/resource_clients/user_schema_client.py index 645c8550..a8a49b6b 100644 --- a/okta/resource_clients/user_schema_client.py +++ b/okta/resource_clients/user_schema_client.py @@ -50,9 +50,10 @@ async def get_application_user_schema( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -99,9 +100,10 @@ async def update_application_user_profile( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -140,9 +142,10 @@ async def get_user_schema( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -189,9 +192,10 @@ async def update_user_profile( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/resource_clients/user_type_client.py b/okta/resource_clients/user_type_client.py index c60f3af8..75effa63 100644 --- a/okta/resource_clients/user_type_client.py +++ b/okta/resource_clients/user_type_client.py @@ -49,9 +49,10 @@ async def list_user_types( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -100,9 +101,10 @@ async def create_user_type( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -141,9 +143,10 @@ async def delete_user_type( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -177,9 +180,10 @@ async def get_user_type( body = {} headers = {} + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -225,9 +229,10 @@ async def update_user_type( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: @@ -273,9 +278,10 @@ async def replace_user_type( "Accept": "application/json", "Content-Type": "application/json" } + form = {} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/okta/utils.py b/okta/utils.py index 8f32a3e0..a4be0a74 100644 --- a/okta/utils.py +++ b/okta/utils.py @@ -4,6 +4,8 @@ from enum import Enum from datetime import datetime as dt +from urllib.parse import urlsplit, urlunsplit + from okta.constants import DATETIME_FORMAT, EPOCH_DAY, EPOCH_MONTH,\ EPOCH_YEAR @@ -54,3 +56,21 @@ def convert_date_time_to_seconds(date_time): return float((dt_obj - dt(EPOCH_YEAR, EPOCH_MONTH, EPOCH_DAY)) .total_seconds()) + + +def convert_absolute_url_into_relative_url(absolute_url): + """ + Converts absolute url into relative url. + + Args: + absolute_url (str): URL + + Returns: + str: URL + + Example: + >>> convert_absolute_url_into_relative_url('https://test.okta.com/api/v1/users') + '/api/v1/users' + """ + url_parts = urlsplit(absolute_url) + return urlunsplit(('', '', url_parts[2], url_parts[3], url_parts[4])) diff --git a/openapi/package.json b/openapi/package.json index 455c351d..0899d531 100644 --- a/openapi/package.json +++ b/openapi/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@okta/openapi": "^2.7.0", + "@okta/openapi": "^2.9.1", "lodash": "^4.17.15" }, "scripts": { diff --git a/openapi/templates/index.js b/openapi/templates/index.js index 088754e2..7ebdbc98 100644 --- a/openapi/templates/index.js +++ b/openapi/templates/index.js @@ -236,6 +236,12 @@ function operationArgumentBuilder(operation) { if (operation.queryParams.length) { args.push("query_params={}"); } + + // check if payload is given within form + if (operation.formData) { + operation.formData.map((param) => args.push(param.name)); + } + return args.join(", "); } diff --git a/openapi/templates/partials/models/defaultMethod.py.hbs b/openapi/templates/partials/models/defaultMethod.py.hbs index 0e8c4983..f0b9bb47 100644 --- a/openapi/templates/partials/models/defaultMethod.py.hbs +++ b/openapi/templates/partials/models/defaultMethod.py.hbs @@ -40,9 +40,18 @@ body = {} headers = {} {{/if}} + {{#if operation.formData}} + form = { + {{#each operation.formData as |param|}} + "{{param.name}}": {{param.name}}, + {{/each}} + } + {{else}} + form = {} + {{/if}} request, error = await self._request_executor.create_request( - http_method, api_url, body, headers, keep_empty_params=keep_empty_params + http_method, api_url, body, headers, form, keep_empty_params=keep_empty_params ) if error: diff --git a/openapi/yarn.lock b/openapi/yarn.lock index 84c0f374..6bb3bb57 100644 --- a/openapi/yarn.lock +++ b/openapi/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@okta/openapi@^2.7.0": - "integrity" "sha512-iZNkyWvwSUsY5DjG5OqnvP7DpKPfoVOtd9/OitBZB8Ta0fM6RnN2BlSMSW10V6uuODxQ/IWPwGYttar09L8P9Q==" - "resolved" "https://registry.npmjs.org/@okta/openapi/-/openapi-2.7.0.tgz" - "version" "2.7.0" +"@okta/openapi@^2.9.1": + "integrity" "sha512-hib3lKNFxQ+oS8ZR+eDTjSwUlGNBYMAKhcmefN3oOJJGyId+iP88r8n9VlydxZe22A0sGu9XYmWX/thG8iTv7g==" + "resolved" "https://registry.npmjs.org/@okta/openapi/-/openapi-2.9.1.tgz" + "version" "2.9.1" dependencies: "commander" "2.9.0" "fs-extra" "3.0.1" @@ -21,9 +21,9 @@ "version" "1.1.1" "ansi-regex@^5.0.0": - "integrity" "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz" - "version" "5.0.0" + "integrity" "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" + "version" "5.0.1" "ansi-styles@^4.0.0", "ansi-styles@^4.1.0": "integrity" "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==" @@ -141,7 +141,6 @@ "minimist" "^1.2.5" "neo-async" "^2.6.0" "source-map" "^0.6.1" - "uglify-js" "^3.1.4" "wordwrap" "^1.0.0" optionalDependencies: "uglify-js" "^3.1.4" @@ -184,8 +183,6 @@ "integrity" "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=" "resolved" "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz" "version" "3.0.1" - dependencies: - "graceful-fs" "^4.1.6" optionalDependencies: "graceful-fs" "^4.1.6" @@ -364,10 +361,10 @@ "resolved" "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" "version" "0.1.2" -"validator@^12.0.0": - "integrity" "sha512-jJfE/DW6tIK1Ek8nCfNFqt8Wb3nzMoAbocBF6/Icgg1ZFSBpObdnwVY2jQj6qUqzhx5jc71fpvBWyLGO7Xl+nQ==" - "resolved" "https://registry.npmjs.org/validator/-/validator-12.2.0.tgz" - "version" "12.2.0" +"validator@^13.6.0": + "integrity" "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==" + "resolved" "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz" + "version" "13.7.0" "which-module@^2.0.0": "integrity" "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" @@ -419,13 +416,12 @@ "yargs-parser" "^18.1.1" "z-schema@^4.2.2": - "integrity" "sha512-zkvK/9TC6p38IwcrbnT3ul9in1UX4cm1y/VZSs4GHKIiDCrlafc+YQBgQBUdDXLAoZHf2qvQ7gJJOo6yT1LH6A==" - "resolved" "https://registry.npmjs.org/z-schema/-/z-schema-4.2.3.tgz" - "version" "4.2.3" + "integrity" "sha512-YvBeW5RGNeNzKOUJs3rTL4+9rpcvHXt5I051FJbOcitV8bl40pEfcG0Q+dWSwS0/BIYrMZ/9HHoqLllMkFhD0w==" + "resolved" "https://registry.npmjs.org/z-schema/-/z-schema-4.2.4.tgz" + "version" "4.2.4" dependencies: - "commander" "^2.7.1" "lodash.get" "^4.4.2" "lodash.isequal" "^4.5.0" - "validator" "^12.0.0" + "validator" "^13.6.0" optionalDependencies: "commander" "^2.7.1" diff --git a/tests/integration/cassettes/test_authenticators_it/TestAuthenticatorsResource.test_update_authenticator.yaml b/tests/integration/cassettes/test_authenticators_it/TestAuthenticatorsResource.test_update_authenticator.yaml new file mode 100644 index 00000000..10844893 --- /dev/null +++ b/tests/integration/cassettes/test_authenticators_it/TestAuthenticatorsResource.test_update_authenticator.yaml @@ -0,0 +1,267 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/authenticators + response: + body: + string: '[{"type":"email","id":"autl0by7reTh1KIzB5d6","key":"okta_email","status":"ACTIVE","name":"Email","created":"2021-04-14T04:34:28.000Z","lastUpdated":"2021-04-20T13:05:44.000Z","settings":{"allowedFor":"any","tokenLifetimeInMinutes":5},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7reTh1KIzB5d6","hints":{"allow":["GET","PUT"]}},"deactivate":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7reTh1KIzB5d6/lifecycle/deactivate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7reTh1KIzB5d6/methods","hints":{"allow":["GET"]}}}},{"type":"app","id":"autl09jklzOEDvrjy5d6","key":"okta_verify","status":"ACTIVE","name":"Okta + Verify","created":"2021-04-14T04:34:50.000Z","lastUpdated":"2021-09-17T12:34:36.000Z","settings":{"compliance":{"fips":"OPTIONAL"},"channelBinding":{"style":"NUMBER_CHALLENGE","required":"HIGH_RISK_ONLY"},"userVerification":"PREFERRED","appInstanceId":""},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autl09jklzOEDvrjy5d6","hints":{"allow":["GET","PUT"]}},"deactivate":{"href":"https://test.okta.com/api/v1/authenticators/autl09jklzOEDvrjy5d6/lifecycle/deactivate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autl09jklzOEDvrjy5d6/methods","hints":{"allow":["GET"]}},"enroll":{"href":"https://test.okta.com/idp/authenticators","hints":{"allow":["POST"]}}}},{"type":"password","id":"autl0by7qz31DYkNg5d6","key":"okta_password","status":"ACTIVE","name":"Password","created":"2021-04-14T04:34:28.000Z","lastUpdated":"2021-04-14T04:34:28.000Z","_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7qz31DYkNg5d6","hints":{"allow":["GET","PUT"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7qz31DYkNg5d6/methods","hints":{"allow":["GET"]}}}},{"type":"phone","id":"autl0by7sNXye9Zmh5d6","key":"phone_number","status":"INACTIVE","name":"Phone","created":"2021-04-14T04:34:28.000Z","lastUpdated":"2021-11-08T14:00:38.000Z","settings":{"allowedFor":"recovery"},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6","hints":{"allow":["GET","PUT"]}},"activate":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/lifecycle/activate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/methods","hints":{"allow":["GET"]}}}},{"type":"security_key","id":"autl0by7vOCX0FnVY5d6","key":"webauthn","status":"INACTIVE","name":"Security + Key or Biometric","created":"2021-04-14T04:34:28.000Z","lastUpdated":"2021-04-14T04:34:28.000Z","_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7vOCX0FnVY5d6","hints":{"allow":["GET","PUT"]}},"activate":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7vOCX0FnVY5d6/lifecycle/activate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7vOCX0FnVY5d6/methods","hints":{"allow":["GET"]}}}},{"type":"security_question","id":"autl0by7tbUQEcczi5d6","key":"security_question","status":"ACTIVE","name":"Security + Question","created":"2021-04-14T04:34:28.000Z","lastUpdated":"2021-04-14T04:34:28.000Z","settings":{"allowedFor":"recovery"},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7tbUQEcczi5d6","hints":{"allow":["GET","PUT"]}},"deactivate":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7tbUQEcczi5d6/lifecycle/deactivate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7tbUQEcczi5d6/methods","hints":{"allow":["GET"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:21:31 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=8EDD295F07BE54E3CEE3626B2F221401; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkyaxS1eddMhlVUfPFzwQAADTQ + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1636381351' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/authenticators +- request: + body: '{"_links": {"self": {"href": "https://dev-44577309.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6", + "hints": {"allow": ["GET", "PUT"]}}, "activate": {"href": "https://dev-44577309.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/lifecycle/activate", + "hints": {"allow": ["POST"]}}, "methods": {"href": "https://dev-44577309.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/methods", + "hints": {"allow": ["GET"]}}}, "created": "2021-04-14T04:34:28.000Z", "id": + "autl0by7sNXye9Zmh5d6", "key": "phone_number", "lastUpdated": "2021-11-08T14:00:38.000Z", + "name": "Phone", "settings": {"allowedFor": "recovery"}, "status": "INACTIVE", + "type": "phone"}' + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + Content-Type: + - application/json + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: PUT + uri: https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6 + response: + body: + string: '{"type":"phone","id":"autl0by7sNXye9Zmh5d6","key":"phone_number","status":"INACTIVE","name":"Phone","created":"2021-04-14T04:34:28.000Z","lastUpdated":"2021-11-08T14:21:32.000Z","settings":{"allowedFor":"recovery"},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6","hints":{"allow":["GET","PUT"]}},"activate":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/lifecycle/activate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/methods","hints":{"allow":["GET"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:21:32 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=849ED8D5FB9C09DFDE88E7B33F60CFAF; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com; + report-uri https://okta.report-uri.com/r/d/csp/enforce; report-to csp-enforce' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + report-to: + - '{"group":"csp-enforce","max_age":31536000,"endpoints":[{"url":"https://okta.report-uri.com/r/d/csp/enforce"}],"include_subdomains":true}' + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkya-f2aQ9haC-NftpEHAAAAQo + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '98' + x-rate-limit-reset: + - '1636381351' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6 +- request: + body: '{"_links": {"self": {"href": "https://dev-44577309.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6", + "hints": {"allow": ["GET", "PUT"]}}, "activate": {"href": "https://dev-44577309.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/lifecycle/activate", + "hints": {"allow": ["POST"]}}, "methods": {"href": "https://dev-44577309.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/methods", + "hints": {"allow": ["GET"]}}}, "created": "2021-04-14T04:34:28.000Z", "id": + "autl0by7sNXye9Zmh5d6", "key": "phone_number", "lastUpdated": "2021-11-08T14:00:38.000Z", + "name": "Phone", "settings": {"allowedFor": "recovery"}, "status": "INACTIVE", + "type": "phone"}' + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + Content-Type: + - application/json + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: PUT + uri: https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6 + response: + body: + string: '{"type":"phone","id":"autl0by7sNXye9Zmh5d6","key":"phone_number","status":"INACTIVE","name":"Phone","created":"2021-04-14T04:34:28.000Z","lastUpdated":"2021-11-08T14:21:33.000Z","settings":{"allowedFor":"recovery"},"_links":{"self":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6","hints":{"allow":["GET","PUT"]}},"activate":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/lifecycle/activate","hints":{"allow":["POST"]}},"methods":{"href":"https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6/methods","hints":{"allow":["GET"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:21:33 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=E3AB273C8F3924AE98C7D508843E14EA; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkybFFHMKnwulhlKAH33gAAB4U + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '97' + x-rate-limit-reset: + - '1636381351' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/authenticators/autl0by7sNXye9Zmh5d6 +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_background_image.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_background_image.yaml new file mode 100644 index 00000000..8bdbea8f --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_background_image.yaml @@ -0,0 +1,237 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:50 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=856C9E16E22AE68B61F4CFBC7D791310; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz5htmbavqgV-bSuBOUwAABRQ + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '82' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes + response: + body: + string: '[{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:51 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=A9DC40C3EC9C134308C3945CB08937D1; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz57lB4obn7FWKlkzoKAAAAaI + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '81' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: DELETE + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image + response: + body: + string: '' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Date: + - Mon, 08 Nov 2021 14:27:52 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=4BE7DFF5BAF5A54338ABC8C4B8882EDF; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-frame-options: + - SAMEORIGIN + x-okta-request-id: + - YYkz6BtOeDIzj58UF7@@yQAAC@Y + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '80' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 204 + message: No Content + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_favicon.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_favicon.yaml new file mode 100644 index 00000000..db806f91 --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_favicon.yaml @@ -0,0 +1,237 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:53 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=0EF76DE17DE99A7170A9267A30156B3C; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz6WAMerEdz9H75aZlZwAADus + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '79' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes + response: + body: + string: '[{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:54 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=3DCAFDE9FB6060A0F027972D299956CD; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz6oyJHlzx5r2OYzsp9gAABO0 + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '78' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: DELETE + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon + response: + body: + string: '' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Date: + - Mon, 08 Nov 2021 14:27:55 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=06AA4DA98DCF3F8E1FBAFED5F59C66A7; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-frame-options: + - SAMEORIGIN + x-okta-request-id: + - YYkz6y7bgzgsEX0P7TDh0wAAAKI + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '77' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 204 + message: No Content + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_logo.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_logo.yaml new file mode 100644 index 00000000..3faf4108 --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_delete_brand_theme_logo.yaml @@ -0,0 +1,237 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:56 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=F70C81724BD89A4F26207900B60EF762; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz7BQHctHbDky7Fp7cDQAAAPU + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '76' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes + response: + body: + string: '[{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:57 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=0C6999E97A60B1DBCBBBD91B17D2D67A; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz7ca1-BKvQQ6c5lzp2AAABtY + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '75' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: DELETE + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo + response: + body: + string: '' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Date: + - Mon, 08 Nov 2021 14:27:57 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=E79D6C54F7DBED5EB481A768CFEF8D9F; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-frame-options: + - SAMEORIGIN + x-okta-request-id: + - YYkz7cXHAvdedu0Gk74pUwAADc0 + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '74' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 204 + message: No Content + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_get_brand.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_get_brand.yaml new file mode 100644 index 00000000..132467bf --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_get_brand.yaml @@ -0,0 +1,164 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:35 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=6C7CFAD19042C221C8DCC496B294B142; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz1yiUx5n17xDXFjqhCwAAD4I + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '98' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7 + response: + body: + string: '{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:36 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=56D16882A2116F8E41187196FC7EB53F; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz2EN9IbE5FcH4QEcQSAAABIw + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '97' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7 +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_get_brand_theme.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_get_brand_theme.yaml new file mode 100644 index 00000000..6af0358b --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_get_brand_theme.yaml @@ -0,0 +1,245 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:43 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=EFAD6E603A3FA1227C794519EBEC8CA2; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz33t4yb-P633wgxPlQgAAAhg + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '90' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes + response: + body: + string: '[{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:44 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=AA41C189C75A3951B2536FDC66D597FC; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz4NulkwD-yWYMuUE77AAAAQI + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '89' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7 + response: + body: + string: '{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:45 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=4E5F057EED16E631C841A4A168CBDCD0; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz4cFv5PYR0mcQFCWLagAADgQ + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '88' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7 +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_list_brand_themes.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_list_brand_themes.yaml new file mode 100644 index 00000000..12a6d92b --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_list_brand_themes.yaml @@ -0,0 +1,164 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:41 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=1440C47F1F749A378E364A37CDAB4045; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz3ZwviGI9xCnYJSB-pQAAB-c + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '92' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes + response: + body: + string: '[{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:42 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=CE5905308C65E46730E0AA829891E7E3; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz3rBLA9UgypA7XYcyLAAADq4 + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '91' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_list_brands.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_list_brands.yaml new file mode 100644 index 00000000..c2622825 --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_list_brands.yaml @@ -0,0 +1,83 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:34 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=06B79A9C893F0723B4347B71E3348C2E; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz1s-ArQwL-29f-iomhgAADog + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '99' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_update_brand.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_update_brand.yaml new file mode 100644 index 00000000..4a5d7177 --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_update_brand.yaml @@ -0,0 +1,337 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:37 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=EE4A5F666C23B546159F83FD581AD0C1; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz2QKwYP4UUHXW4iTHdgAAAlw + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '96' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7 + response: + body: + string: '{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:38 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=3CFF835A68A80E262C89DB3240719812; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz2pjov0gd07TfvSwfDgAACgw + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '95' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7 +- request: + body: '{"_links": {"themes": {"href": "https://dev-44577309.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes", + "hints": {"allow": ["GET"]}}, "self": {"href": "https://dev-44577309.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7", + "hints": {"allow": ["GET", "PUT"]}}}, "agreeToCustomPrivacyPolicy": true, "customPrivacyPolicyUrl": + "https://www.someHost.com/privacy-policy", "id": "bnd1vfbcisOVD11TW5d7", "removePoweredByOkta": + false}' + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + Content-Type: + - application/json + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: PUT + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7 + response: + body: + string: '{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":"https://www.someHost.com/privacy-policy","_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:39 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=3DD9C4821F99BCC100D291E4A9DEF5BD; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz2-57Z9lYTaX0mX2TrgAAAyU + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '94' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7 +- request: + body: '{"_links": {"themes": {"href": "https://dev-44577309.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes", + "hints": {"allow": ["GET"]}}, "self": {"href": "https://dev-44577309.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7", + "hints": {"allow": ["GET", "PUT"]}}}, "id": "bnd1vfbcisOVD11TW5d7", "removePoweredByOkta": + false}' + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + Content-Type: + - application/json + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: PUT + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7 + response: + body: + string: '{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:40 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=9FB2115910F012E79F914C59141F8FF7; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz3MGjgvzYPHDWAwiijgAACHg + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '93' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7 +version: 1 diff --git a/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_update_brand_theme.yaml b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_update_brand_theme.yaml new file mode 100644 index 00000000..dca72dbe --- /dev/null +++ b/tests/integration/cassettes/test_brands_it/TestBrandsResource.test_update_brand_theme.yaml @@ -0,0 +1,419 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands + response: + body: + string: '[{"id":"bnd1vfbcisOVD11TW5d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7","hints":{"allow":["GET","PUT"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:46 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=ED99C50361D376BC0966EABE9784B53D; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz4pDY2N5yrcWG0sBJmQAAA@I + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '87' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes + response: + body: + string: '[{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}]' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:47 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=91A01F7B0EC004A7309D70B2920667C4; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz48wqiO8zHFdkXfehbwAACis + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '86' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: GET + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7 + response: + body: + string: '{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:48 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=4F0191C27E5FABB8D1C395D2CD6C5EC2; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com; + report-uri https://okta.report-uri.com/r/d/csp/enforce; report-to csp-enforce' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + report-to: + - '{"group":"csp-enforce","max_age":31536000,"endpoints":[{"url":"https://okta.report-uri.com/r/d/csp/enforce"}],"include_subdomains":true}' + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz5C23cfZK7jtAhheNGgAAABc + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '85' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7 +- request: + body: '{"primaryColorHex": "#ababab", "secondaryColorHex": "#ebebeb", "emailTemplateTouchPointVariant": + "OKTA_DEFAULT", "endUserDashboardTouchPointVariant": "OKTA_DEFAULT", "signInPageTouchPointVariant": + "OKTA_DEFAULT", "errorPageTouchPointVariant": "OKTA_DEFAULT"}' + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + Content-Type: + - application/json + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: PUT + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7 + response: + body: + string: '{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#ababab","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebeb","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"OKTA_DEFAULT","endUserDashboardTouchPointVariant":"OKTA_DEFAULT","errorPageTouchPointVariant":"OKTA_DEFAULT","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:49 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=79F6DCEA9788DF98452D59CA6807690C; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz5dNHUG1hNaMIzvAyIwAACzM + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '84' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7 +- request: + body: '{"primaryColorHex": "#1662dd", "secondaryColorHex": "#ebebed", "emailTemplateTouchPointVariant": + "OKTA_DEFAULT", "endUserDashboardTouchPointVariant": "LOGO_ON_FULL_WHITE_BACKGROUND", + "signInPageTouchPointVariant": "BACKGROUND_SECONDARY_COLOR", "errorPageTouchPointVariant": + "BACKGROUND_SECONDARY_COLOR"}' + headers: + Accept: + - application/json + Authorization: + - SSWS myAPIToken + Content-Type: + - application/json + User-Agent: + - okta-sdk-python/2.2.0 python/3.8.2 Darwin/19.6.0 + method: PUT + uri: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7 + response: + body: + string: '{"id":"the1vfbcitR1tx9vZ5d7","logo":"https://ok12static.oktacdn.com/assets/img/logos/okta-logo.47066819ac7db5c13f4c431b2687cef6.png","favicon":"https://test.okta.com/favicon.ico","backgroundImage":null,"primaryColorHex":"#1662dd","primaryColorContrastHex":"#000000","secondaryColorHex":"#ebebed","secondaryColorContrastHex":"#000000","signInPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","endUserDashboardTouchPointVariant":"LOGO_ON_FULL_WHITE_BACKGROUND","errorPageTouchPointVariant":"BACKGROUND_SECONDARY_COLOR","emailTemplateTouchPointVariant":"OKTA_DEFAULT","_links":{"favicon":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/favicon","hints":{"allow":["POST","DELETE"]}},"self":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7","hints":{"allow":["GET","PUT"]}},"logo":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/logo","hints":{"allow":["POST","DELETE"]}},"background-image":{"href":"https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7/background-image","hints":{"allow":["POST","DELETE"]}}}}' + headers: + Cache-Control: + - no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 08 Nov 2021 14:27:49 GMT + Expires: + - '0' + Pragma: + - no-cache + Public-Key-Pins-Report-Only: + - pin-sha256="r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8="; pin-sha256="MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ="; + pin-sha256="72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI="; pin-sha256="rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg="; + max-age=60; report-uri="https://okta.report-uri.com/r/default/hpkp/reportOnly" + Server: + - nginx + Set-Cookie: + - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ + - JSESSIONID=C4C9AEBF2B74DCB980A21B25915CABFB; Path=/; Secure; HttpOnly + Strict-Transport-Security: + - max-age=315360000; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + content-security-policy: + - 'default-src ''self'' dev-44577309.okta.com *.oktacdn.com; connect-src ''self'' + dev-44577309.okta.com dev-44577309-admin.okta.com *.oktacdn.com *.mixpanel.com + *.mapbox.com app.pendo.io data.pendo.io pendo-static-5634101834153984.storage.googleapis.com + *.authenticatorlocalprod.com:8769 http://localhost:8769 http://127.0.0.1:8769 + *.authenticatorlocalprod.com:65111 http://localhost:65111 http://127.0.0.1:65111 + *.authenticatorlocalprod.com:65121 http://localhost:65121 http://127.0.0.1:65121 + *.authenticatorlocalprod.com:65131 http://localhost:65131 http://127.0.0.1:65131 + *.authenticatorlocalprod.com:65141 http://localhost:65141 http://127.0.0.1:65141 + *.authenticatorlocalprod.com:65151 http://localhost:65151 http://127.0.0.1:65151 + https://oinmanager.okta.com data:; script-src ''unsafe-inline'' ''unsafe-eval'' + ''self'' dev-44577309.okta.com *.oktacdn.com; style-src ''unsafe-inline'' + ''self'' dev-44577309.okta.com *.oktacdn.com app.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com; + frame-src ''self'' dev-44577309.okta.com dev-44577309-admin.okta.com login.okta.com + com-okta-authenticator:; img-src ''self'' dev-44577309.okta.com *.oktacdn.com + *.tiles.mapbox.com *.mapbox.com app.pendo.io data.pendo.io cdn.pendo.io pendo-static-5634101834153984.storage.googleapis.com + data: blob:; font-src ''self'' dev-44577309.okta.com data: *.oktacdn.com fonts.gstatic.com' + expect-ct: + - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0 + p3p: + - CP="HONK" + x-content-type-options: + - nosniff + x-okta-request-id: + - YYkz5Zjov0gd07TfvSwfMAAACdM + x-rate-limit-limit: + - '100' + x-rate-limit-remaining: + - '83' + x-rate-limit-reset: + - '1636381714' + x-xss-protection: + - '0' + status: + code: 200 + message: OK + url: https://test.okta.com/api/v1/brands/bnd1vfbcisOVD11TW5d7/themes/the1vfbcitR1tx9vZ5d7 +version: 1 diff --git a/tests/integration/data/brand_theme_background.png b/tests/integration/data/brand_theme_background.png new file mode 100644 index 00000000..8e7451a9 Binary files /dev/null and b/tests/integration/data/brand_theme_background.png differ diff --git a/tests/integration/data/brand_theme_favicon.ico b/tests/integration/data/brand_theme_favicon.ico new file mode 100644 index 00000000..886bd260 Binary files /dev/null and b/tests/integration/data/brand_theme_favicon.ico differ diff --git a/tests/integration/data/brand_theme_logo.png b/tests/integration/data/brand_theme_logo.png new file mode 100644 index 00000000..45f9dcf4 Binary files /dev/null and b/tests/integration/data/brand_theme_logo.png differ diff --git a/tests/integration/data/logo.png b/tests/integration/data/logo.png new file mode 100644 index 00000000..9b8ce352 Binary files /dev/null and b/tests/integration/data/logo.png differ diff --git a/tests/integration/test_authenticators_it.py b/tests/integration/test_authenticators_it.py index f504c039..2b06dc50 100644 --- a/tests/integration/test_authenticators_it.py +++ b/tests/integration/test_authenticators_it.py @@ -1,3 +1,4 @@ +import copy import pytest from tests.mocks import MockOktaClient import okta.models as models @@ -48,3 +49,22 @@ async def test_activate_and_deactivate_authenticator(self, fs): assert err is None assert isinstance(resp, models.Authenticator) assert resp.status == 'INACTIVE' + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_update_authenticator(self, fs): + client = MockOktaClient(fs) + authenticators_list, _, err = await client.list_authenticators() + assert err is None + + app_authenticator = [a for a in authenticators_list if a.type == 'phone'][0] + new_authenticator = copy.deepcopy(app_authenticator) + new_authenticator.settings.allowed_for = models.AllowedForEnum('RECOVERY') + try: + updated_authenticator, _, err = await client.update_authenticator(app_authenticator.id, new_authenticator) + assert err is None + assert isinstance(updated_authenticator, models.Authenticator) + assert updated_authenticator.settings.allowed_for == models.AllowedForEnum('RECOVERY') + finally: + updated_authenticator, _, err = await client.update_authenticator(app_authenticator.id, app_authenticator) + assert err is None diff --git a/tests/integration/test_brands_it.py b/tests/integration/test_brands_it.py new file mode 100644 index 00000000..f93b68b0 --- /dev/null +++ b/tests/integration/test_brands_it.py @@ -0,0 +1,236 @@ +import copy +import pytest + +from okta import models +from tests.mocks import MockOktaClient + + +class TestBrandsResource: + """ + Integration Tests for the Brand and Themes Resource + """ + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_list_brands(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + assert len(brands) > 0 + for brand in brands: + assert isinstance(brand, models.Brand) + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_get_brand(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + brand, _, err = await client.get_brand(brand_id) + assert err is None + assert isinstance(brand, models.Brand) + assert brand.id == brand_id + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_update_brand(self, fs): + client = MockOktaClient(fs) + custom_privacy_policy_url = 'https://www.someHost.com/privacy-policy' + + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + brand, _, err = await client.get_brand(brand_id) + assert err is None + assert brand.id == brand_id + assert brand.custom_privacy_policy_url != custom_privacy_policy_url + + new_brand = copy.deepcopy(brand) + new_brand.agree_to_custom_privacy_policy = True + new_brand.custom_privacy_policy_url = 'https://www.someHost.com/privacy-policy' + + try: + updated_brand, _, err = await client.update_brand(brand_id, new_brand) + assert err is None + assert isinstance(updated_brand, models.Brand) + assert brand.id == updated_brand.id + assert updated_brand.custom_privacy_policy_url == custom_privacy_policy_url + finally: + # restore previous brand settings + _, _, err = await client.update_brand(brand_id, brand) + assert err is None + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_list_brand_themes(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + assert len(themes) > 0 + for theme in themes: + assert isinstance(theme, models.ThemeResponse) + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_get_brand_theme(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + theme_id = themes[0].id + theme, _, err = await client.get_brand_theme(brand_id, theme_id) + assert err is None + assert isinstance(theme, models.ThemeResponse) + assert isinstance(theme.email_template_touch_point_variant, + models.EmailTemplateTouchPointVariant) + assert isinstance(theme.end_user_dashboard_touch_point_variant, + models.EndUserDashboardTouchPointVariant) + assert isinstance(theme.error_page_touch_point_variant, + models.ErrorPageTouchPointVariant) + assert isinstance(theme.sign_in_page_touch_point_variant, + models.SignInPageTouchPointVariant) + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_update_brand_theme(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + theme_id = themes[0].id + theme, _, err = await client.get_brand_theme(brand_id, theme_id) + assert err is None + + update_theme_params = {'primaryColorHex': '#ababab', + 'secondaryColorHex': '#ebebeb', + 'emailTemplateTouchPointVariant': models.EmailTemplateTouchPointVariant('OKTA_DEFAULT'), + 'endUserDashboardTouchPointVariant': models.EndUserDashboardTouchPointVariant('OKTA_DEFAULT'), + 'signInPageTouchPointVariant': models.SignInPageTouchPointVariant('OKTA_DEFAULT'), + 'errorPageTouchPointVariant': models.ErrorPageTouchPointVariant('OKTA_DEFAULT')} + try: + updated_theme, _, err = await client.update_brand_theme(brand_id, theme_id, update_theme_params) + assert err is None + assert updated_theme.primary_color_hex == '#ababab' + assert updated_theme.secondary_color_hex == '#ebebeb' + assert updated_theme.email_template_touch_point_variant == 'OKTA_DEFAULT' + assert updated_theme.end_user_dashboard_touch_point_variant == 'OKTA_DEFAULT' + finally: + # restore previous theme settings + restore_theme_params = {'primaryColorHex': theme.primary_color_hex, + 'secondaryColorHex': theme.secondary_color_hex, + 'emailTemplateTouchPointVariant': theme.email_template_touch_point_variant, + 'endUserDashboardTouchPointVariant': theme.end_user_dashboard_touch_point_variant, + 'signInPageTouchPointVariant': theme.sign_in_page_touch_point_variant, + 'errorPageTouchPointVariant': theme.error_page_touch_point_variant} + _, _, err = await client.update_brand_theme(brand_id, theme_id, restore_theme_params) + assert err is None + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_delete_brand_theme_background_image(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + theme_id = themes[0].id + _, err = await client.delete_brand_theme_background_image(brand_id, theme_id) + assert err is None + + # skip test until solution with writing cassette is found + @pytest.mark.skip + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_upload_brand_theme_background_image(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + theme_id = themes[0].id + try: + image = open(f'tests/integration/data/brand_theme_background.png', 'rb') + image_upload_resp, _, err = await client.upload_brand_theme_background_image(brand_id, theme_id, image) + assert err is None + assert isinstance(image_upload_resp, models.ImageUploadResponse) + finally: + _, err = await client.delete_brand_theme_background_image(brand_id, theme_id) + assert err is None + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_delete_brand_theme_favicon(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + theme_id = themes[0].id + _, err = await client.delete_brand_theme_favicon(brand_id, theme_id) + assert err is None + + # skip test until solution with writing cassette is found + @pytest.mark.skip + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_upload_brand_theme_favicon(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + theme_id = themes[0].id + try: + image = open(f'tests/integration/data/brand_theme_favicon.ico', 'rb') + image_upload_resp, _, err = await client.upload_brand_theme_favicon(brand_id, theme_id, image) + assert err is None + assert isinstance(image_upload_resp, models.ImageUploadResponse) + finally: + _, err = await client.delete_brand_theme_favicon(brand_id, theme_id) + assert err is None + + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_delete_brand_theme_logo(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + theme_id = themes[0].id + _, err = await client.delete_brand_theme_logo(brand_id, theme_id) + assert err is None + + # skip test until solution with writing cassette is found + @pytest.mark.skip + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_upload_brand_theme_logo(self, fs): + client = MockOktaClient(fs) + brands, _, err = await client.list_brands() + assert err is None + brand_id = brands[0].id + themes, _, err = await client.list_brand_themes(brand_id) + assert err is None + theme_id = themes[0].id + try: + image = open(f'tests/integration/data/brand_theme_logo.png', 'rb') + image_upload_resp, _, err = await client.upload_brand_theme_logo(brand_id, theme_id, image) + assert err is None + assert isinstance(image_upload_resp, models.ImageUploadResponse) + finally: + _, err = await client.delete_brand_theme_logo(brand_id, theme_id) + assert err is None diff --git a/tests/integration/test_org_it.py b/tests/integration/test_org_it.py index 862dd171..23c46b85 100644 --- a/tests/integration/test_org_it.py +++ b/tests/integration/test_org_it.py @@ -1,4 +1,5 @@ import copy +import os import pytest from datetime import datetime from tests.mocks import MockOktaClient @@ -201,3 +202,15 @@ async def test_extend_okta_support(self, fs): finally: org_okta_support_setting, _, err = await client.revoke_okta_support() assert err is None + + # skip test until solution with writing cassette is found + @pytest.mark.skip + @pytest.mark.vcr() + @pytest.mark.asyncio + async def test_upload_org_logo(self, fs): + client = MockOktaClient(fs) + fs.pause() + logo = open(f'tests/integration/data/logo.png', 'rb') + _, err = await client.update_org_logo(logo) + fs.resume() + assert err is None diff --git a/tests/mocks.py b/tests/mocks.py index 5e5dbc40..07cf7b0f 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -1,3 +1,5 @@ +from urllib.parse import urlsplit, parse_qsl, urlencode, urlunsplit + from okta.user_agent import UserAgent from okta.constants import DATETIME_FORMAT from okta.client import Client @@ -18,6 +20,7 @@ SCOPES = ["okta.scope.1", "okta.scope.2"] PRIVATE_KEY = "yourPrivateKey" GET_USERS_CALL = "/api/v1/users" +GET_OAUTH_CLIENTS_CALL = "/oauth2/v1/clients" CLIENT_CONFIG = {'orgUrl': ORG_URL, 'token': API_TOKEN} # Cache Test Details @@ -162,11 +165,12 @@ async def mock_GET_HTTP_Client_response_valid(*args, **kwargs): return (request, response_details, response_body, error) -async def mock_GET_HTTP_Client_response_valid_with_next(*args, **kwargs): - request = await mock_GET_HTTP_request() +async def mock_GET_HTTP_Client_response_valid_with_next(request_executor, request): + next_link = mock_next_link(URL(request.get('url'))) + response_details = MockHTTPResponseDetails() response_details.links = { - "next": {"url": URL("https://www.next.okta.com")} + "next": {"url": next_link} } response_body = '[{"ID": "user.id.1"}, {"ID": "user.id.2"}]' error = None @@ -239,6 +243,9 @@ def mock_cache_return_none(*args, **kwargs): def mock_cache_return_value(*args, **kwargs): return CACHE_VALUE +def mock_next_link(self_url: URL): + return self_url.update_query({'after': 'mock_after_id'}) + SAMPLE_RSA = '''-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAvlhONz/qR7dBung7VW diff --git a/tests/unit/test_api_response.py b/tests/unit/test_api_response.py index 07d12a29..4b3e9c3d 100644 --- a/tests/unit/test_api_response.py +++ b/tests/unit/test_api_response.py @@ -10,6 +10,8 @@ SCOPES = mocks.SCOPES PRIVATE_KEY = mocks.PRIVATE_KEY GET_USERS_CALL = mocks.GET_USERS_CALL +GET_OAUTH_CLIENTS_CALL = mocks.GET_OAUTH_CLIENTS_CALL +CLIENT_CONFIG = mocks.CLIENT_CONFIG API_LIMIT = "?limit=1" @@ -33,6 +35,33 @@ async def test_response_pagination_with_next(monkeypatch): assert result.get_body() is not None assert result.has_next() + assert result._next.startswith(GET_USERS_CALL) + monkeypatch.setattr(RequestExecutor, 'fire_request', + mocks.mock_GET_HTTP_Client_response_valid) + assert await result.next() is not None + assert not result.has_next() + with pytest.raises(StopAsyncIteration): + await result.next() + + +@ pytest.mark.asyncio +async def test_response_pagination_with_next_not_starting_with_api(monkeypatch): + ssws_client = Client(CLIENT_CONFIG) + + req, error = await ssws_client.get_request_executor() \ + .create_request("GET", + GET_OAUTH_CLIENTS_CALL + API_LIMIT, + {}, + {}) + + monkeypatch.setattr(RequestExecutor, 'fire_request', + mocks.mock_GET_HTTP_Client_response_valid_with_next) + + result, error = await ssws_client.get_request_executor().execute(req) + + assert result.get_body() is not None + assert result.has_next() + assert result._next.startswith(GET_OAUTH_CLIENTS_CALL) monkeypatch.setattr(RequestExecutor, 'fire_request', mocks.mock_GET_HTTP_Client_response_valid) assert await result.next() is not None diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index f33b1f0b..becf3176 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -677,7 +677,7 @@ async def mock_response_text(): return '[{"text": "mock response text"}]' mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) asyncio.run(client.list_users()) assert 'Header-Test-1' in mock_http_request.headers assert 'Header-Test-2' in mock_http_request.headers @@ -718,7 +718,7 @@ async def mock_response_text(): return '[{"text": "mock response text"}]' mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) res, resp_body, error = asyncio.run(client.list_users()) assert res is None assert resp_body is None @@ -765,7 +765,7 @@ async def mock_response_text(): '"type": null}]' mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) with caplog.at_level(logging.DEBUG): res, resp_body, error = asyncio.run(client.list_users()) assert 'okta-sdk-python' in caplog.text @@ -814,7 +814,7 @@ async def mock_response_text(): '"type": null}]' mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) with caplog.at_level(logging.INFO): res, resp_body, error = asyncio.run(client.list_users()) assert caplog.text == '' @@ -852,7 +852,43 @@ async def mock_response_text(): return '[{"text": "mock response text"}]' mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) with caplog.at_level(logging.DEBUG): res, resp_body, error = asyncio.run(client.list_users()) assert 'Cannot connect to host https://test.okta.com' in caplog.text + + +def test_client_ssl_context(monkeypatch, mocker): + org_url = "https://test.okta.com" + token = "TOKEN" + mock_ssl_context = mocker.MagicMock() + config = {'orgUrl': org_url, 'token': token, 'sslContext': mock_ssl_context} + client = OktaClient(config) + + # mock http requests, verify if custom header is present in request + class MockHTTPRequest(): + def __call__(self, **params): + self.request_info = params + self.headers = params['headers'] + self.url = params['url'] + self.content_type = 'application/json' + self.links = '' + self.text = MockHTTPRequest.mock_response_text + self.status = 200 + return self + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc, tb): + pass + + @staticmethod + async def mock_response_text(): + return '[{"text": "mock response text"}]' + + mock_http_request = MockHTTPRequest() + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) + asyncio.run(client.list_users()) + + assert mock_http_request.request_info['ssl_context'] == mock_ssl_context diff --git a/tests/unit/test_domains.py b/tests/unit/test_domains.py index 22c441e4..9f3f793f 100644 --- a/tests/unit/test_domains.py +++ b/tests/unit/test_domains.py @@ -181,7 +181,7 @@ async def mock_response_text(): return GET_DOMAIN_RESP mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) domain_resp, _, err = asyncio.run(client.get_domain('OcDz6iRyjkaCTXkdo0g3')) assert err is None @@ -234,7 +234,7 @@ async def mock_response_text(): return MockHTTPRequest._mocked_response mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) domain_config = { "domain": "login.example.com", diff --git a/tests/unit/test_http_client.py b/tests/unit/test_http_client.py index 6ffcbe92..404c261b 100644 --- a/tests/unit/test_http_client.py +++ b/tests/unit/test_http_client.py @@ -142,7 +142,8 @@ async def test_client_invalid_url(): 'method': 'GET', 'url': "", 'headers': {}, - 'data': {} + 'data': {}, + 'form': {} }) assert all(values in [None] for values in [req, res_details, resp_body]) assert issubclass(type(error), aiohttp.ClientError) diff --git a/tests/unit/test_request_executor.py b/tests/unit/test_request_executor.py index 85e67412..6759ca99 100644 --- a/tests/unit/test_request_executor.py +++ b/tests/unit/test_request_executor.py @@ -63,7 +63,7 @@ async def mock_response_text(): '"type": null}]' mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) res, resp_body, error = asyncio.run(client.list_users()) # Check request was retried max times and header 'X-Okta-Retry-Count' was set properly assert mock_http_request.request_info['headers'].get('X-Okta-Retry-Count') == '2' diff --git a/tests/unit/test_user_schema.py b/tests/unit/test_user_schema.py index a207ee7f..eae5d4f0 100644 --- a/tests/unit/test_user_schema.py +++ b/tests/unit/test_user_schema.py @@ -84,7 +84,7 @@ class TestUserSchemaResource: @pytest.mark.asyncio async def test_get_application_user_schema(self, monkeypatch): mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) org_url = "https://test.okta.com" token = "TOKEN" @@ -111,7 +111,7 @@ async def test_get_application_user_schema(self, monkeypatch): @pytest.mark.asyncio async def test_update_application_user_profile(self, monkeypatch): mock_http_request = MockHTTPRequest() - monkeypatch.setattr(aiohttp, 'request', mock_http_request) + monkeypatch.setattr(aiohttp.ClientSession, 'request', mock_http_request) org_url = "https://test.okta.com" token = "TOKEN" diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py new file mode 100644 index 00000000..0bd570ba --- /dev/null +++ b/tests/unit/test_utils.py @@ -0,0 +1,11 @@ +from okta.utils import convert_absolute_url_into_relative_url + + +def test_convert_absolute_url_into_relative_url(): + absolute_url = 'https://test.okta.com/api/v1/users' + relative_url = '/api/v1/users' + assert relative_url == convert_absolute_url_into_relative_url(absolute_url) + + absolute_url = 'https://test.okta.com/api/v1/users?activate=false' + relative_url = '/api/v1/users?activate=false' + assert relative_url == convert_absolute_url_into_relative_url(absolute_url)