Skip to content
GitHub

ConnectionSecret

ConnectionSecret manifests encapsulate credentials and tokens used by the query engine to access external systems. They keep sensitive data out of datasource definitions and SQL queries.

The smallest well-formed ConnectionSecret: pick a secret type and fill the credential block of the same name. This one holds a PostgreSQL password that is read from an environment variable at build time.

apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: postgresCredentials
spec:
  type: postgres
  postgres:
    passwordFromEnv: POSTGRES_PASSWORD

The other secret types work the same way — set type to mysql, s3, gcs, http, r2, azure or huggingface and add the block with that name, as in S3 access key, HTTP bearer token and Hugging Face token. All attributes are listed in the Attribute Reference below.

PostgreSQL credentials via environment variable

Section titled “PostgreSQL credentials via environment variable”
---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: postgresCredentials
spec:
  type: postgres
  postgres:
    passwordFromEnv: POSTGRES_PASSWORD

Use the secret from a datasource:

apiVersion: bino.bi/v1alpha1
kind: DataSource
metadata:
  name: orders_pg
spec:
  type: postgres_query
  connection:
    host: ${DB_HOST:db.example.com}
    port: 5432
    database: analytics
    schema: public
    user: reporting
    secret: postgresCredentials
  query: |
    SELECT * FROM fact_orders;
---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: s3Access
spec:
  type: s3
  scope: s3://my-report-bucket
  s3:
    keyIdFromEnv: AWS_ACCESS_KEY_ID
    secretFromEnv: AWS_SECRET_ACCESS_KEY
    region: eu-central-1
---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: httpApi
spec:
  type: http
  http:
    bearerTokenFromEnv: API_TOKEN

The CLI handles HTTP proxies in two distinct contexts:

  1. DuckDB extension downloads: The CLI automatically respects the http_proxy environment variable (along with http_proxy_username and http_proxy_password) when downloading DuckDB extensions. This happens transparently during startup.

  2. Datasource HTTP access: For HTTP/HTTPS datasource access (e.g., reading remote CSV/Parquet files), you must explicitly configure a proxy via a ConnectionSecret of type http. The http_proxy environment variable is not automatically applied to datasource requests.

---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: httpProxy
spec:
  type: http
  http:
    httpProxyFromEnv: http_proxy
    httpProxyUsernameFromEnv: http_proxy_username
    httpProxyPasswordFromEnv: http_proxy_password
---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: httpProxyInline
spec:
  type: http
  http:
    httpProxy: "http://proxy.example.com:8080"
    httpProxyUsername: "proxyuser"
    httpProxyPasswordFromEnv: PROXY_PASSWORD

Use scope to apply the proxy only to specific URL prefixes:

---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: internalProxy
spec:
  type: http
  scope: "https://internal.example.com"
  http:
    httpProxy: "http://internal-proxy:3128"
---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: huggingface
spec:
  type: huggingface
  huggingface:
    tokenFromEnv: HUGGINGFACE_TOKEN

WebDAV secrets allow you to access files on WebDAV servers, including Hetzner Storage Boxes. This uses the webdavfs DuckDB community extension.

---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: webdavStorage
spec:
  type: webdav
  scope: webdav://webdav-server.example.com/
  webdav:
    username: myuser
    passwordFromEnv: WEBDAV_PASSWORD

Hetzner Storage Boxes use the special storagebox:// URL scheme:

---
apiVersion: bino.bi/v1alpha1
kind: ConnectionSecret
metadata:
  name: hetznerStorageBox
spec:
  type: webdav
  scope: storagebox://u123456
  webdav:
    username: u123456
    passwordFromEnv: HETZNER_STORAGEBOX_PASSWORD

Once the secret is configured, you can reference files on the WebDAV server:

---
apiVersion: bino.bi/v1alpha1
kind: DataSource
metadata:
  name: salesData
spec:
  type: parquet
  path: webdav://webdav-server.example.com/reports/sales.parquet

Or for Hetzner Storage Box:

---
apiVersion: bino.bi/v1alpha1
kind: DataSource
metadata:
  name: salesData
spec:
  type: parquet
  path: storagebox://u123456/reports/sales.parquet

Always prefer *FromEnv fields over inline secrets in manifests.

AttributeTypeRequiredDefaultDescription
apiVersionstringyesMust be bino.bi/v1alpha1.
kindstringyesMust be ConnectionSecret.
metadata.namestringyesUnique identifier. Referenced by the secret field of a datasource.
metadata.labelsobjectnoKey-value pairs for categorization and constraint matching.
metadata.annotationsobjectnoArbitrary key-value metadata, not used by the system.
metadata.descriptionstringnoFree-form description.
metadata.constraintsarraynoConditional inclusion rules. See Constraints.

The credential block whose name matches spec.type is required; the other blocks do not apply and are ignored.

AttributeTypeRequiredDefaultDescriptionSample
spec.typestringyesThe DuckDB secret type. Values: s3, gcs, http, r2, azure, postgres, mysql, huggingface.type: postgres
spec.scopestringnoOptional file path prefix that the secret applies to. Limits where the secret is used.scope: s3://my-bucket
spec.providerstringnoconfigSecret provider. Use credential_chain for automatic discovery of ambient credentials.provider: credential_chain
spec.postgresobjectwith type: postgresPostgreSQL credentials. Connection details (host, port, database, user) belong in the DataSource connection block.postgres: { passwordFromEnv: POSTGRES_PASSWORD }
spec.postgres.passwordstringone of password / passwordFromEnvDatabase password for authentication.password: "s3cret"
spec.postgres.passwordFromEnvstringone of password / passwordFromEnvName of environment variable containing the database password (recommended over inline password).passwordFromEnv: POSTGRES_PASSWORD
spec.mysqlobjectwith type: mysqlMySQL credentials. Connection details (host, port, database, user) belong in the DataSource connection block.mysql: { passwordFromEnv: MYSQL_PASSWORD }
spec.mysql.passwordstringone of password / passwordFromEnvDatabase password for authentication.password: "s3cret"
spec.mysql.passwordFromEnvstringone of password / passwordFromEnvName of environment variable containing the database password (recommended over inline password).passwordFromEnv: MYSQL_PASSWORD
spec.s3objectwith type: s3AWS S3 authentication configuration (access keys, region, endpoint).s3: { region: eu-central-1 }
spec.s3.keyIdstringnoAWS access key ID.keyId: AKIAIOSFODNN7EXAMPLE
spec.s3.keyIdFromEnvstringnoEnvironment variable containing the AWS access key ID.keyIdFromEnv: AWS_ACCESS_KEY_ID
spec.s3.secretstringnoAWS secret access key.secret: "wJalrXUtnFEMI..."
spec.s3.secretFromEnvstringnoEnvironment variable containing the AWS secret access key.secretFromEnv: AWS_SECRET_ACCESS_KEY
spec.s3.regionstringnoAWS region.region: eu-central-1
spec.s3.sessionTokenstringnoAWS session token for temporary credentials.sessionToken: "FwoGZXIvYXdz..."
spec.s3.sessionTokenFromEnvstringnoEnvironment variable containing the AWS session token.sessionTokenFromEnv: AWS_SESSION_TOKEN
spec.s3.endpointstringnoCustom S3 endpoint URL (for S3-compatible services).endpoint: minio.example.com:9000
spec.s3.urlStylestringnoS3 URL style. Values: path, vhost.urlStyle: path
spec.gcsobjectwith type: gcsGoogle Cloud Storage authentication configuration (HMAC access keys).gcs: { keyIdFromEnv: GCS_KEY_ID }
spec.gcs.keyIdstringnoGCS access key ID.keyId: GOOG1EEXAMPLE
spec.gcs.keyIdFromEnvstringnoEnvironment variable containing the GCS access key ID.keyIdFromEnv: GCS_KEY_ID
spec.gcs.secretstringnoGCS secret access key.secret: "abc123..."
spec.gcs.secretFromEnvstringnoEnvironment variable containing the GCS secret access key.secretFromEnv: GCS_SECRET
spec.httpobjectwith type: httpHTTP/HTTPS authentication and proxy configuration (basic auth, bearer token or proxy).http: { bearerTokenFromEnv: API_TOKEN }
spec.http.usernamestringnoHTTP basic auth username.username: reporting
spec.http.usernameFromEnvstringnoEnvironment variable containing the HTTP username.usernameFromEnv: HTTP_USER
spec.http.passwordstringnoHTTP basic auth password.password: "s3cret"
spec.http.passwordFromEnvstringnoEnvironment variable containing the HTTP password.passwordFromEnv: HTTP_PASSWORD
spec.http.bearerTokenstringnoHTTP bearer token for authorization.bearerToken: "eyJhbGci..."
spec.http.bearerTokenFromEnvstringnoEnvironment variable containing the HTTP bearer token.bearerTokenFromEnv: API_TOKEN
spec.http.httpProxystringnoHTTP proxy URL, used for datasource HTTP access. The CLI respects the http_proxy environment variable only for DuckDB extension downloads; datasource access requires this field or httpProxyFromEnv. See HTTP proxy configuration.httpProxy: "http://proxy.example.com:8080"
spec.http.httpProxyFromEnvstringnoEnvironment variable containing the HTTP proxy URL. Takes precedence if httpProxy is not set.httpProxyFromEnv: http_proxy
spec.http.httpProxyUsernamestringnoUsername for HTTP proxy authentication.httpProxyUsername: "proxyuser"
spec.http.httpProxyUsernameFromEnvstringnoEnvironment variable containing the HTTP proxy username.httpProxyUsernameFromEnv: http_proxy_username
spec.http.httpProxyPasswordstringnoPassword for HTTP proxy authentication.httpProxyPassword: "s3cret"
spec.http.httpProxyPasswordFromEnvstringnoEnvironment variable containing the HTTP proxy password.httpProxyPasswordFromEnv: PROXY_PASSWORD
spec.r2objectwith type: r2Cloudflare R2 authentication configuration.r2: { accountId: abc123 }
spec.r2.keyIdstringnoR2 access key ID.keyId: 1a2b3c
spec.r2.keyIdFromEnvstringnoEnvironment variable containing the R2 access key ID.keyIdFromEnv: R2_KEY_ID
spec.r2.secretstringnoR2 secret access key.secret: "abc123..."
spec.r2.secretFromEnvstringnoEnvironment variable containing the R2 secret access key.secretFromEnv: R2_SECRET
spec.r2.accountIdstringnoCloudflare account ID.accountId: 0a1b2c3d4e5f
spec.r2.endpointstringnoR2 endpoint URL.endpoint: 0a1b2c3d4e5f.r2.cloudflarestorage.com
spec.azureobjectwith type: azureAzure Blob Storage authentication configuration (connection string or account name plus key).azure: { connectionStringFromEnv: AZURE_STORAGE_CONNECTION_STRING }
spec.azure.connectionStringstringnoAzure storage connection string.connectionString: "DefaultEndpointsProtocol=https;..."
spec.azure.connectionStringFromEnvstringnoEnvironment variable containing the Azure connection string.connectionStringFromEnv: AZURE_STORAGE_CONNECTION_STRING
spec.azure.accountNamestringnoAzure storage account name.accountName: reportstorage
spec.azure.accountKeystringnoAzure storage account key.accountKey: "abc123..."
spec.azure.accountKeyFromEnvstringnoEnvironment variable containing the Azure account key.accountKeyFromEnv: AZURE_STORAGE_KEY
spec.huggingfaceobjectwith type: huggingfaceHugging Face authentication configuration.huggingface: { tokenFromEnv: HUGGINGFACE_TOKEN }
spec.huggingface.tokenstringnoHugging Face API token.token: "hf_abc123..."
spec.huggingface.tokenFromEnvstringnoEnvironment variable containing the Hugging Face token.tokenFromEnv: HUGGINGFACE_TOKEN

See DataSource for how a secret is attached to a connection or a file path.