aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-07-24 13:01:36 +0700
committerShulhan <ms@kilabit.info>2023-10-06 10:03:04 +0700
commit8a1a81a6428ae970569d9c2a506acf90deb2e0c4 (patch)
treed3e82e19718962181b51572a0395ed6b1cef2222 /testdata
parent479e33040d93e582aa10f19c299b2633f2270d24 (diff)
downloadgotp-8a1a81a6428ae970569d9c2a506acf90deb2e0c4.tar.xz
all: unfold private key path before reading
By unfolding, user can set the path to private key using "~" that points to their home. This make the key can works across home directory, in case user have multiple homes (Linux and macOS have different home path and maybe user name, but both can use "~" as substitution for $HOME)
Diffstat (limited to 'testdata')
-rw-r--r--testdata/config_marshaler_test.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/testdata/config_marshaler_test.txt b/testdata/config_marshaler_test.txt
new file mode 100644
index 0000000..b354b28
--- /dev/null
+++ b/testdata/config_marshaler_test.txt
@@ -0,0 +1,17 @@
+Test UnmarshalText and MarshalText on config.
+
+>>> input.ini
+[gotp "issuer"]
+test1 = SHA1:a:6:30:
+test2 = SHA1:b:6:30:
+
+[gotp]
+private_key = ~/myprivatekey.pem
+
+<<< output.ini
+[gotp "issuer"]
+test1 = SHA1:a:6:30:
+test2 = SHA1:b:6:30:
+
+[gotp]
+private_key = ~/myprivatekey.pem