# Authentication types for Databricks.
#
# One profile per type: set ETL_CRAFT_AUTH to the one you use.
#   token  verified: a personal access token
#   oauth  machine-to-machine: a service principal's client id and secret,
#          exchanged at https://<host>/oidc/v1/token (scope all-apis) unless
#          token_url/scope say otherwise
#   sso    the connector's browser login (databricks-oauth): interactive only
#
# Types marked verified have run against a live service in this project. The
# others follow the vendor's documentation and are untested here: they can be
# used, but success is not guaranteed, and `etl-craft doctor` says so.
#
# Each setting is marked `# variable` or `# value`. A variable is looked up in
# the secrets source (here: the process environment); when it is not set, the
# text itself is used, so `Profile: dev` is simply dev. A secret must always
# be a variable that is set. `etl-craft doctor` lists every value used as
# written that looks like a variable name.
#
# Complete and loadable as written: tests/unit/test_config_examples.py loads every
# file in this directory, for every profile it declares.

Secrets:
  Source_type: environment             # value
  Profile: ETL_CRAFT_AUTH              # variable — the profile names the authentication type to use

Orchestration:
  Mode: local                          # value
  Task_timeout_seconds: 21600          # value
  Max_parallel_tasks: 8                # value
  Enforce_sla: false                   # value

Engine:
  Profile: dev                         # value — this file varies only the login, not the Engine DB
  dev:
    jdbc_url: jdbc:sqlite:etl-craft-engine.db  # value
    schema: main                       # value — SQLite: the database file is the schema

Warehouse:
  Name: Databricks                     # value
  Table_format: native                 # value
  token:
    jdbc_url: WAREHOUSE_JDBC_URL       # variable — host, port and httpPath only
    catalog: WAREHOUSE_CATALOG         # variable
    schema: WAREHOUSE_SCHEMA           # variable
    token: WAREHOUSE_TOKEN             # variable, required: a secret is never used as written — auth_mode is token
  oauth:
    jdbc_url: WAREHOUSE_JDBC_URL       # variable — host, port and httpPath only
    catalog: WAREHOUSE_CATALOG         # variable
    schema: WAREHOUSE_SCHEMA           # variable
    auth_mode: oauth                   # value
    client_id: WAREHOUSE_CLIENT_ID     # variable
    secret: WAREHOUSE_SECRET           # variable, required: a secret is never used as written — the service principal's OAuth secret
  sso:
    jdbc_url: WAREHOUSE_JDBC_URL       # variable — host, port and httpPath only
    catalog: WAREHOUSE_CATALOG         # variable
    schema: WAREHOUSE_SCHEMA           # variable
    auth_mode: sso                     # value
