commit 88740fdec2b54469752cba7e94c37f134a8c9988
parent c2cb8ecc5a75752a5c0662492fa3335dc48f189e
Author: Sean Enck <sean@ttypty.com>
Date: Sat, 7 Jun 2025 22:16:06 -0400
insert an otpauth string
Diffstat:
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/cmd/lb/main_test.go b/cmd/lb/main_test.go
@@ -222,14 +222,20 @@ func test(profile string) error {
r.run("", "json 'multiline'")
r.logAppend("echo")
r.run("echo 5ae472abqdekjqykoyxk7hvc2leklq5n |", "insert test6/multiline/otp")
+ r.run(`printf "otpauth://totp/lbissuer:lbaccount?algorithm=SHA1&digits=6&issuer=lbissuer&period=30&secret=5ae472abqdekjqykoyxk7hvc2leklq5n" |`, "insert test10/key1/otp")
r.run("", "totp ls")
r.run("", "totp ls rooted")
r.run("", "totp show test6/multiline/otp")
+ r.run("", "totp show test10/key1/otp")
r.run("", "totp once test6/multiline/otp")
r.run("", "totp minimal test6/multiline/otp")
r.run("", "totp url test6/multiline/otp")
r.run("", "totp seed test6/multiline/otp")
+ r.run("", "totp url test10/key1/otp")
+ r.run("", "totp seed test10/key1/otp")
r.run("", fmt.Sprintf("conv \"%s\"", r.store))
+ r.run("echo y |", "rm test10/*")
+ r.logAppend("echo")
r.run("echo y |", "rm test7/deeper")
r.run("echo y |", "rm test7/deeper/ro")
r.run("echo y |", "rm test1/key1/password")
diff --git a/cmd/lb/tests/expected.log b/cmd/lb/tests/expected.log
@@ -120,12 +120,20 @@ test7/deeper/root/url
}
}
+test10/key1/otp
test6/multiline/otp
test7/deeper/rooted/otp
test7/deeper/rooted/otp
XXXXXX
XXXXXX
XXXXXX
+XXXXXX
+url: otpauth://totp/lbissuer:lbaccount?algorithm=SHA1&digits=6&issuer=lbissuer&period=30&secret=5ae472abqdekjqykoyxk7hvc2leklq5n
+seed: 5ae472abqdekjqykoyxk7hvc2leklq5n
+digits: 6
+algorithm: SHA1
+period: 30
+5ae472abqdekjqykoyxk7hvc2leklq5n
url: otpauth://totp/lbissuer:lbaccount?algorithm=SHA1&digits=6&issuer=lbissuer&period=30&secret=5ae472abqdekjqykoyxk7hvc2leklq5n
seed: 5ae472abqdekjqykoyxk7hvc2leklq5n
digits: 6
@@ -136,6 +144,10 @@ period: 30
"modtime": "XXXX-XX-XX",
"password": "521b9ccefbcd14d179e7a1bb877752870a6d620938b28a66a107eac6e6805b9d0989f45b5730508041aa5e710847d439ea74cd312c9355f1f2dae08d40e41d50"
}
+"test10/key1": {
+ "modtime": "XXXX-XX-XX",
+ "otp": "b6c44d5d8a75071d8e8a39df231b0b98584d1d42982b5cf230e44f94d9c48e2983e78955a54b70c0acb0428d6db7205101e332f950ffb6b6d643aa37287c6aa5"
+}
"test4/multiline": {
"modtime": "XXXX-XX-XX",
"notes": "fdb05182a34667e207ad36cf4688d046951a5877482da0b8dfaf1baa112369ede0fd29786e2cf771e0e00d968837d449ce7e373642a945d0675d888403178b77"
@@ -176,6 +188,7 @@ period: 30
"modtime": "XXXX-XX-XX",
"password": "cbf67e6da88d43f048050e36d7010080536372397b6ed0a0446cd2640340bf47cb616ddbc5d35ec3500e295f875f806fc20120a2d5497b3e729e904091424633"
}
+delete entry? (y/N)
no entities matching: test7/deeper
no entities matching: test7/deeper/ro
no entities matching: test1/key1/password