-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (47 loc) · 1.87 KB
/
Makefile
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
48
49
50
51
52
53
54
55
56
57
58
59
demo: proxy ui app dbinit
./local_data.sh
proxy:
docker compose up -d proxy
ui:
docker compose up -d ui
app:
docker compose kill app
docker compose rm -f app
docker compose up -d app
test: clean dbinit
docker compose run --rm app go test ./...
db:
docker compose up -d dynamo
dbinit: db wait createwebauthntable createapikeytable
wait:
sleep 5
createwebauthntable:
AWS_ENDPOINT=http://localhost:8000 AWS_DEFAULT_REGION=local AWS_ACCESS_KEY_ID=abc123 AWS_SECRET_ACCESS_KEY=abc123 AWS_PAGER="" aws dynamodb create-table \
--table-name WebAuthn \
--billing-mode PAY_PER_REQUEST \
--attribute-definitions AttributeName=uuid,AttributeType=S \
--key-schema AttributeName=uuid,KeyType=HASH
# create ApiKey table with test key = EC7C2E16-5028-432F-8AF2-A79A64CF3BC1, secret = 1ED18444-7238-410B-A536-D6C15A3C
createapikeytable:
AWS_ENDPOINT=http://localhost:8000 AWS_DEFAULT_REGION=local AWS_ACCESS_KEY_ID=abc123 AWS_SECRET_ACCESS_KEY=abc123 AWS_PAGER="" aws dynamodb create-table \
--table-name ApiKey \
--billing-mode PAY_PER_REQUEST \
--attribute-definitions AttributeName=value,AttributeType=S \
--key-schema AttributeName=value,KeyType=HASH
sleep 3
AWS_ENDPOINT=http://localhost:8000 AWS_DEFAULT_REGION=local AWS_ACCESS_KEY_ID=abc123 AWS_SECRET_ACCESS_KEY=abc123 aws dynamodb put-item \
--table-name ApiKey \
--item '{"value": {"S": "EC7C2E16-5028-432F-8AF2-A79A64CF3BC1"},"hashedApiSecret": {"S": "$$2y$$10$$HtvmT/nnfofEhoFNmtk/9OfP4DDJvjzSa5dVhtOKolwb8hc6gJ9LK"},"activatedAt": {"N": "1590518082000"},"createdAt": {"N": "1590518082000"},"email": {"S": "[email protected]"}}'
showapikeys:
aws dynamodb scan \
--table-name ApiKey \
--endpoint-url http://localhost:8000 \
--region localhost
showwebauth:
aws dynamodb scan \
--table-name WebAuthn \
--endpoint-url http://localhost:8000 \
--region localhost
clean:
docker compose kill
docker compose rm -f