Skip to content

Commit

Permalink
linter hints applied
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-fbudzynski committed Sep 24, 2024
1 parent af2e030 commit 4ccc4e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
12 changes: 0 additions & 12 deletions pkg/sdk/secrets_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,53 +128,41 @@ func (r *AlterSecretRequest) toOpts() *AlterSecretOptions {
}

if r.Set != nil {

opts.Set = &SecretSet{
Comment: r.Set.Comment,
}

if r.Set.SetForOAuthClientCredentialsFlow != nil {

opts.Set.SetForOAuthClientCredentialsFlow = &SetForOAuthClientCredentialsFlow{
OauthScopes: r.Set.SetForOAuthClientCredentialsFlow.OauthScopes,
}

}

if r.Set.SetForOAuthAuthorizationFlow != nil {

opts.Set.SetForOAuthAuthorizationFlow = &SetForOAuthAuthorizationFlow{
OauthRefreshToken: r.Set.SetForOAuthAuthorizationFlow.OauthRefreshToken,
OauthRefreshTokenExpiryTime: r.Set.SetForOAuthAuthorizationFlow.OauthRefreshTokenExpiryTime,
}

}

if r.Set.SetForBasicAuthentication != nil {

opts.Set.SetForBasicAuthentication = &SetForBasicAuthentication{
Username: r.Set.SetForBasicAuthentication.Username,
Password: r.Set.SetForBasicAuthentication.Password,
}

}

if r.Set.SetForGenericString != nil {

opts.Set.SetForGenericString = &SetForGenericString{
SecretString: r.Set.SetForGenericString.SecretString,
}

}

}

if r.Unset != nil {

opts.Unset = &SecretUnset{
Comment: r.Unset.Comment,
}

}

return opts
Expand Down
18 changes: 8 additions & 10 deletions pkg/sdk/testint/secrets_gen_integration_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package testint

import (
assertions "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/objectassert"
"testing"
"time"

assertions "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/objectassert"

"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/helpers/random"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -278,7 +279,6 @@ func TestInt_Secrets(t *testing.T) {
})

t.Run("Create: WithGenericString - empty secret_string", func(t *testing.T) {

id := testClientHelper().Ids.RandomSchemaObjectIdentifier()
request := sdk.NewCreateWithGenericStringSecretRequest(id, "")

Expand Down Expand Up @@ -347,7 +347,6 @@ func TestInt_Secrets(t *testing.T) {
_, secretCleanup := testClientHelper().Secret.CreateWithOAuthAuthorizationCodeFlow(t, id, integrationId, "foo", refreshTokenExpiryTime)
t.Cleanup(secretCleanup)

//_, id := createSecretWithOAuthAuthorizationCodeFlow(t, integrationId, "foo", refreshTokenExpiryTime, nil)
setRequest := sdk.NewAlterSecretRequest(id).
WithSet(
*sdk.NewSecretSetRequest().
Expand Down Expand Up @@ -471,7 +470,6 @@ func TestInt_Secrets(t *testing.T) {
})

t.Run("Drop", func(t *testing.T) {
//_, id := createSecretWithOAuthClientCredentialsFlow(t, integrationId, []sdk.ApiIntegrationScope{{Scope: "foo"}}, nil)
id := testClientHelper().Ids.RandomSchemaObjectIdentifier()
_, secretCleanup := testClientHelper().Secret.CreateWithOAuthClientCredentialsFlow(t, id, integrationId, []sdk.ApiIntegrationScope{{Scope: "foo"}})
t.Cleanup(secretCleanup)
Expand Down Expand Up @@ -517,8 +515,8 @@ func TestInt_Secrets(t *testing.T) {
})

t.Run("Show: SecretWithOAuthClientCredentialsFlow with Like", func(t *testing.T) {
//secret1, id1 := createSecretWithOAuthClientCredentialsFlow(t, integrationId, []sdk.ApiIntegrationScope{{Scope: "foo"}}, nil)
//secret2, _ := createSecretWithOAuthClientCredentialsFlow(t, integrationId, []sdk.ApiIntegrationScope{{Scope: "bar"}}, nil)
// secret1, id1 := createSecretWithOAuthClientCredentialsFlow(t, integrationId, []sdk.ApiIntegrationScope{{Scope: "foo"}}, nil)
// secret2, _ := createSecretWithOAuthClientCredentialsFlow(t, integrationId, []sdk.ApiIntegrationScope{{Scope: "bar"}}, nil)
id1 := testClientHelper().Ids.RandomSchemaObjectIdentifier()
id2 := testClientHelper().Ids.RandomSchemaObjectIdentifier()

Expand All @@ -537,8 +535,8 @@ 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)
// 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 Expand Up @@ -612,7 +610,7 @@ func TestInt_Secrets(t *testing.T) {
})

t.Run("Show: SecretWithOAuthAuthorizationCodeFlow with In", func(t *testing.T) {
//secret, id := createSecretWithOAuthAuthorizationCodeFlow(t, integrationId, "foo", refreshTokenExpiryTime, nil)
// secret, id := createSecretWithOAuthAuthorizationCodeFlow(t, integrationId, "foo", refreshTokenExpiryTime, nil)

id := testClientHelper().Ids.RandomSchemaObjectIdentifier()
secret, secretCleanup := testClientHelper().Secret.CreateWithOAuthAuthorizationCodeFlow(t, id, integrationId, "foo", refreshTokenExpiryTime)
Expand Down

0 comments on commit 4ccc4e7

Please sign in to comment.