Skip to content

A microservice in Go that stores secrets encrypted with AES

License

Notifications You must be signed in to change notification settings

jamesjoshuahill/secret

Repository files navigation

secret

Build Status Go Report Card

A microservice written in Go that stores secrets encrypted with AES.

Ciphertext is stored in memory and can be retrieved with the correct AES key.

Get

This module requires Go 1.15 or greater.

git clone https://github.com/jamesjoshuahill/secret.git
cd secret

Lint

Install golangci-lint.

Run linters:

golangci-lint run

Test

Run the tests using the Ginkgo test runner:

go install github.com/onsi/ginkgo/ginkgo
ginkgo -race -cover -r

or:

go test -race -cover ./...

Run

The server requires TLS configuration.

For example, use the self-signed certificate and private key used by the test suite:

go run cmd/secret-server/main.go \
  --host localhost \
  --port 8080 \
  --cert acceptance_test/testdata/cert.pem \
  --key acceptance_test/testdata/key.pem

Then, create a secret:

curl \
  --cacert acceptance_test/testdata/cert.pem \
  https://localhost:8080/v1/secrets \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"id":"some-id","data":"some plain text"}'

and retrieve it using the AES key:

curl \
  --cacert acceptance_test/testdata/cert.pem \
  https://localhost:8080/v1/secrets/some-id \
  -X GET \
  -H 'Content-Type: application/json' \
  -d '{"key":"AES KEY for secret"}'

Client

The client package provides a Client to interact with the server.

Please refer to the package documentation.

API

Please refer to the API specification.

About

A microservice in Go that stores secrets encrypted with AES

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages