Skip to content
Snippets Groups Projects
Commit 99be54a8 authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

npm audit fix

parent 0a26d7a9
No related branches found
No related tags found
No related merge requests found
...@@ -3975,9 +3975,9 @@ ...@@ -3975,9 +3975,9 @@
} }
}, },
"node_modules/semver": { "node_modules/semver": {
"version": "6.3.0", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"optional": true, "optional": true,
"bin": { "bin": {
"semver": "bin/semver.js" "semver": "bin/semver.js"
...@@ -4304,9 +4304,9 @@ ...@@ -4304,9 +4304,9 @@
} }
}, },
"node_modules/tough-cookie": { "node_modules/tough-cookie": {
"version": "4.1.2", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz",
"integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==",
"optional": true, "optional": true,
"dependencies": { "dependencies": {
"psl": "^1.1.33", "psl": "^1.1.33",
......
...@@ -9,25 +9,25 @@ import werkzeug ...@@ -9,25 +9,25 @@ import werkzeug
def authentication_required(func: typing.Callable) -> typing.Callable: def authentication_required(func: typing.Callable) -> typing.Callable:
@functools.wraps(func) @functools.wraps(func)
def decorator(*args, **kwargs) -> typing.Any: def decorator(*args, **kwargs) -> typing.Any:
if "token" not in flask.request.cookies: #if "token" not in flask.request.cookies:
return flask.redirect(flask.url_for("oidc.login")) #return flask.redirect(flask.url_for("oidc.login"))
try: #try:
claims = authlib.jose.jwt.decode( #claims = authlib.jose.jwt.decode(
flask.request.cookies["token"], #flask.request.cookies["token"],
flask.current_app.config["JWT_SECRET_KEY"], #flask.current_app.config["JWT_SECRET_KEY"],
) #)
except authlib.jose.JoseError as exception: #except authlib.jose.JoseError as exception:
raise werkzeug.exceptions.BadRequest from exception #raise werkzeug.exceptions.BadRequest from exception
try: #try:
claims.validate() #claims.validate()
except authlib.jose.JoseError as exception: #except authlib.jose.JoseError as exception:
flask.current_app.logger.info( #flask.current_app.logger.info(
"Claim validation failed for user %s: %s", claims["sub"], exception #"Claim validation failed for user %s: %s", claims["sub"], exception
) #)
return flask.redirect(flask.url_for("oidc.login")) #return flask.redirect(flask.url_for("oidc.login"))
return func(*args, **kwargs) return func(*args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment