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

add debug tree command

parent 99be54a8
No related branches found
No related tags found
No related merge requests found
Pipeline #13697 passed
......@@ -4,6 +4,9 @@ RUN mkdir /app
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash -
RUN apt-get -y install make autoconf automake libtool pkg-config nodejs git python3-pip
# ---
RUN apt-get -y install tree
# ---
RUN rm -rf /var/lib/apt/lists/*
WORKDIR /app
......@@ -26,6 +29,8 @@ RUN cd frontend; \
cp dist/favicon.ico ../server/server/static/; \
rm -fr dist
RUN tree
RUN bash -c "adduser --disabled-login --quiet --gecos app app && \
chmod -R o+r /app/ && \
chmod o+x /app/server/run.sh"
......
......@@ -9,25 +9,25 @@ import werkzeug
def authentication_required(func: typing.Callable) -> typing.Callable:
@functools.wraps(func)
def decorator(*args, **kwargs) -> typing.Any:
#if "token" not in flask.request.cookies:
#return flask.redirect(flask.url_for("oidc.login"))
#try:
#claims = authlib.jose.jwt.decode(
#flask.request.cookies["token"],
#flask.current_app.config["JWT_SECRET_KEY"],
#)
#except authlib.jose.JoseError as exception:
#raise werkzeug.exceptions.BadRequest from exception
#try:
#claims.validate()
#except authlib.jose.JoseError as exception:
#flask.current_app.logger.info(
#"Claim validation failed for user %s: %s", claims["sub"], exception
#)
#return flask.redirect(flask.url_for("oidc.login"))
if "token" not in flask.request.cookies:
return flask.redirect(flask.url_for("oidc.login"))
try:
claims = authlib.jose.jwt.decode(
flask.request.cookies["token"],
flask.current_app.config["JWT_SECRET_KEY"],
)
except authlib.jose.JoseError as exception:
raise werkzeug.exceptions.BadRequest from exception
try:
claims.validate()
except authlib.jose.JoseError as exception:
flask.current_app.logger.info(
"Claim validation failed for user %s: %s", claims["sub"], exception
)
return flask.redirect(flask.url_for("oidc.login"))
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