Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion JWT/jwt-signature-apis-challenges/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ app.post('/jwt/none', (req, res) => { //None endpoint
} else if (jwt_b64_dec.header.alg == 'none') {
secret_key = '';
}
JWT.verify(jwt_token, secret_key, { algorithms: ['none', 'HS256'], complete: true, audience: 'https://127.0.0.1/jwt/none' }, (err, decoded_token) => {
JWT.verify(jwt_token, secret_key, { algorithms: [/*'none', */'HS256'], complete: true, audience: 'https://127.0.0.1/jwt/none' }, (err, decoded_token) => {
if(secret_key == '' && jwt_b64_dec.payload.account == "Administrator"){
err = 'Critical security issue: JWT with alg:none and Administrator account accepted.';
}
if (err) {
res.status(400).json(err);
} else {
Expand Down
9 changes: 7 additions & 2 deletions Python/Flask_Book_Library/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ WORKDIR /app
COPY . .
ENV FLASK_ENV=development
ENV PASSWORD=1qaz@WSX
# Instalujemy zależności
RUN pip install --no-cache-dir -r requirements.txt

# Instalujemy zależności oraz pytest do testów
RUN pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir pytest

# Uruchamiamy testy jednostkowe - w przypadku niepowodzenia build zakończy się błędem
RUN pytest tests/ -v --tb=short || exit 1

# Ustawiamy zmienną środowiskową, aby Flask wiedział, jak uruchomić aplikację
ENV FLASK_APP=app.py
Expand Down
Loading