Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmichalak committed May 22, 2024
1 parent 22971e3 commit a1b3413
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
16 changes: 8 additions & 8 deletions pkg/sdk/security_integrations_def.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func alterSecurityIntegrationOperation(structName string, apply func(qs *g.Query
return qs
}

var snowflakeOauthPartnerIntegrationSetDef = g.NewQueryStruct("OauthPartnerIntegrationSet").
var oauthPartnerIntegrationSetDef = g.NewQueryStruct("OauthPartnerIntegrationSet").
OptionalBooleanAssignment("ENABLED", g.ParameterOptions()).
OptionalTextAssignment("OAUTH_REDIRECT_URI", g.ParameterOptions().SingleQuotes()).
OptionalBooleanAssignment("OAUTH_ISSUE_REFRESH_TOKENS", g.ParameterOptions()).
Expand All @@ -93,12 +93,12 @@ var snowflakeOauthPartnerIntegrationSetDef = g.NewQueryStruct("OauthPartnerInteg
WithValidation(g.AtLeastOneValueSet, "Enabled", "OauthRedirectUri", "OauthIssueRefreshTokens", "OauthRefreshTokenValidity", "OauthUseSecondaryRoles",
"BlockedRolesList", "Comment")

var snowflakeOauthPartnerIntegrationUnsetDef = g.NewQueryStruct("OauthPartnerIntegrationUnset").
var oauthPartnerIntegrationUnsetDef = g.NewQueryStruct("OauthPartnerIntegrationUnset").
OptionalSQL("ENABLED").
OptionalSQL("OAUTH_USE_SECONDARY_ROLES").
WithValidation(g.AtLeastOneValueSet, "Enabled", "OauthUseSecondaryRoles")

var snowflakeOauthCustomIntegrationSetDef = g.NewQueryStruct("OauthCustomIntegrationSet").
var oauthCustomIntegrationSetDef = g.NewQueryStruct("OauthCustomIntegrationSet").
OptionalBooleanAssignment("ENABLED", g.ParameterOptions()).
OptionalTextAssignment("OAUTH_REDIRECT_URI", g.ParameterOptions().SingleQuotes()).
OptionalBooleanAssignment("OAUTH_ALLOW_NON_TLS_REDIRECT_URI", g.ParameterOptions()).
Expand All @@ -120,7 +120,7 @@ var snowflakeOauthCustomIntegrationSetDef = g.NewQueryStruct("OauthCustomIntegra
"BlockedRolesList", "OauthIssueRefreshTokens", "OauthRefreshTokenValidity", "OauthUseSecondaryRoles", "NetworkPolicy", "OauthClientRsaPublicKey",
"OauthClientRsaPublicKey2", "Comment")

var snowflakeOauthCustomIntegrationUnsetDef = g.NewQueryStruct("OauthCustomIntegrationUnset").
var oauthCustomIntegrationUnsetDef = g.NewQueryStruct("OauthCustomIntegrationUnset").
OptionalSQL("ENABLED").
OptionalSQL("OAUTH_USE_SECONDARY_ROLES").
OptionalSQL("NETWORK_POLICY").
Expand Down Expand Up @@ -284,11 +284,11 @@ var SecurityIntegrationsDef = g.NewInterface(
alterSecurityIntegrationOperation("AlterOauthPartner", func(qs *g.QueryStruct) *g.QueryStruct {
return qs.OptionalQueryStructField(
"Set",
snowflakeOauthPartnerIntegrationSetDef,
oauthPartnerIntegrationSetDef,
g.ListOptions().NoParentheses().SQL("SET"),
).OptionalQueryStructField(
"Unset",
snowflakeOauthPartnerIntegrationUnsetDef,
oauthPartnerIntegrationUnsetDef,
g.ListOptions().NoParentheses().SQL("UNSET"),
).WithValidation(g.ExactlyOneValueSet, "Set", "Unset", "SetTags", "UnsetTags")
}),
Expand All @@ -299,11 +299,11 @@ var SecurityIntegrationsDef = g.NewInterface(
alterSecurityIntegrationOperation("AlterOauthCustom", func(qs *g.QueryStruct) *g.QueryStruct {
return qs.OptionalQueryStructField(
"Set",
snowflakeOauthCustomIntegrationSetDef,
oauthCustomIntegrationSetDef,
g.ListOptions().NoParentheses().SQL("SET"),
).OptionalQueryStructField(
"Unset",
snowflakeOauthCustomIntegrationUnsetDef,
oauthCustomIntegrationUnsetDef,
g.ListOptions().NoParentheses().SQL("UNSET"),
).WithValidation(g.ExactlyOneValueSet, "Set", "Unset", "SetTags", "UnsetTags")
}),
Expand Down
14 changes: 7 additions & 7 deletions pkg/sdk/security_integrations_dto_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ package sdk
var (
_ optionsProvider[CreateOauthPartnerSecurityIntegrationOptions] = new(CreateOauthPartnerSecurityIntegrationRequest)
_ optionsProvider[CreateOauthCustomSecurityIntegrationOptions] = new(CreateOauthCustomSecurityIntegrationRequest)
_ optionsProvider[CreateSaml2SecurityIntegrationOptions] = new(CreateSaml2SecurityIntegrationRequest)
_ optionsProvider[CreateScimSecurityIntegrationOptions] = new(CreateScimSecurityIntegrationRequest)
_ optionsProvider[CreateSaml2SecurityIntegrationOptions] = new(CreateSaml2SecurityIntegrationRequest)
_ optionsProvider[CreateScimSecurityIntegrationOptions] = new(CreateScimSecurityIntegrationRequest)
_ optionsProvider[AlterOauthPartnerSecurityIntegrationOptions] = new(AlterOauthPartnerSecurityIntegrationRequest)
_ optionsProvider[AlterOauthCustomSecurityIntegrationOptions] = new(AlterOauthCustomSecurityIntegrationRequest)
_ optionsProvider[AlterSaml2SecurityIntegrationOptions] = new(AlterSaml2SecurityIntegrationRequest)
_ optionsProvider[AlterScimSecurityIntegrationOptions] = new(AlterScimSecurityIntegrationRequest)
_ optionsProvider[DropSecurityIntegrationOptions] = new(DropSecurityIntegrationRequest)
_ optionsProvider[DescribeSecurityIntegrationOptions] = new(DescribeSecurityIntegrationRequest)
_ optionsProvider[ShowSecurityIntegrationOptions] = new(ShowSecurityIntegrationRequest)
_ optionsProvider[AlterSaml2SecurityIntegrationOptions] = new(AlterSaml2SecurityIntegrationRequest)
_ optionsProvider[AlterScimSecurityIntegrationOptions] = new(AlterScimSecurityIntegrationRequest)
_ optionsProvider[DropSecurityIntegrationOptions] = new(DropSecurityIntegrationRequest)
_ optionsProvider[DescribeSecurityIntegrationOptions] = new(DescribeSecurityIntegrationRequest)
_ optionsProvider[ShowSecurityIntegrationOptions] = new(ShowSecurityIntegrationRequest)
)

type CreateOauthPartnerSecurityIntegrationRequest struct {
Expand Down
24 changes: 12 additions & 12 deletions pkg/sdk/security_integrations_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ type CreateScimSecurityIntegrationOptions struct {

// AlterOauthPartnerSecurityIntegrationOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-security-integration-oauth-snowflake.
type AlterOauthPartnerSecurityIntegrationOptions struct {
alter bool `ddl:"static" sql:"ALTER"`
securityIntegration bool `ddl:"static" sql:"SECURITY INTEGRATION"`
IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
name AccountObjectIdentifier `ddl:"identifier"`
SetTags []TagAssociation `ddl:"keyword" sql:"SET TAG"`
UnsetTags []ObjectIdentifier `ddl:"keyword" sql:"UNSET TAG"`
alter bool `ddl:"static" sql:"ALTER"`
securityIntegration bool `ddl:"static" sql:"SECURITY INTEGRATION"`
IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
name AccountObjectIdentifier `ddl:"identifier"`
SetTags []TagAssociation `ddl:"keyword" sql:"SET TAG"`
UnsetTags []ObjectIdentifier `ddl:"keyword" sql:"UNSET TAG"`
Set *OauthPartnerIntegrationSet `ddl:"list,no_parentheses" sql:"SET"`
Unset *OauthPartnerIntegrationUnset `ddl:"list,no_parentheses" sql:"UNSET"`
}
Expand All @@ -152,12 +152,12 @@ type OauthPartnerIntegrationUnset struct {

// AlterOauthCustomSecurityIntegrationOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-security-integration-oauth-snowflake.
type AlterOauthCustomSecurityIntegrationOptions struct {
alter bool `ddl:"static" sql:"ALTER"`
securityIntegration bool `ddl:"static" sql:"SECURITY INTEGRATION"`
IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
name AccountObjectIdentifier `ddl:"identifier"`
SetTags []TagAssociation `ddl:"keyword" sql:"SET TAG"`
UnsetTags []ObjectIdentifier `ddl:"keyword" sql:"UNSET TAG"`
alter bool `ddl:"static" sql:"ALTER"`
securityIntegration bool `ddl:"static" sql:"SECURITY INTEGRATION"`
IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
name AccountObjectIdentifier `ddl:"identifier"`
SetTags []TagAssociation `ddl:"keyword" sql:"SET TAG"`
UnsetTags []ObjectIdentifier `ddl:"keyword" sql:"UNSET TAG"`
Set *OauthCustomIntegrationSet `ddl:"list,no_parentheses" sql:"SET"`
Unset *OauthCustomIntegrationUnset `ddl:"list,no_parentheses" sql:"UNSET"`
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/sdk/testint/security_integrations_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestInt_SecurityIntegrations(t *testing.T) {
assert.Equal(t, "SECURITY", si.Category)
}

type snowflakeOauthPartnerDetails struct {
type oauthPartnerDetails struct {
enabled string
oauthIssueRefreshTokens string
refreshTokenValidity string
Expand All @@ -118,7 +118,7 @@ func TestInt_SecurityIntegrations(t *testing.T) {
comment string
}

assertOauthPartner := func(details []sdk.SecurityIntegrationProperty, d snowflakeOauthPartnerDetails) {
assertOauthPartner := func(details []sdk.SecurityIntegrationProperty, d oauthPartnerDetails) {
assert.Contains(t, details, sdk.SecurityIntegrationProperty{Name: "ENABLED", Type: "Boolean", Value: d.enabled, Default: "false"})
assert.Contains(t, details, sdk.SecurityIntegrationProperty{Name: "OAUTH_ISSUE_REFRESH_TOKENS", Type: "Boolean", Value: d.oauthIssueRefreshTokens, Default: "true"})
assert.Contains(t, details, sdk.SecurityIntegrationProperty{Name: "OAUTH_REFRESH_TOKEN_VALIDITY", Type: "Integer", Value: d.refreshTokenValidity, Default: "7776000"})
Expand All @@ -135,7 +135,7 @@ func TestInt_SecurityIntegrations(t *testing.T) {
}
}

assertOauthCustom := func(details []sdk.SecurityIntegrationProperty, d snowflakeOauthPartnerDetails, allowNonTlsRedirectUri, clientType, enforcePkce string) {
assertOauthCustom := func(details []sdk.SecurityIntegrationProperty, d oauthPartnerDetails, allowNonTlsRedirectUri, clientType, enforcePkce string) {
assertOauthPartner(details, d)
assert.Contains(t, details, sdk.SecurityIntegrationProperty{Name: "OAUTH_ALLOW_NON_TLS_REDIRECT_URI", Type: "Boolean", Value: allowNonTlsRedirectUri, Default: "false"})
assert.Contains(t, details, sdk.SecurityIntegrationProperty{Name: "OAUTH_CLIENT_TYPE", Type: "String", Value: clientType, Default: "CONFIDENTIAL"})
Expand Down Expand Up @@ -210,7 +210,7 @@ func TestInt_SecurityIntegrations(t *testing.T) {
details, err := client.SecurityIntegrations.Describe(ctx, id)
require.NoError(t, err)

assertOauthPartner(details, snowflakeOauthPartnerDetails{
assertOauthPartner(details, oauthPartnerDetails{
enabled: "true",
oauthIssueRefreshTokens: "true",
refreshTokenValidity: "12345",
Expand Down Expand Up @@ -248,7 +248,7 @@ func TestInt_SecurityIntegrations(t *testing.T) {
details, err := client.SecurityIntegrations.Describe(ctx, id)
require.NoError(t, err)

assertOauthCustom(details, snowflakeOauthPartnerDetails{
assertOauthCustom(details, oauthPartnerDetails{
enabled: "true",
oauthIssueRefreshTokens: "true",
refreshTokenValidity: "12345",
Expand Down Expand Up @@ -349,7 +349,7 @@ func TestInt_SecurityIntegrations(t *testing.T) {
details, err := client.SecurityIntegrations.Describe(ctx, id)
require.NoError(t, err)

assertOauthPartner(details, snowflakeOauthPartnerDetails{
assertOauthPartner(details, oauthPartnerDetails{
enabled: "true",
oauthIssueRefreshTokens: "true",
refreshTokenValidity: "22222",
Expand Down Expand Up @@ -446,7 +446,7 @@ func TestInt_SecurityIntegrations(t *testing.T) {
details, err := client.SecurityIntegrations.Describe(ctx, id)
require.NoError(t, err)

assertOauthCustom(details, snowflakeOauthPartnerDetails{
assertOauthCustom(details, oauthPartnerDetails{
enabled: "true",
oauthIssueRefreshTokens: "true",
refreshTokenValidity: "22222",
Expand Down

0 comments on commit a1b3413

Please sign in to comment.