cli icon indicating copy to clipboard operation
cli copied to clipboard

Add logout sub command

Open RicNord opened this issue 1 year ago • 4 comments

Changes

  • Implements #1639

This PR includes a new sub cmd: auth logout [PROFILE]. That will "logout" a specified profile, similar to az logout.

Logout process looks like this:

  1. Determine profile
  2. Load config file (Default: ~/.databrickscfg) and tokenCache (Default: ~/.databricks/token-cache.json)
  3. Remove OAuth token it if exist
  4. Overwrite profile section in config file, but without any sensitive values, PAT token etc.

Tests

  • Unit test has been written for added functionality.
  • Local execution of built bin successful

RicNord avatar Sep 01 '24 22:09 RicNord

Hi,

Please dont hesitate to give feedback or any ideas of how to improve the PR, in case you have that! I would be happy to implement suggested changes, or elaborate further on the PR :)

RicNord avatar Sep 04 '24 12:09 RicNord

@RicNord Thank you for this contribution!

We require a CLA to accept contributions. If you're open to signing one, could you send an email to [email protected], and I'll kickstart the process (this is a manual process still).

The new command looks great. As for the scope, I think we shouldn't rewrite the databrickscfg file. I'd rather keep parity between login/logout and focus exclusively on OAuth. If login supported non-OAuth profiles then it would make sense.

pietern avatar Sep 23 '24 08:09 pietern

@RicNord Thank you for this contribution!

We require a CLA to accept contributions. If you're open to signing one, could you send an email to [email protected], and I'll kickstart the process (this is a manual process still).

The new command looks great. As for the scope, I think we shouldn't rewrite the databrickscfg file. I'd rather keep parity between login/logout and focus exclusively on OAuth. If login supported non-OAuth profiles then it would make sense.

Signed the CLA :)

Please let me know how to proceed with the scope of the PR!

RicNord avatar Sep 24 '24 18:09 RicNord

Hi @pietern and @mgyucht ,

I have signed the CLA :) Does it look good on your side?

Please let me know how you want to proceed with the scope of the PR, so I can make potential adjustments!

RicNord avatar Oct 01 '24 12:10 RicNord

Hi @pietern and @mgyucht, commit 865964e0298b5eae46af3eee1e3e8d651a8c5575 reduces the scope of the logout command to only remove the OAuth token from token-cache. Please let me know if it looks good to you, and if there is something else I need to do!

RicNord avatar Oct 06 '24 21:10 RicNord

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger: go/deco-tests-run/cli

Inputs:

  • PR number: 1737
  • Commit SHA: ca08796f77e577ef26801bef0d1e651f9728fae3

Checks will be approved automatically on success.

github-actions[bot] avatar Nov 06 '24 15:11 github-actions[bot]

Hi @pietern @mgyucht do you have any updates or feedback regarding this PR?

RicNord avatar Nov 06 '24 15:11 RicNord

This PR has not received an update in a while. If you want to keep this PR open, please leave a comment below or push a new commit and auto-close will be canceled.

github-actions[bot] avatar Jan 02 '25 14:01 github-actions[bot]