Store your keys encrypted for exactly one read
- on macOS
go get -d -v ./...
docker-compose up --build
When you want to start only redis, execute:
docker-compose up redis
The server requires the following environment variables to be set:
REDIS_DSN
: The server address of Redis (e.g.localhost:6379
)HTTP_PORT
: The port on which the server listens to (e.g.8080
)
go run backend/src/main.go
Debug the app with VS Code by executing the Launch
debug script. Simply run
the Debug: Select and Start Debugging
command and select Launch
. Note: You
might need to install xcode command line tools (xcode-select --install
) to
be able to run the debugger on macOS.
-
GET /api/{key}
Returns the value by the key. Additionally the
X-Secret
header might be used to decrypt the value. -
POST /api
Stores a new value and returns the generated key. Additionally the
X-Secret
header might be used to encrypt the value. -
DELETE /api/{key}
Deletes a key
- https://bitbucket.org/rwirdemann/rest-apis-go
- https://jaxenter.de/restful-rest-api-go-golang-68845
- https://github.com/go-redis/redis
- https://tutorialedge.net/golang/go-encrypt-decrypt-aes-tutorial/
- https://security.stackexchange.com/questions/38828/how-can-i-securely-convert-a-string-password-to-a-key-used-in-aes
- https://redis.io/topics/rediscli