Skip to content

Commit

Permalink
updated after re-review
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-fbudzynski committed Sep 24, 2024
1 parent 34983af commit bdf2585
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/sdk/secrets_validations_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func (opts *AlterSecretOptions) validate() error {
errs = append(errs, errExactlyOneOf("AlterSecretOptions", "Set", "Unset"))
}
if valueSet(opts.Set) {
if everyValueSet(opts.Set.SetForOAuthClientCredentialsFlow, opts.Set.SetForOAuthAuthorizationFlow, opts.Set.SetForBasicAuthentication, opts.Set.SetForGenericString) {
errs = append(errs, errOneOf("AlterSecretOptions.Set", "SetForOAuthClientCredentialsFlow", "SetForOAuthAuthorizationFlow", "SetForBasicAuthentication", "SetForGenericString"))
if moreThanOneValueSet(opts.Set.SetForOAuthClientCredentialsFlow, opts.Set.SetForOAuthAuthorizationFlow, opts.Set.SetForBasicAuthentication, opts.Set.SetForGenericString) {
errs = append(errs, errMoreThanOneOf("AlterSecretOptions.Set", "SetForOAuthClientCredentialsFlow", "SetForOAuthAuthorizationFlow", "SetForBasicAuthentication", "SetForGenericString"))
}
}
return JoinErrors(errs...)
Expand Down
9 changes: 4 additions & 5 deletions pkg/sdk/testint/secrets_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ func TestInt_Secrets(t *testing.T) {
ctx := testContext(t)

integrationId := testClientHelper().Ids.RandomAccountObjectIdentifier()

// "YYYY-MM-DD" or "YYYY-MM-DD HH-MI-SS" format has to be used, otherwise Snowflake returns error: "Invalid date/time format"
refreshTokenExpiryTime := time.Now().Add(24 * time.Hour).Format(time.DateOnly)

_, apiIntegrationCleanup := testClientHelper().SecurityIntegration.CreateApiAuthenticationClientCredentialsWithRequest(t,
Expand Down Expand Up @@ -212,11 +214,11 @@ func TestInt_Secrets(t *testing.T) {
require.NoError(t, err)
t.Cleanup(testClientHelper().Secret.DropFunc(t, id))

_, err = client.Secrets.ShowByID(ctx, id)
secret, err := client.Secrets.ShowByID(ctx, id)
require.NoError(t, err)

assertions.AssertThat(t,
objectassert.Secret(t, id).
objectassert.SecretFromObject(t, secret).
HasName(id.Name()).
HasComment(comment).
HasSecretType("PASSWORD").
Expand Down Expand Up @@ -535,9 +537,6 @@ func TestInt_Secrets(t *testing.T) {
})

t.Run("Show: SecretWithOAuthAuthorization with Like", func(t *testing.T) {
// secret2, id1 := createSecretWithOAuthAuthorizationCodeFlow(t, integrationId, "foo_1", refreshTokenExpiryTime, nil)
// secret2, _ := createSecretWithOAuthAuthorizationCodeFlow(t, integrationId, "foo_2", refreshTokenExpiryTime, nil)

id1 := testClientHelper().Ids.RandomSchemaObjectIdentifier()
id2 := testClientHelper().Ids.RandomSchemaObjectIdentifier()

Expand Down

0 comments on commit bdf2585

Please sign in to comment.