This project was generated by hatch. It is a microservice to handle user authentication. Its features include:
- Signup
- Login
- Reset password flow (using mailgun)
- Update email and password
- Get user information given an auth token
This service doesn't store any profile information, just user e-mail.
- To regenerate the GRPC/Protocol Buffers code, run
make build_protobuf
. Requiresgo get -u github.com/golang/protobuf/protoc-gen-go
. - To regenerate the API documentation from the Swagger file, run
make build_docs
. Requires swagger-codegen.
This project uses Zest to build the project.
Run zest build && zest bundle
to generate a local docker image with the newest code.
To run this project there're some required environment variables:
Required and recommended:
ZENAUTH_POSTGRESQLDATABASE
: database nameZENAUTH_POSTGRESQLPASSWORD
: database passwordZENAUTH_POSTGRESQLUSERNAME
: databse usernameZENAUTH_POSTGRESQLPORT
: database portZENAUTH_POSTGRESQLSSL
:true/false
to use ssl or notZENAUTH_HASHSECRET
: secret to generate secure tokensZENAUTH_APITOKEN
: Token required to be sent to all HTTP request to make sure the client is authorizedZENAUTH_DOMAINHOST
: Domain where the service is runningZENAUTH_ENVIRONMENT
: Must beproduction
ZENAUTH_EMAILENABLED
:true
to use e-mail. Required for reset password featuresZENAUTH_MAILGUNDOMAIN
: Domain used in mailgunZENAUTH_MAILGUNPUBLICKEY
: Public key used in mailgunZENAUTH_MAILGUNPRIVATEKEY
: Private key used in mailgunZENAUTH_MAILGUNFROM
: e-mail address to send emails fromZENAUTH_NEWRELICENABLED
:true
to use NewRelicZENAUTH_NEWRELICNAME
: Application name for NewRelic.ZENAUTH_NEWRELICKEY
: Account key for NewRelic.ZENAUTH_RESETPASSWORDURL
: Url to send users in the reset password e-mailZENAUTH_VERIFYEMAILURL
: Url to send users to verify their e-mail
Optional:
ZENAUTH_APPNAME
: Application name. Defaults toZenAuth
ZENAUTH_TRANSPORT
:http/https
(defaulthttps
)ZENAUTH_LOGLEVEL
:WARNING/INFO
(defaultINFO
)ZENAUTH_PORT
: Port used for the http server (default5000
)