forked from collegevine/confcrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_test_file
More file actions
30 lines (18 loc) · 815 Bytes
/
create_test_file
File metadata and controls
30 lines (18 loc) · 815 Bytes
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
#!/bin/bash
# Local test
echo "Running with a local key"
rm test.econf
touch test.econf
confcrypt add --key ~/.ssh/confcrypt --name Test --type String --value Foobar test.econf > test.econf
RES=$(confcrypt add --key ~/.ssh/confcrypt --name Test2 --type Int --value 42 test.econf)
echo "$RES" > test.econf
confcrypt read --key ~/.ssh/confcrypt test.econf
# KMS Test
KMS_FILE="testk.econf"
rm $KMS_FILE
touch $KMS_FILE
echo "Running KMS round-trip test"
confcrypt add --use-aws --key 752e42fb-c5f0-473d-a532-2e2ee6877cea --name Test --type String --value Foobar $KMS_FILE > $KMS_FILE
RES=$(confcrypt add --use-aws --key 752e42fb-c5f0-473d-a532-2e2ee6877cea --name Test2 --type Int --value 42 $KMS_FILE)
echo "$RES" > $KMS_FILE
confcrypt read --use-aws --key 752e42fb-c5f0-473d-a532-2e2ee6877cea $KMS_FILE