Skip to content

Make u2m authentication work with new CLI#394

Merged
nfx merged 2 commits intomainfrom
auth-type-cli
May 22, 2023
Merged

Make u2m authentication work with new CLI#394
nfx merged 2 commits intomainfrom
auth-type-cli

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented May 22, 2023

Changes

Acquire token by calling databricks CLI. Incorporate detection to see if the path resolves to the Python CLI (< 0.100) or the new CLI (>= 0.100). This detection looks at the binary size to determine which one we're working with.

Tests

  • make test passing
  • make fmt applied
  • relevant integration tests applied

@pietern pietern requested a review from nfx May 22, 2023 11:30
Copy link
Copy Markdown
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

// The new Databricks CLI is a single binary with size > 1MB.
// We use the size as a signal to determine which Databricks CLI is installed.
if stat.Size() < (1024 * 1024) {
return nil, errLegacyDatabricksCli
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not work on windows, but we'll fix after if integration tests fail

@nfx nfx merged commit 58e46ef into main May 22, 2023
@nfx nfx deleted the auth-type-cli branch May 22, 2023 11:52
@pietern pietern restored the auth-type-cli branch May 22, 2023 11:54
@pietern pietern deleted the auth-type-cli branch May 22, 2023 11:55
@nfx nfx mentioned this pull request May 22, 2023
nfx added a commit that referenced this pull request May 22, 2023
* Added more usage examples for `go doc` and Go Packages
([#389](#389)).
* Make OAuth work with new CLI
([#394](#394)).
* Update from OpenAPI spec
([#390](#390)).

Dependency updates:

* Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
([#393](#393)).
* Bump google.golang.org/api from 0.122.0 to 0.123.0
([#392](#392)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants