-
Notifications
You must be signed in to change notification settings - Fork 1
New site etu #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
New site etu #188
Conversation
Zalk0
commented
May 19, 2025
- add success template for role assignment
- WIP auth with new student website
- set server url in Dockerfile
- remove PR creation hourly limit
- fix UeCog not called
translate the comments in the file to french
also rename client id and client secret to application id and application secret respectively
f"{api_settings.url}/oauth/authorize" | ||
f"?client_id={api_settings.client_id}&response_type=code&state={req.app['api_state']}" | ||
f"{api_settings.url}/auth/signin" # Redirection sur le front du site étu | ||
# f"?client_id={api_settings.client_id}&response_type=code&state={req.app['api_state']}" # noqa: ERA001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pk tu retires pas juste la ligne, plutôt que de silencer ruff ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parce que j'ai pas du tout fini la PR et je me suis dit que j'avais peut-être encore besoin de cette ligne donc je l'ai laissé mais c'est prévu de la faire disparaître avant de merge
@@ -8,23 +7,24 @@ | |||
async def handler(req: web.Request) -> web.Response: | |||
# Unauthorized if not code in query string | |||
api_settings: ApiConfig = req.app["bot"].settings.etu_api | |||
if not req.query.get("code") or req.query.get("state") != req.app["api_state"]: | |||
if not (token := req.query.get("token")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le token est vraiment transmis dans les query params ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le client est censé revenir du site étu pour arriver sur cette page, hors le site étu crée l'URL de redirection qui est executée dans le navigateur de l'utilisateur donc on est obligé de la faire en GET
) as response: | ||
if response.status != 200: | ||
return web.Response(status=response.status) | ||
try: | ||
resp = (await response.json()).get("data") | ||
resp = await response.json() | ||
api_user = ApiUserSchema.model_validate(resp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vu le DTO de détails utilisateur, cette validation ne devrait plus passer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui mais déjà j'essayais d'arriver à avoir une réponse de l'API qui ne me dit pas que je ne suis pas autorisé 😭
J'ai enfin réussi, mais maintenant il va falloir que j'attende qu'ils remodifient l'API car ils vont modifier les routes utilisateurs et UE...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ayaya. Bah écoute, je repasserai plus tard
Don't know where to go for home route yet