databricks-cli/libs/auth
Serge Smertin a6c9533c1c
Add profile on `databricks auth login` (#423)
## Changes
- added saving profile to `~/.databrickscfg` whenever we do `databricks
auth login`.
- we either match profile by account id / canonical host or introduce
the new one from deployment name.
- fail on multiple profiles with matching accounts or workspace hosts.
- overriding `~/.databrickscfg` keeps the (valid) comments, but
reformats the file.

## Tests
<!-- How is this tested? -->
- `make test`
- `go run main.go auth login --account-id XXX --host
https://accounts.cloud.databricks.com/`
- `go run main.go auth token --account-id XXX --host
https://accounts.cloud.databricks.com/`
- `go run main.go auth login --host https://XXX.cloud.databricks.com/`
2023-06-02 13:49:39 +02:00
..
cache Added `bricks auth login` and `bricks auth token` (#158) 2023-01-06 16:15:57 +01:00
callback.go Added `bricks auth login` and `bricks auth token` (#158) 2023-01-06 16:15:57 +01:00
oauth.go Add profile on `databricks auth login` (#423) 2023-06-02 13:49:39 +02:00
oauth_test.go Added `bricks auth login` and `bricks auth token` (#158) 2023-01-06 16:15:57 +01:00
page.tmpl Fix link to workspace after AWS OAuth login (#234) 2023-03-08 11:56:46 +01:00