Slight speed up on vpn

Rather than querying bitwarden thrice, which is a slow query, we take
advantage of nushell konwing how to parse JSON output so we can only
query once for the credentials and a second time for the OTP value
This commit is contained in:
Greg Hellings
2025-12-19 10:46:50 -06:00
parent 50aa005349
commit 78637556c7
2 changed files with 5 additions and 6 deletions
Generated
+3 -3
View File
@@ -1043,11 +1043,11 @@
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1765850658,
"narHash": "sha256-WMxrG7K5kQQS0dc8b8WDdwKyBYokRc0Ssa1gIcAigBs=",
"lastModified": 1766109760,
"narHash": "sha256-7A0h2MCAmv/mRgZQSgTS89sXRdDN956hFkaHQ01XGRc=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "3117a5178ba33eafea691756cca52ab250f2a5a9",
"rev": "909232203bc0bc4c1e3311f41be190322bb04a94",
"type": "github"
},
"original": {
+2 -3
View File
@@ -42,10 +42,9 @@ in
def --env vpn [] {
unlock
let username = ^bw get username f7351f9c-b25b-4317-8352-affc00da4644
let password = ^bw get password f7351f9c-b25b-4317-8352-affc00da4644
let login = ^bw get item f7351f9c-b25b-4317-8352-affc00da4644 | from json
let otp = ^bw get totp 10371487-7f40-4b08-9a45-b33e00de318b
osascript ${vpn} $username $"($password)($otp)"
osascript ${vpn} $login.login.username $"($login.login.password)($otp)"
}
'';
settings = {