Add logout sub command
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:
- Determine profile
- Load config file (Default:
~/.databrickscfg) and tokenCache (Default:~/.databricks/token-cache.json) - Remove OAuth token it if exist
- 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
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 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.
@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!
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!
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!
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.
Hi @pietern @mgyucht do you have any updates or feedback regarding this PR?
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.