Auth microservice integrated with kong for registration and issuing tokens.
- White-listed email registration
- Anonymous: RSA encrypted personal information(email) and random identity
- issue and revoke JWT tokens
This project continuously integrates with docker. Go check it out if you don't have docker locally installed.
docker run -d -p 8000:8000 shi2002/auth
Configurations:
Key | Example Value | Description |
---|---|---|
SANIC_MODE | dev | 'production' in production mode, otherwise in dev mode |
SANIC_DB_URL | mysql://username:pwd@host:port/db | required |
SANIC_KONG_URL | http://kong:8001 | kong admin api, required |
SANIC_KONG_TOKEN | token | set "Authorization" key auth in kong to secure admin api |
SANIC_EMAIL_WHITELIST | ["example.com", "example.org"] | domains allowed to register, default to [], accepting all domains |
SANIC_VERIFICATION_CODE_EXPIRES | 10 | verification code expires in minutes |
SANIC_EMAIL_HOST | smtpdm.aliyun.com | smtp email service |
SANIC_EMAIL_PORT | 465 | |
SANIC_EMAIL_USER | [email protected] | |
SANIC_EMAIL_PASSWORD | password |
API Docs are available at /docs
Feel free to dive in! Open an issue or submit PRs.
This project exists thanks to all the people who contribute.