mirror of https://github.com/databricks/cli.git
b87b4b0f40
# Auth challenge (happy path) Simplified description of [PKCE](https://oauth.net/2/pkce/) implementation: ```mermaid sequenceDiagram autonumber actor User User ->> CLI: type `bricks auth login HOST` CLI ->>+ HOST: request OIDC endpoints HOST ->>- CLI: auth & token endpoints CLI ->> CLI: start embedded server to consume redirects (lock) CLI -->>+ Auth Endpoint: open browser with RND1 + SHA256(RND2) User ->>+ Auth Endpoint: Go through SSO Auth Endpoint ->>- CLI: AUTH CODE + 'RND1 (redirect) CLI ->>+ Token Endpoint: Exchange: AUTH CODE + RND2 Token Endpoint ->>- CLI: Access Token (JWT) + refresh + expiry CLI ->> Token cache: Save Access Token (JWT) + refresh + expiry CLI ->> User: success ``` # Token refresh (happy path) ```mermaid sequenceDiagram autonumber actor User User ->> CLI: type `bricks token HOST` CLI ->> CLI: acquire lock (same local addr as redirect server) CLI ->>+ Token cache: read token critical token not expired Token cache ->>- User: JWT (without refresh) option token is expired CLI ->>+ HOST: request OIDC endpoints HOST ->>- CLI: auth & token endpoints CLI ->>+ Token Endpoint: refresh token Token Endpoint ->>- CLI: JWT (refreshed) CLI ->> Token cache: save JWT (refreshed) CLI ->> User: JWT (refreshed) option no auth for host CLI -X User: no auth configured end ``` |
||
---|---|---|
.github | ||
.vscode | ||
bundle | ||
cmd | ||
experimental/github | ||
folders | ||
git | ||
internal | ||
libs | ||
project | ||
python | ||
retries | ||
sandbox | ||
terraform | ||
.gitignore | ||
.goreleaser.yaml | ||
Makefile | ||
README.md | ||
go.mod | ||
go.sum | ||
main.go |
README.md
Bricks CLI 🧱
Where's "data"? Secured by the unity catalog. Projects build lifecycle is secured by bricks
🧱
This is an early PoC at this stage. make build
(or download the latest from releases page).
Reuses authentication from Databricks CLI. And terraform provider. See details here: https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs#environment-variables
Supports:
- Databricks CLI
- Databricks CLI Profiles
- Azure CLI Auth
- Azure MSI Auth
- Azure SPN Auth
- Google OIDC Auth
- Direct
DATABRICKS_HOST
,DATABRICKS_TOKEN
orDATABRICKS_USERNAME
+DATABRICKS_PASSWORD
variables.
What works:
./bricks fs ls /
./bricks test
./bricks launch test.py
What doesn't work:
- Everything else.
This project reuses some code from Databricks Terraform Provider