Skip to content

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

New site etu #188

wants to merge 6 commits into from

Conversation

Zalk0
Copy link
Collaborator

@Zalk0 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

@Zalk0 Zalk0 marked this pull request as draft May 19, 2025 15:45
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
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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")):
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

@Zalk0 Zalk0 May 19, 2025

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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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...

Copy link
Collaborator

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants