-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy pathscript
More file actions
47 lines (39 loc) · 1.14 KB
/
script
File metadata and controls
47 lines (39 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 = ${DATABRICKS_HOST}
auth_type = databricks-cli
[staging]
host = ${DATABRICKS_HOST}
auth_type = databricks-cli
EOF
mkdir -p "./home/.databricks"
cat > "./home/.databricks/token-cache.json" <<EOF
{
"version": 1,
"tokens": {
"dev": {
"access_token": "dev-cached-token",
"token_type": "Bearer"
},
"staging": {
"access_token": "staging-cached-token",
"token_type": "Bearer"
},
"${DATABRICKS_HOST}": {
"access_token": "shared-host-token",
"token_type": "Bearer"
}
}
}
EOF
title "Token cache keys before logout\n"
jq -S '.tokens | keys' "./home/.databricks/token-cache.json"
title "Logout dev without --delete"
trace $CLI auth logout --profile dev --force
title "Config after logout — both profiles should still exist\n"
cat "./home/.databrickscfg"
title "Token cache keys after logout — dev removed, host preserved (shared with staging)\n"
jq -S '.tokens | keys' "./home/.databricks/token-cache.json"