REGEX invalide d'un token
Un token contenant l'URL de ressource invalide cause une erreur 500 lorsqu'il est soumis.
Reproduire :
Demander un token contenant une regex invalide (ici, *
)
curl -X POST -H "Content-Type: application/json" --data '{"identifiant": "toto1", "password": "", "data": {"ressources": [{"url":"*", "method":"*"}], "expiration": 0}}' http://ordralphabetix.dti.crosemont.quebec:9000/user/toto1/tokens
Soumettre une requête avec ce token :
curl -X GET -H "Content-Type: application/json" -H "Authorization: bearer $token" http://ordralphabetix.dti.crosemont.quebec:9000/user/toto1
Résultat attendu : réponse avec code 401
Résultat obtenu :
[2023-08-28 13:35:42] local.ERROR: Exception. {"exception":"[object] (ErrorException(code: 0): preg_match(): Compilation failed: quantifier does not follow a repeatable item at offset 0 at /var/www/progression/app/progression/providers/AuthServiceProvider.php:204)