DSN -> SECRET dans middleware
This commit is contained in:
parent
0a755dc76f
commit
70ee654ed9
|
@ -223,13 +223,14 @@ async def root(request):
|
||||||
|
|
||||||
def check_conf():
|
def check_conf():
|
||||||
if not environ.get('HALFORM_SECRET', False):
|
if not environ.get('HALFORM_SECRET', False):
|
||||||
print('Missing HALFORM_SECRET variable from configuration')
|
environ['HALFORM_SECRET'] = 'secret'
|
||||||
|
print('Missing HALFORM_SECRET variable from configuration, seting to default')
|
||||||
if not environ.get('HALFORM_DSN', False):
|
if not environ.get('HALFORM_DSN', False):
|
||||||
print('Missing HALFORM_DSN variable from configuration')
|
print('Missing HALFORM_DSN variable from configuration')
|
||||||
|
|
||||||
app = Starlette(
|
app = Starlette(
|
||||||
middleware=[
|
middleware=[
|
||||||
Middleware(AuthenticationMiddleware, backend=JWTAuthenticationBackend(secret_key=environ.get('HALFORM_DSN'))),
|
Middleware(AuthenticationMiddleware, backend=JWTAuthenticationBackend(secret_key=environ.get('HALFORM_SECRET'))),
|
||||||
Middleware(AclCallerMiddleware),
|
Middleware(AclCallerMiddleware),
|
||||||
],
|
],
|
||||||
on_startup=[startup],
|
on_startup=[startup],
|
||||||
|
|
Loading…
Reference in New Issue