Lab3 Maciej Pietrewicz #57
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Zadanie 1
W pliku test_customers został przetestowany model Customer. Dodałem testy dotyczącę poprawnych jak i nie poprawnych danych. Sprawdziłem również podatność modelu na SQL lub JS injection. Ekstremalne testy również zostały dodane
Zadanie 2
Otrzymałem token
{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiQm9iIiwicm9sZSI6IlVzZXIiLCJpYXQiOjE3NjQ3MTU1MjAsImF1ZCI6Imh0dHBzOi8vMTI3LjAuMC4xL2p3dC9ub25lIn0.WEw2a9x0lonklPm_VJuQPUq_TnNgBI33oLqCZMgd7LM",
"endpoint": "https://127.0.0.1/jwt/none"
}
Można to zdekodować na
{
"alg": "HS256",
"typ": "JWT"
}
{
"account": "Bob",
"role": "User",
"iat": 1764715520,
"aud": "https://127.0.0.1/jwt/none"
}
Możemy tu zmodyfikować, account Administrator oraz alg none.
Po wysłaniu poprawionego JWT otrzymałem
{
"message": "Congrats!! You've solved the JWT challenge!!",
"jwt_token": {
"header": {
"alg": "none",
"typ": "JWT"
},
"payload": {
"account": "administrator",
"role": "User",
"iat": 1764715520,
"aud": "https://127.0.0.1/jwt/none"
},
"signature": ""
}
}
Zadanie 3
Trzeba pozbyć się pozycji none w JWT.verify