An open API service indexing awesome lists of open source software.

https://github.com/roundpartner/tempus

Micro Service for generating time based keys
https://github.com/roundpartner/tempus

Last synced: 10 months ago
JSON representation

Micro Service for generating time based keys

Awesome Lists containing this project

README

          

# Tempus
Micro Service for generating time based keys
## Abstract
This service provides an end point for generating a new token that can be used to authenticate a user.
# Usage
```bash
curl localhost:7373 -d "{\"user_id\":\"1\",\"scenario\":\"test\"}"
```
```json
{"user_id":"1","scenario":"test","token":"2b73bb3213da2f0627f492b741bdeb491a43d0f392176981e4138924147ca0d7"}
```
```bash
curl localhost:7373/1/2b73bb3213da2f0627f492b741bdeb491a43d0f392176981e4138924147ca0d7
```

```json
{"user_id":"1","scenario":"test","token":"BAa-gqpESzJMy6k-oxiokPk-oJ-sejqzgmdSQ0pHXdz3dwTg9wXImWT3_hBKyhgS"}
```
# Testing
You will need redis to run tests
## Starting Redis
Redis can be run locally in a container with
```bash
docker run --rm --name tempus-redis -p 127.0.0.1:6379:6379 redis
```
You can then monitor the server with
```bash
docker exec tempus-redis redis-cli monitor
```
# Benchmarking
```bash
go test -bench=.
```