From 9ac257042f3f04d8f26c9d7e13710d02cf3bf3c2 Mon Sep 17 00:00:00 2001 From: Tien Nguyen Date: Wed, 29 Nov 2023 16:42:19 -0500 Subject: [PATCH] hot fix for terraform --- .generator/config.yaml | 2 +- ...management-APIs-oasv3-enum-inheritance.yaml | 18 ++---------------- .generator/templates/api_application_test.go | 3 ++- .generator/templates/api_idp_test.go | 2 +- .generator/templates/api_policy_test.go | 3 ++- 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.generator/config.yaml b/.generator/config.yaml index e3d9ea5c..aba5cef7 100644 --- a/.generator/config.yaml +++ b/.generator/config.yaml @@ -8,7 +8,7 @@ additionalProperties: enumClassPrefix: true generateInterfaces: true packageName: okta - packageVersion: 3.0.17 + packageVersion: 3.0.19 useOneOfDiscriminatorLookup: true disallowAdditionalPropertiesIfNotPresent: false files: diff --git a/.generator/okta-management-APIs-oasv3-enum-inheritance.yaml b/.generator/okta-management-APIs-oasv3-enum-inheritance.yaml index 56a9a774..373b33fd 100644 --- a/.generator/okta-management-APIs-oasv3-enum-inheritance.yaml +++ b/.generator/okta-management-APIs-oasv3-enum-inheritance.yaml @@ -26705,9 +26705,6 @@ components: profile: type: object description: Contains any valid JSON schema for specifying properties that can be referenced from a request (only available to OAuth 2.0 client apps) - additionalProperties: - type: object - properties: {} signOnMode: $ref: '#/components/schemas/ApplicationSignOnMode' status: @@ -35891,20 +35888,9 @@ components: readOnly: true nullable: true transitioningToStatus: - type: string - description: The target status of an in-progress asynchronous status transition. This property is only returned if the user's state is transitioning. - readOnly: true - nullable: true - enum: - - ACTIVE - - DEPROVISIONED - - PROVISIONED + $ref: '#/components/schemas/UserStatus' type: - type: string - description: |- - The user type that determines the schema for the user's profile. The `type` property is a map that identifies - the User Type (see [User Types](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/UserType/#tag/UserType)). - Currently it contains a single element, `id`. It can be specified when creating a new user, and may be updated by an administrator on a full replace of an existing user (but not a partial update). + $ref: '#/components/schemas/UserType' _embedded: type: object description: If specified, includes embedded resources related to the user diff --git a/.generator/templates/api_application_test.go b/.generator/templates/api_application_test.go index 3cdee61f..605d8ea3 100644 --- a/.generator/templates/api_application_test.go +++ b/.generator/templates/api_application_test.go @@ -3,6 +3,7 @@ package okta import ( "os" "path" + "strings" "testing" "time" @@ -387,7 +388,7 @@ func Test_Scope_Consent_Grant_Operation_For_Application(t *testing.T) { var grant *OAuth2ScopeConsentGrant t.Run("grant consent to scope", func(t *testing.T) { payload := OAuth2ScopeConsentGrant{} - payload.SetIssuer(apiClient.cfg.Okta.Client.OrgUrl) + payload.SetIssuer(strings.TrimRight(apiClient.cfg.Okta.Client.OrgUrl, "/")) payload.SetScopeId("okta.users.read") grant, _, err = apiClient.ApplicationGrantsAPI.GrantConsentToScope(apiClient.cfg.Context, createdApp.OpenIdConnectApplication.GetId()).OAuth2ScopeConsentGrant(payload).Execute() assert.Nil(t, err, "grant consent to scope should not error") diff --git a/.generator/templates/api_idp_test.go b/.generator/templates/api_idp_test.go index 2cfbebce..66d890b3 100644 --- a/.generator/templates/api_idp_test.go +++ b/.generator/templates/api_idp_test.go @@ -94,7 +94,7 @@ func Test_Get_Key(t *testing.T) { t.Run("get list idp keys", func(t *testing.T) { lidpk, _, err := apiClient.IdentityProviderAPI.ListIdentityProviderKeys(apiClient.cfg.Context).Execute() require.NoError(t, err, "Could not get list idp") - assert.Equal(t, len(lidpk), 1) + assert.Equal(t, len(lidpk), 3) }) _, err = apiClient.IdentityProviderAPI.DeleteIdentityProviderKey(apiClient.cfg.Context, createdKey.GetKid()).Execute() require.NoError(t, err, "Clean up idp key should not error") diff --git a/.generator/templates/api_policy_test.go b/.generator/templates/api_policy_test.go index eb4e88d6..de872b72 100644 --- a/.generator/templates/api_policy_test.go +++ b/.generator/templates/api_policy_test.go @@ -113,13 +113,14 @@ func Test_Activate_Policy(t *testing.T) { } // ACCESS/AUTHENTICATION POLICY ONLY +// TODO Used to work, now fail with 401 func Test_Clone_Policy(t *testing.T) { createdPolicy, _, err := setupAccessPolicy(randomTestString()) require.NoError(t, err, "Creating a new policy should not error") var policyID string t.Run("clone policy", func(t *testing.T) { policy, _, err := apiClient.PolicyAPI.ClonePolicy(apiClient.cfg.Context, createdPolicy.AccessPolicy.GetId()).Execute() - require.NoError(t, err, "Could not get policy by ID") + require.NoError(t, err, "Could not clone policy") policyID = policy.AccessPolicy.GetId() assert.NotEqual(t, createdPolicy.AccessPolicy.GetId(), policy.AccessPolicy.GetId()) assert.Equal(t, fmt.Sprintf("[cloned] %v", createdPolicy.AccessPolicy.GetName()), policy.AccessPolicy.GetName())