To build the service, and run the integration, the following dependencies are required:
- go
- docker
- docker-compose
The service has been tested in the following environment:
$ go version
go version go1.13.3 darwin/amd64
$ docker version
Client: Docker Engine - Community
Version: 19.03.8
Server: Docker Engine - Community
Engine:
Version: 19.03.8
$ docker-compose version
docker-compose version 1.25.5
make build
to build the service for linux, a container containing the service, and a container containing the source code for testingmake build && make test-integration
to build the test dependencies, and execute the integration testThe user-svc
binary provides the following commands:
serve
serves the servicemigrate
migrate the databaseconfiguration
communication
sub
claim, containing the email address of the userexp
claim, containing a timestamp, that is 24 hours in the futureAuthorization: Bearer <token>
header that contains a JWT tokensub
claim contains an email address, that ends with @test.com
exp
claim contains a timestamp, that is in the futurepersistence
The test environment is setup with docker compose. The test environment consists of the following container:
db
, hosts a postgres databaseuser-svc
, hosts the servicetest
, migrates the database, and executes an integration test against user-svc
The service uses a postgres database for persistence.
The database provides the following tables:
In the production context, user-svc migrate
migrates the database
In the testing context, the test migrates the database
The service accepts, and returns application/json
encoded objects via HTTP
api/v0/createUser
users
table yetapi/v0/deleteUser
users
api/v0/listUsers
api/v0/authenticate