Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 2.24 KB

README.md

File metadata and controls

55 lines (41 loc) · 2.24 KB

ZenAuth

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.

Development

  • To regenerate the GRPC/Protocol Buffers code, run make build_protobuf. Requires go 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.

Release

This project uses Zest to build the project.

Run zest build && zest bundle to generate a local docker image with the newest code.

Run

To run this project there're some required environment variables:

Required and recommended:

  • ZENAUTH_POSTGRESQLDATABASE: database name
  • ZENAUTH_POSTGRESQLPASSWORD: database password
  • ZENAUTH_POSTGRESQLUSERNAME: databse username
  • ZENAUTH_POSTGRESQLPORT: database port
  • ZENAUTH_POSTGRESQLSSL: true/false to use ssl or not
  • ZENAUTH_HASHSECRET: secret to generate secure tokens
  • ZENAUTH_APITOKEN: Token required to be sent to all HTTP request to make sure the client is authorized
  • ZENAUTH_DOMAINHOST: Domain where the service is running
  • ZENAUTH_ENVIRONMENT: Must be production
  • ZENAUTH_EMAILENABLED: true to use e-mail. Required for reset password features
  • ZENAUTH_MAILGUNDOMAIN: Domain used in mailgun
  • ZENAUTH_MAILGUNPUBLICKEY: Public key used in mailgun
  • ZENAUTH_MAILGUNPRIVATEKEY: Private key used in mailgun
  • ZENAUTH_MAILGUNFROM: e-mail address to send emails from
  • ZENAUTH_NEWRELICENABLED: true to use NewRelic
  • ZENAUTH_NEWRELICNAME: Application name for NewRelic.
  • ZENAUTH_NEWRELICKEY: Account key for NewRelic.
  • ZENAUTH_RESETPASSWORDURL: Url to send users in the reset password e-mail
  • ZENAUTH_VERIFYEMAILURL: Url to send users to verify their e-mail

Optional:

  • ZENAUTH_APPNAME: Application name. Defaults to ZenAuth
  • ZENAUTH_TRANSPORT: http/https (default https)
  • ZENAUTH_LOGLEVEL: WARNING/INFO (default INFO)
  • ZENAUTH_PORT: Port used for the http server (default 5000)