Micro Service for generating time based keys
This service provides an end point for generating a new token that can be used to authenticate a user.
curl localhost:7373 -d "{\"user_id\":\"1\",\"scenario\":\"test\"}"
{"user_id":"1","scenario":"test","token":"2b73bb3213da2f0627f492b741bdeb491a43d0f392176981e4138924147ca0d7"}
curl localhost:7373/1/2b73bb3213da2f0627f492b741bdeb491a43d0f392176981e4138924147ca0d7
{"user_id":"1","scenario":"test","token":"BAa-gqpESzJMy6k-oxiokPk-oJ-sejqzgmdSQ0pHXdz3dwTg9wXImWT3_hBKyhgS"}
You will need redis to run tests
Redis can be run locally in a container with
docker run --rm --name tempus-redis -p 127.0.0.1:6379:6379 redis
You can then monitor the server with
docker exec tempus-redis redis-cli monitor
go test -bench=.