Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

materialize-snowflake: remove password authentication as an option #2390

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 2 additions & 30 deletions materialize-snowflake/.snapshots/TestSpecification
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,6 @@
},
"credentials": {
"oneOf": [
{
"properties": {
"auth_type": {
"type": "string",
"const": "user_password",
"default": "user_password"
},
"user": {
"type": "string",
"title": "User",
"description": "The Snowflake user login name",
"order": 1
},
"password": {
"type": "string",
"title": "Password",
"description": "The password for the provided user",
"order": 2,
"secret": true
}
},
"required": [
"auth_type",
"user",
"password"
],
"title": "User Password"
},
{
"properties": {
"auth_type": {
Expand All @@ -93,7 +65,7 @@
"private_key": {
"type": "string",
"title": "Private Key",
"description": "Private Key to be used to sign the JWT token",
"description": "Private Key to be used to sign the JWT token, see go.estuary.dev/materialize-snowflake for more details",
"multiline": true,
"order": 2,
"secret": true
Expand All @@ -103,7 +75,7 @@
"auth_type",
"private_key"
],
"title": "Private Key (JWT)"
"title": "Key-Pair Authentication (JWT)"
}
],
"type": "object",
Expand Down
33 changes: 2 additions & 31 deletions materialize-snowflake/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,30 +208,6 @@ func (c *credentialConfig) validateJWTCreds() error {
// github.com/invopop/jsonschema package in go-schema-gen, to fullfill the required schema shape for
// our oauth
func (credentialConfig) JSONSchema() *jsonschema.Schema {
uProps := orderedmap.New()
uProps.Set("auth_type", &jsonschema.Schema{
Type: "string",
Default: UserPass,
Const: UserPass,
})
uProps.Set("user", &jsonschema.Schema{
Title: "User",
Description: "The Snowflake user login name",
Type: "string",
Extras: map[string]interface{}{
"order": 1,
},
})
uProps.Set("password", &jsonschema.Schema{
Title: "Password",
Description: "The password for the provided user",
Type: "string",
Extras: map[string]interface{}{
"secret": true,
"order": 2,
},
})

jwtProps := orderedmap.New()
jwtProps.Set("auth_type", &jsonschema.Schema{
Type: "string",
Expand All @@ -248,7 +224,7 @@ func (credentialConfig) JSONSchema() *jsonschema.Schema {
})
jwtProps.Set("private_key", &jsonschema.Schema{
Title: "Private Key",
Description: "Private Key to be used to sign the JWT token",
Description: "Private Key to be used to sign the JWT token, see go.estuary.dev/materialize-snowflake for more details",
Type: "string",
Extras: map[string]interface{}{
"secret": true,
Expand All @@ -263,12 +239,7 @@ func (credentialConfig) JSONSchema() *jsonschema.Schema {
Default: map[string]string{"auth_type": UserPass},
OneOf: []*jsonschema.Schema{
{
Title: "User Password",
Required: []string{"auth_type", "user", "password"},
Properties: uProps,
},
{
Title: "Private Key (JWT)",
Title: "Key-Pair Authentication (JWT)",
Required: []string{"auth_type", "private_key"},
Properties: jwtProps,
},
Expand Down
Loading