Make sure we do not expose secrets in output

This is using the RFC-8959 URI scheme to detect secrets. Thanks
hackernews for the idea ;)
This commit is contained in:
2022-05-27 23:37:54 +02:00
parent 90d188e01e
commit a71711978e
4 changed files with 18 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ def check_headers():
app.logger.error("Invalid accept header")
abort(500)
auth_header = request.headers.get("authorization")
if auth_header != "token authtoken":
if auth_header != "token secret-token:myauthtoken":
app.logger.error("Invalid authorization header: %s", auth_header)
abort(
make_response(

View File

@@ -12,7 +12,7 @@ def check_headers():
app.logger.error("Invalid accept header")
abort(500)
auth_header = request.headers.get("authorization")
if auth_header != "bearer authtoken":
if auth_header != "bearer secret-token:myauthtoken":
app.logger.error("Invalid authorization header: %s", auth_header)
abort(
make_response(