bugfix
This commit is contained in:
parent
fc4faed700
commit
102c65b2e9
4
pyproject.toml
Normal file
4
pyproject.toml
Normal file
@ -0,0 +1,4 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=61", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
@ -125,6 +125,8 @@ async def bearer_auth(sor, auth):
|
||||
|
||||
async def getAuthenticationUserid(sor, request):
|
||||
auth = request.headers.get('Authentication')
|
||||
if auth is None:
|
||||
return None
|
||||
for h,f in registered_auth_methods.items():
|
||||
if auth.startswith(h):
|
||||
return await f(auth)
|
||||
@ -168,6 +170,7 @@ registered_auth_methods = {
|
||||
"Basic ": basic_auth,
|
||||
"Bearer ": bearer_auth
|
||||
}
|
||||
register_auth_method(heading, func):
|
||||
|
||||
def register_auth_method(heading, func):
|
||||
registered_auth_methods[heading] = func
|
||||
|
||||
|
16
setup.cfg
Normal file
16
setup.cfg
Normal file
@ -0,0 +1,16 @@
|
||||
[metadata]
|
||||
name=rbac
|
||||
version = 1.0.0
|
||||
description = a RBAC user authenticate module
|
||||
author = "yu moqing"
|
||||
author_email = "yumoqing@gmail.com"
|
||||
readme = "README.md"
|
||||
license = "MIT"
|
||||
[options]
|
||||
packages = find:
|
||||
requires_python = ">=3.8"
|
||||
install_requires =
|
||||
apppublic
|
||||
sqlor
|
||||
ahserver
|
||||
|
Loading…
Reference in New Issue
Block a user