Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
828fd02
Add auth logout command with --profile and --force flags
mihaimitrea-db Feb 27, 2026
3628b08
Improve auth logout confirmation with styled warning template
mihaimitrea-db Feb 27, 2026
7628785
Address auth logout review feedback
mihaimitrea-db Feb 27, 2026
65e9ec8
Consolidate logout tests
mihaimitrea-db Mar 2, 2026
f7121e1
Fix and improve failing DeleteProfile tests
mihaimitrea-db Mar 2, 2026
36b9983
Fix test variable typo
mihaimitrea-db Mar 2, 2026
605a454
Removed redundant test case from logout
mihaimitrea-db Mar 2, 2026
433df86
Address PR review feedback for auth logout
mihaimitrea-db Mar 3, 2026
ac76e0a
Add acceptance tests for auth logout
mihaimitrea-db Mar 3, 2026
ca22376
Make profile deletion opt-in with --delete flag
mihaimitrea-db Mar 3, 2026
40046fc
Fix failing acc test for --delete flag in auth logout
mihaimitrea-db Mar 3, 2026
7001e21
Use SDK CanonicalHostName to normalize host in token cache cleanup
mihaimitrea-db Mar 4, 2026
3de4b00
Improve profile list when specified profile does not exist
mihaimitrea-db Mar 4, 2026
229ba37
Fix failing acceptance test
mihaimitrea-db Mar 4, 2026
b647cab
Address PR review feedback
mihaimitrea-db Mar 5, 2026
865c3b0
Fix failing tests due to wrong context
mihaimitrea-db Mar 5, 2026
d363ad8
Refine auth logout messages and fix acc test
mihaimitrea-db Mar 5, 2026
aa2fd40
Fix failing test
mihaimitrea-db Mar 5, 2026
25dca58
Update acceptance tests to match new terminal outputs
mihaimitrea-db Mar 5, 2026
bf43f7d
Add interactive profile picker to auth logout
mihaimitrea-db Feb 27, 2026
6e8d5bd
Expand auth logout long description with usage details
mihaimitrea-db Feb 27, 2026
3998830
Update command description to reflect the introduction of --delete flag
mihaimitrea-db Mar 3, 2026
866ff96
Improve auth logout long description wording
mihaimitrea-db Mar 4, 2026
4bd2e44
Remove profile picker list sorting
mihaimitrea-db Mar 5, 2026
3840e4f
Extract shared SelectProfile helper to eliminate duplicate profile pi…
mihaimitrea-db Mar 3, 2026
5621e8d
Deduplicate config file write logic and use env.Get for consistency
mihaimitrea-db Mar 3, 2026
ea5f06c
Fix linting error for unused import
mihaimitrea-db Mar 4, 2026
5b28ae0
Fix missing strings import in logout.go
mihaimitrea-db Mar 4, 2026
efece09
Remove unrelated change in login.go for path variable acquisition
mihaimitrea-db Mar 5, 2026
b6b668f
Remove profile picker list sorting
mihaimitrea-db Mar 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

; Dev workspace
[dev]
host = https://dev.cloud.databricks.com
auth_type = databricks-cli
5 changes: 5 additions & 0 deletions acceptance/cmd/auth/logout/default-profile/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions acceptance/cmd/auth/logout/default-profile/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

=== Initial config
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
host = https://default.cloud.databricks.com
auth_type = databricks-cli

; Dev workspace
[dev]
host = https://dev.cloud.databricks.com
auth_type = databricks-cli

=== Delete the DEFAULT profile
>>> [CLI] auth logout --profile DEFAULT --force --delete
Logged out of and deleted profile "DEFAULT".

=== Backup file should exist
OK: Backup file exists

=== Config after logout — empty DEFAULT with comment should remain at the top of the file
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

; Dev workspace
[dev]
host = https://dev.cloud.databricks.com
auth_type = databricks-cli
27 changes: 27 additions & 0 deletions acceptance/cmd/auth/logout/default-profile/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
sethome "./home"

cat > "./home/.databrickscfg" <<'EOF'
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
host = https://default.cloud.databricks.com
auth_type = databricks-cli

; Dev workspace
[dev]
host = https://dev.cloud.databricks.com
auth_type = databricks-cli
EOF

title "Initial config\n"
cat "./home/.databrickscfg"

title "Delete the DEFAULT profile"
trace $CLI auth logout --profile DEFAULT --force --delete

title "Backup file should exist\n"
assert_backup_exists

title "Config after logout — empty DEFAULT with comment should remain at the top of the file\n"
cat "./home/.databrickscfg"

cp "./home/.databrickscfg" "./out.databrickscfg"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions acceptance/cmd/auth/logout/delete-pat-token-profile/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

=== Initial config
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

[dev]
host = https://dev.cloud.databricks.com
token = dev-pat-token

=== Logout without --delete — should report no changes for non-U2M profile
>>> [CLI] auth logout --profile dev --force
No tokens to clear for profile "dev". Use --delete to remove it from the config file.

=== Config after logout — profile should be unchanged
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

[dev]
host = https://dev.cloud.databricks.com
token = dev-pat-token

=== Logout with --delete — should delete the profile
>>> [CLI] auth logout --profile dev --force --delete
Deleted profile "dev" with no tokens to clear.

=== Backup file should exist
OK: Backup file exists

=== Config after delete — profile should be removed
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
28 changes: 28 additions & 0 deletions acceptance/cmd/auth/logout/delete-pat-token-profile/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
sethome "./home"

cat > "./home/.databrickscfg" <<'EOF'
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

[dev]
host = https://dev.cloud.databricks.com
token = dev-pat-token
EOF

title "Initial config\n"
cat "./home/.databrickscfg"

title "Logout without --delete — should report no changes for non-U2M profile"
trace $CLI auth logout --profile dev --force

title "Config after logout — profile should be unchanged\n"
cat "./home/.databrickscfg"

title "Logout with --delete — should delete the profile"
trace $CLI auth logout --profile dev --force --delete

title "Backup file should exist\n"
assert_backup_exists

title "Config after delete — profile should be removed\n"
cat "./home/.databrickscfg"
5 changes: 5 additions & 0 deletions acceptance/cmd/auth/logout/error-cases/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions acceptance/cmd/auth/logout/error-cases/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

=== Logout of non-existent profile
Error: profile "nonexistent" not found. Available profiles: dev

Exit code: 1

=== Logout without --profile in non-interactive mode
Error: the command is being run in a non-interactive environment, please specify a profile to log out of using --profile

Exit code: 1
16 changes: 16 additions & 0 deletions acceptance/cmd/auth/logout/error-cases/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sethome "./home"

cat > "./home/.databrickscfg" <<'EOF'
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

[dev]
host = https://dev.cloud.databricks.com
auth_type = databricks-cli
EOF

title "Logout of non-existent profile\n"
errcode $CLI auth logout --profile nonexistent --force

title "Logout without --profile in non-interactive mode\n"
errcode $CLI auth logout --force
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
5 changes: 5 additions & 0 deletions acceptance/cmd/auth/logout/last-non-default/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions acceptance/cmd/auth/logout/last-non-default/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

=== Initial config
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

; The only non-default profile
[only-profile]
host = https://only.cloud.databricks.com
auth_type = databricks-cli

=== Delete the only non-default profile
>>> [CLI] auth logout --profile only-profile --force --delete
Logged out of and deleted profile "only-profile".

=== Backup file should exist
OK: Backup file exists

=== Config after logout — DEFAULT section with comment should remain
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
25 changes: 25 additions & 0 deletions acceptance/cmd/auth/logout/last-non-default/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
sethome "./home"

cat > "./home/.databrickscfg" <<'EOF'
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

; The only non-default profile
[only-profile]
host = https://only.cloud.databricks.com
auth_type = databricks-cli
EOF

title "Initial config\n"
cat "./home/.databrickscfg"

title "Delete the only non-default profile"
trace $CLI auth logout --profile only-profile --force --delete

title "Backup file should exist\n"
assert_backup_exists

title "Config after logout — DEFAULT section with comment should remain\n"
cat "./home/.databrickscfg"

cp "./home/.databrickscfg" "./out.databrickscfg"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
host = https://default.cloud.databricks.com
auth_type = databricks-cli

; Second workspace — beta
[beta]
host = https://beta.cloud.databricks.com
auth_type = databricks-cli
5 changes: 5 additions & 0 deletions acceptance/cmd/auth/logout/ordering-preserved/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions acceptance/cmd/auth/logout/ordering-preserved/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

=== Initial config
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
host = https://default.cloud.databricks.com
auth_type = databricks-cli

; First workspace — alpha
[alpha]
host = https://alpha.cloud.databricks.com
auth_type = databricks-cli

; Second workspace — beta
[beta]
host = https://beta.cloud.databricks.com
auth_type = databricks-cli

; Third workspace — gamma
[gamma]
host = https://accounts.cloud.databricks.com
account_id = account-id
auth_type = databricks-cli

=== Delete first non-default profile (alpha)
>>> [CLI] auth logout --profile alpha --force --delete
Logged out of and deleted profile "alpha".

=== Backup file should exist
OK: Backup file exists

=== Config after deleting alpha
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
host = https://default.cloud.databricks.com
auth_type = databricks-cli

; Second workspace — beta
[beta]
host = https://beta.cloud.databricks.com
auth_type = databricks-cli

; Third workspace — gamma
[gamma]
host = https://accounts.cloud.databricks.com
account_id = account-id
auth_type = databricks-cli

=== Delete last profile (gamma)
>>> [CLI] auth logout --profile gamma --force --delete
Logged out of and deleted profile "gamma".

=== Config after deleting gamma
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
host = https://default.cloud.databricks.com
auth_type = databricks-cli

; Second workspace — beta
[beta]
host = https://beta.cloud.databricks.com
auth_type = databricks-cli
44 changes: 44 additions & 0 deletions acceptance/cmd/auth/logout/ordering-preserved/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
sethome "./home"

cat > "./home/.databrickscfg" <<'EOF'
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]
host = https://default.cloud.databricks.com
auth_type = databricks-cli

; First workspace — alpha
[alpha]
host = https://alpha.cloud.databricks.com
auth_type = databricks-cli

; Second workspace — beta
[beta]
host = https://beta.cloud.databricks.com
auth_type = databricks-cli

; Third workspace — gamma
[gamma]
host = https://accounts.cloud.databricks.com
account_id = account-id
auth_type = databricks-cli
EOF

title "Initial config\n"
cat "./home/.databrickscfg"

title "Delete first non-default profile (alpha)"
trace $CLI auth logout --profile alpha --force --delete

title "Backup file should exist\n"
assert_backup_exists

title "Config after deleting alpha\n"
cat "./home/.databrickscfg"

title "Delete last profile (gamma)"
trace $CLI auth logout --profile gamma --force --delete

title "Config after deleting gamma\n"
cat "./home/.databrickscfg"

cp "./home/.databrickscfg" "./out.databrickscfg"
7 changes: 7 additions & 0 deletions acceptance/cmd/auth/logout/script.prepare
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
assert_backup_exists() {
if [ -f "./home/.databrickscfg.bak" ]; then
echo "OK: Backup file exists"
else
echo "ERROR: Backup file does not exist"
fi
}
3 changes: 3 additions & 0 deletions acceptance/cmd/auth/logout/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Ignore = [
"home"
]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions acceptance/cmd/auth/logout/token-only-shared-host/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

=== Token cache keys before logout
[
"dev",
"https://shared.cloud.databricks.com",
"staging"
]

=== Logout dev without --delete
>>> [CLI] auth logout --profile dev --force
Logged out of profile "dev". Use --delete to also remove it from the config file.

=== Config after logout — both profiles should still exist
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

[dev]
host = https://shared.cloud.databricks.com
auth_type = databricks-cli

[staging]
host = https://shared.cloud.databricks.com
auth_type = databricks-cli

=== Token cache keys after logout — dev removed, host preserved (shared with staging)
[
"https://shared.cloud.databricks.com",
"staging"
]
Loading