Giter VIP home page Giter VIP logo

auth's Introduction

Auth

Auth microservice integrated with kong for registration and issuing tokens.

Features

  • White-listed email registration
  • Anonymous: RSA encrypted personal information(email) and random identity
  • issue and revoke JWT tokens

Deploy

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

Usage

API Docs are available at /docs

Badge

build dev build

stars issues pull requests

standard-readme compliant

Powered by

Python

Contributing

Feel free to dive in! Open an issue or submit PRs.

Contributors

This project exists thanks to all the people who contribute.

Licence

license © OpenTreeHole

auth's People

Contributors

hasbai avatar jingyijun avatar kyln24 avatar pramsin avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

ruslan-korneev

auth's Issues

支持 docker secrets

修改config.py,使 db_url、email_password、register_apikey_seed、kong_token 等配置项可以从 docker secrets 中读取。注意异常处理。

改进 identifier 的安全性

描述

user 的 identifier 字段用于登录时定位 user,通过 utils/auth.py 中的 many_hashes() 函数产生。这个函数应当加盐以提高其安全性。

期望结果

  • many_hashes() 应返回 hashlib.pbkdf2_hmac('sha3_512', byte_string, salt, iterations=1).hex()
  • salt 从 docker secrets 中读取,是一个 base64 字符串,解码为 bytes 后使用
  • 最好把 many_hashes() 换个名,比如 generate_identifier()
  • 迁移数据时 更新用户的 identifier

数据库 API 可参考 https://tortoise-orm.readthedocs.io/en/latest/getting_started.html#tutorial

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.