From 5c393bdab448b3f0750c1acf84be1c9264153dc7 Mon Sep 17 00:00:00 2001 From: royendo <67675319+royendo@users.noreply.github.com> Date: Tue, 28 Apr 2026 12:17:27 -0400 Subject: [PATCH] feat: add `EnvVarName` to `PropertySpec` and annotate driver specs Adds a metadata-only `EnvVarName` field on `drivers.PropertySpec` and populates it on secret properties across athena, azure, bigquery, clickhouse, druid, duckdb (motherduck), gcs, mysql, pinot, postgres, redshift, s3, salesforce, and snowflake. The field captures the conventional env var name (e.g. `AWS_ACCESS_KEY_ID`, `GOOGLE_APPLICATION_CREDENTIALS`) since the mapping isn't mechanical. No consumers yet; field is read by upcoming template-connector work. Co-Authored-By: Claude Opus 4.7 --- runtime/drivers/athena/athena.go | 2 ++ runtime/drivers/azure/azure.go | 15 +++++++++------ runtime/drivers/bigquery/bigquery.go | 1 + runtime/drivers/clickhouse/clickhouse.go | 2 ++ runtime/drivers/connectors.go | 7 ++++++- runtime/drivers/druid/druid.go | 2 ++ runtime/drivers/duckdb/duckdb.go | 1 + runtime/drivers/gcs/gcs.go | 3 +++ runtime/drivers/mysql/mysql.go | 2 ++ runtime/drivers/pinot/pinot.go | 2 ++ runtime/drivers/postgres/postgres.go | 2 ++ runtime/drivers/redshift/redshift.go | 2 ++ runtime/drivers/s3/s3.go | 3 +++ runtime/drivers/salesforce/salesforce.go | 16 ++++++++++------ runtime/drivers/snowflake/snowflake.go | 2 ++ 15 files changed, 49 insertions(+), 13 deletions(-) diff --git a/runtime/drivers/athena/athena.go b/runtime/drivers/athena/athena.go index d0a4a2e3b492..3457aa4966b0 100644 --- a/runtime/drivers/athena/athena.go +++ b/runtime/drivers/athena/athena.go @@ -43,6 +43,7 @@ var spec = drivers.Spec{ Placeholder: "your_access_key_id", Required: true, Secret: true, + EnvVarName: "AWS_ACCESS_KEY_ID", }, { Key: "aws_secret_access_key", @@ -52,6 +53,7 @@ var spec = drivers.Spec{ Placeholder: "your_secret_access_key", Required: true, Secret: true, + EnvVarName: "AWS_SECRET_ACCESS_KEY", }, { Key: "output_location", diff --git a/runtime/drivers/azure/azure.go b/runtime/drivers/azure/azure.go index 228ab0f2cde1..a70d56025fe2 100644 --- a/runtime/drivers/azure/azure.go +++ b/runtime/drivers/azure/azure.go @@ -29,14 +29,16 @@ var spec = drivers.Spec{ Secret: true, }, { - Key: "azure_storage_key", - Type: drivers.StringPropertyType, - Secret: true, + Key: "azure_storage_key", + Type: drivers.StringPropertyType, + Secret: true, + EnvVarName: "AZURE_STORAGE_KEY", }, { - Key: "azure_storage_sas_token", - Type: drivers.StringPropertyType, - Secret: true, + Key: "azure_storage_sas_token", + Type: drivers.StringPropertyType, + Secret: true, + EnvVarName: "AZURE_STORAGE_SAS_TOKEN", }, { Key: "azure_storage_connection_string", @@ -45,6 +47,7 @@ var spec = drivers.Spec{ Description: "Azure connection string for storage account", Placeholder: "Paste your Azure connection string here", Secret: true, + EnvVarName: "AZURE_STORAGE_CONNECTION_STRING", }, }, SourceProperties: []*drivers.PropertySpec{ diff --git a/runtime/drivers/bigquery/bigquery.go b/runtime/drivers/bigquery/bigquery.go index da60f617e4eb..a016c4a8b215 100644 --- a/runtime/drivers/bigquery/bigquery.go +++ b/runtime/drivers/bigquery/bigquery.go @@ -43,6 +43,7 @@ var spec = drivers.Spec{ Description: "GCP credentials as JSON string", Placeholder: "Paste your GCP service account JSON here", Secret: true, + EnvVarName: "GOOGLE_APPLICATION_CREDENTIALS", Required: true, }, }, diff --git a/runtime/drivers/clickhouse/clickhouse.go b/runtime/drivers/clickhouse/clickhouse.go index 9818fdba1a60..e1d90658df31 100644 --- a/runtime/drivers/clickhouse/clickhouse.go +++ b/runtime/drivers/clickhouse/clickhouse.go @@ -67,6 +67,7 @@ var spec = drivers.Spec{ DisplayName: "Connection string", Placeholder: "clickhouse://localhost:9000?username=default&password=password", Secret: true, + EnvVarName: "CLICKHOUSE_DSN", NoPrompt: true, }, { @@ -106,6 +107,7 @@ var spec = drivers.Spec{ Description: "Password to connect to the ClickHouse server", Placeholder: "Database password", Secret: true, + EnvVarName: "CLICKHOUSE_PASSWORD", Hint: "Password to your database", }, { diff --git a/runtime/drivers/connectors.go b/runtime/drivers/connectors.go index 72cad88651a3..1d32ab1ee603 100644 --- a/runtime/drivers/connectors.go +++ b/runtime/drivers/connectors.go @@ -47,7 +47,12 @@ type PropertySpec struct { Default string Placeholder string Secret bool - NoPrompt bool + // EnvVarName is the conventional env var name for this property (e.g. AWS_ACCESS_KEY_ID, GOOGLE_APPLICATION_CREDENTIALS). + // It must be specified explicitly because the mapping doesn't follow a mechanical pattern; + // some keys use well-known names shared across drivers (AWS_*), others add infixes (AZURE_STORAGE_*), + // and others diverge entirely from the key name (GCS key_id -> GCP_ACCESS_KEY_ID). + EnvVarName string + NoPrompt bool } // PropertyType is an enum of types supported for connector properties. diff --git a/runtime/drivers/druid/druid.go b/runtime/drivers/druid/druid.go index bbef301dfa88..4eaba78e4b8d 100644 --- a/runtime/drivers/druid/druid.go +++ b/runtime/drivers/druid/druid.go @@ -42,6 +42,7 @@ var spec = drivers.Spec{ DisplayName: "Connection string", Placeholder: "https://example.com/druid/v2/sql/avatica-protobuf?authentication=BASIC&avaticaUser=username&avaticaPassword=password", Secret: true, + EnvVarName: "DRUID_DSN", NoPrompt: true, }, { @@ -76,6 +77,7 @@ var spec = drivers.Spec{ Description: "Password to connect to the Druid server", Placeholder: "password", Secret: true, + EnvVarName: "DRUID_PASSWORD", }, { Key: "ssl", diff --git a/runtime/drivers/duckdb/duckdb.go b/runtime/drivers/duckdb/duckdb.go index f25dc7d32a10..737474b528b2 100644 --- a/runtime/drivers/duckdb/duckdb.go +++ b/runtime/drivers/duckdb/duckdb.go @@ -105,6 +105,7 @@ var motherduckSpec = drivers.Spec{ Key: "token", Type: drivers.StringPropertyType, Secret: true, + EnvVarName: "MOTHERDUCK_TOKEN", Required: true, DisplayName: "Token", Description: "MotherDuck token", diff --git a/runtime/drivers/gcs/gcs.go b/runtime/drivers/gcs/gcs.go index 1e8e0a3d72bf..3fa91c9fd3c6 100644 --- a/runtime/drivers/gcs/gcs.go +++ b/runtime/drivers/gcs/gcs.go @@ -37,6 +37,7 @@ var spec = drivers.Spec{ Description: "GCP credentials as JSON string", Placeholder: "Paste your GCP service account JSON here", Secret: true, + EnvVarName: "GOOGLE_APPLICATION_CREDENTIALS", }, { Key: "key_id", @@ -45,6 +46,7 @@ var spec = drivers.Spec{ Description: "HMAC access key ID for S3-compatible authentication", Hint: "Optional S3-compatible Key ID when used in compatibility mode", Secret: true, + EnvVarName: "GCP_ACCESS_KEY_ID", }, { Key: "secret", @@ -53,6 +55,7 @@ var spec = drivers.Spec{ Description: "HMAC secret access key for S3-compatible authentication", Hint: "Optional S3-compatible Secret when used in compatibility mode", Secret: true, + EnvVarName: "GCP_SECRET_ACCESS_KEY", }, }, SourceProperties: []*drivers.PropertySpec{ diff --git a/runtime/drivers/mysql/mysql.go b/runtime/drivers/mysql/mysql.go index 600cb6701949..152d2eab94c7 100644 --- a/runtime/drivers/mysql/mysql.go +++ b/runtime/drivers/mysql/mysql.go @@ -38,6 +38,7 @@ var spec = drivers.Spec{ Placeholder: "mysql://user:password@host:3306/my-db", Hint: "Can be configured here or by setting the 'connector.mysql.dsn' environment variable (using '.env' or '--env')", Secret: true, + EnvVarName: "MYSQL_DSN", }, { Key: "user", @@ -54,6 +55,7 @@ var spec = drivers.Spec{ Placeholder: "your_password", Hint: "MySQL password for authentication", Secret: true, + EnvVarName: "MYSQL_PASSWORD", }, { Key: "host", diff --git a/runtime/drivers/pinot/pinot.go b/runtime/drivers/pinot/pinot.go index 890fc50c281d..4f3692e50110 100644 --- a/runtime/drivers/pinot/pinot.go +++ b/runtime/drivers/pinot/pinot.go @@ -36,6 +36,7 @@ var spec = drivers.Spec{ DisplayName: "Connection string", Placeholder: "http(s)://username:password@localhost:8000?controller=localhost:9000", Secret: true, + EnvVarName: "PINOT_DSN", NoPrompt: true, }, { @@ -86,6 +87,7 @@ var spec = drivers.Spec{ Description: "Password to connect to the Pinot server", Placeholder: "password", Secret: true, + EnvVarName: "PINOT_PASSWORD", }, { Key: "ssl", diff --git a/runtime/drivers/postgres/postgres.go b/runtime/drivers/postgres/postgres.go index 1e177dd13a43..257b774063b3 100644 --- a/runtime/drivers/postgres/postgres.go +++ b/runtime/drivers/postgres/postgres.go @@ -39,6 +39,7 @@ var spec = drivers.Spec{ Placeholder: "postgresql://postgres:postgres@localhost:5432/postgres", Hint: "Can be configured here or by setting the 'connector.postgres.dsn' environment variable (using '.env' or '--env').", Secret: true, + EnvVarName: "POSTGRES_DSN", }, { Key: "host", @@ -71,6 +72,7 @@ var spec = drivers.Spec{ Placeholder: "your_password", Hint: "Postgres password for authentication", Secret: true, + EnvVarName: "POSTGRES_PASSWORD", }, { Key: "dbname", diff --git a/runtime/drivers/redshift/redshift.go b/runtime/drivers/redshift/redshift.go index a1d1af16066c..7b0bcdb54fbf 100644 --- a/runtime/drivers/redshift/redshift.go +++ b/runtime/drivers/redshift/redshift.go @@ -40,6 +40,7 @@ var spec = drivers.Spec{ Placeholder: "your_access_key_id", Required: true, Secret: true, + EnvVarName: "AWS_ACCESS_KEY_ID", }, { Key: "aws_secret_access_key", @@ -49,6 +50,7 @@ var spec = drivers.Spec{ Placeholder: "your_secret_access_key", Required: true, Secret: true, + EnvVarName: "AWS_SECRET_ACCESS_KEY", }, { Key: "workgroup", diff --git a/runtime/drivers/s3/s3.go b/runtime/drivers/s3/s3.go index b28ad2433164..d0b1cae13a8e 100644 --- a/runtime/drivers/s3/s3.go +++ b/runtime/drivers/s3/s3.go @@ -33,6 +33,7 @@ var spec = drivers.Spec{ Description: "AWS access key ID for explicit credentials", Placeholder: "Enter your AWS access key ID", Secret: true, + EnvVarName: "AWS_ACCESS_KEY_ID", Required: true, }, { @@ -42,6 +43,7 @@ var spec = drivers.Spec{ Description: "AWS secret access key for explicit credentials", Placeholder: "Enter your AWS secret access key", Secret: true, + EnvVarName: "AWS_SECRET_ACCESS_KEY", Required: true, }, { @@ -66,6 +68,7 @@ var spec = drivers.Spec{ Key: "aws_role_arn", Type: drivers.StringPropertyType, Secret: true, + EnvVarName: "AWS_ROLE_ARN", Description: "AWS Role ARN to assume", }, { diff --git a/runtime/drivers/salesforce/salesforce.go b/runtime/drivers/salesforce/salesforce.go index 7d1518807b9e..9048d8e5aed8 100644 --- a/runtime/drivers/salesforce/salesforce.go +++ b/runtime/drivers/salesforce/salesforce.go @@ -35,14 +35,16 @@ var spec = drivers.Spec{ Secret: false, }, { - Key: "password", - Type: drivers.StringPropertyType, - Secret: true, + Key: "password", + Type: drivers.StringPropertyType, + Secret: true, + EnvVarName: "SALESFORCE_PASSWORD", }, { - Key: "key", - Type: drivers.StringPropertyType, - Secret: true, + Key: "key", + Type: drivers.StringPropertyType, + Secret: true, + EnvVarName: "SALESFORCE_KEY", }, { Key: "endpoint", @@ -99,6 +101,7 @@ var spec = drivers.Spec{ Hint: "Your Salesforce password, optionally followed by a security token if required.", Placeholder: "your_password", Secret: true, + EnvVarName: "SALESFORCE_PASSWORD", }, { Key: "key", @@ -108,6 +111,7 @@ var spec = drivers.Spec{ Hint: "Paste your JWT private key for token-based authentication. Used with Connected App and Client ID.", Placeholder: "your_jwt_key", Secret: true, + EnvVarName: "SALESFORCE_KEY", }, { Key: "endpoint", diff --git a/runtime/drivers/snowflake/snowflake.go b/runtime/drivers/snowflake/snowflake.go index cd62dca9c87f..dde348e488e7 100644 --- a/runtime/drivers/snowflake/snowflake.go +++ b/runtime/drivers/snowflake/snowflake.go @@ -44,6 +44,7 @@ var spec = drivers.Spec{ Placeholder: "@//?warehouse=&role=&authenticator=SNOWFLAKE_JWT&privateKey=", Hint: "Can be configured here or by setting the 'connector.snowflake.dsn' environment variable (using '.env' or '--env').", Secret: true, + EnvVarName: "SNOWFLAKE_DSN", }, { Key: "account", @@ -69,6 +70,7 @@ var spec = drivers.Spec{ Placeholder: "your_password", Hint: "Your Snowflake database password. This will be stored securely and used to authenticate your connection.", Secret: true, + EnvVarName: "SNOWFLAKE_PASSWORD", }, { Key: "database",