Traduction française complète + courriel de divulgation responsable

- README, PROTOCOL, FINDINGS, endpoints, rapport et outils traduits en français
- docs/DISCLOSURE.md : courriel prêt à envoyer à hello@boti.education
  (compte démo codé en dur, transmission en clair, logging de production)
- extract_endpoints.py vérifié après traduction (100 points d'accès toujours extraits)
This commit is contained in:
2026-09-01 17:29:25 +01:00
parent 358027bf27
commit b6f22ad7c1
8 changed files with 329 additions and 224 deletions
+16 -14
View File
@@ -1,11 +1,13 @@
#!/usr/bin/env bash
# Log in to a Boti Education school API (Green Wood School variant) and cache the session token.
# Credentials are read from boti.ini in $XDG_CONFIG_HOME (default ~/.config), never hard-coded.
# Connexion à l'API Boti Education d'une école (variante Green Wood School)
# et mise en cache de la clé de session.
# Les identifiants sont lus dans boti.ini de $XDG_CONFIG_HOME (~/.config par
# défaut), jamais codés en dur.
#
# boti.ini format:
# Format de boti.ini :
# [boti]
# login = 0600000000
# password = whatever
# password = motdepasse
#
set -euo pipefail
@@ -14,31 +16,31 @@ CONF="${XDG_CONFIG_HOME:-$HOME/.config}/boti.ini"
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/boti-key"
if [[ ! -f "$CONF" ]]; then
echo "missing $CONF (see header of this script for format)" >&2
echo "fichier $CONF manquant (format : voir l'en-tête de ce script)" >&2
exit 1
fi
login=$(awk -F= '/^login/{gsub(/[[:space:]]/,"",$2); print $2}' "$CONF")
password=$(awk -F= '/^password/{gsub(/[[:space:]]/,"",$2); print $2}' "$CONF")
resp=$(curl -sS -m 20 "$BASE/login" \
reponse=$(curl -sS -m 20 "$BASE/login" \
-F "login=$login" \
-F "password=$password" \
-F "privacy=true" \
-F "remembreMe=false")
if ! grep -q '"error":false' <<<"$resp"; then
echo "login failed: $(head -c 200 <<<"$resp")" >&2
if ! grep -q '"error":false' <<<"$reponse"; then
echo "échec de connexion : $(head -c 200 <<<"$reponse")" >&2
exit 1
fi
key=$(sed -n 's/.*"keyToken":"\([0-9a-f]*\)".*/\1/p' <<<"$resp")
if [[ -z "$key" ]]; then
echo "no keyToken in response" >&2
cle=$(sed -n 's/.*"keyToken":"\([0-9a-f]*\)".*/\1/p' <<<"$reponse")
if [[ -z "$cle" ]]; then
echo "keyToken absent de la réponse" >&2
exit 1
fi
umask 077
printf '%s' "$key" > "$CACHE"
echo "session key cached at $CACHE (40 hex chars)"
echo "usage: curl \"$BASE/<endpoint>?user_id=<userId>&key=$(cat "$CACHE")\""
printf '%s' "$cle" > "$CACHE"
echo "clé de session enregistrée dans $CACHE (40 caractères hex)"
echo "usage : curl \"$BASE/<endpoint>?user_id=<userId>&key=$(cat "$CACHE")\""