From 107c94786ec779ec8165af2ccf6be001d5073088 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Wed, 12 Feb 2025 17:55:55 +0000 Subject: [PATCH] materialize-snowflake: remove password authentication as an option see https://www.snowflake.com/en/blog/blocking-single-factor-password-authentification/ --- .../.snapshots/TestSpecification | 32 ++---------------- materialize-snowflake/config.go | 33 ++----------------- 2 files changed, 4 insertions(+), 61 deletions(-) diff --git a/materialize-snowflake/.snapshots/TestSpecification b/materialize-snowflake/.snapshots/TestSpecification index 6baa3c5ee0..eea2d44606 100644 --- a/materialize-snowflake/.snapshots/TestSpecification +++ b/materialize-snowflake/.snapshots/TestSpecification @@ -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": { @@ -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 @@ -103,7 +75,7 @@ "auth_type", "private_key" ], - "title": "Private Key (JWT)" + "title": "Key-Pair Authentication (JWT)" } ], "type": "object", diff --git a/materialize-snowflake/config.go b/materialize-snowflake/config.go index 56693bfa0e..dbb07a574c 100644 --- a/materialize-snowflake/config.go +++ b/materialize-snowflake/config.go @@ -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", @@ -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, @@ -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, },