findy-agent-vault
Data storage service for findy-agency clients. Service provides GraphQL interface for interaction.
Usage
Service providing mock data can be launched with following steps:
-
Install go
-
Run
make run
This will launch the service in port 8085.
- Access graphiQL playground with browser: http://localhost:8085
- Configure URL
http://localhost:8085/query
to your own GQL-client.
See sample client implementation.
Authentication
Running the service in playground mode provides an endpoint for mock authentication token generation.
Visit http://localhost:8085/token to generate the token.
API requests should contain this token in header field for the authentication to succeed:
{"Authorization": "Bearer <TOKEN>"}
Unit testing
Unit tests assume postgres is running on port 5433.
Launch default postgres container by declaring password for postgres user:
export FAV_DB_PASSWORD="mysecretpassword"
and running
make init-test
You can run all unit tests with command
go test ./...
For linting, you need to install golangci-lint
make check
builds, tests and lints the code.