Skip to content
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

Update backends.py #1259

Open
wants to merge 9 commits into
base: replace_cas
Choose a base branch
from
Open

Update backends.py #1259

wants to merge 9 commits into from

Conversation

FBrosset
Copy link
Collaborator

@FBrosset FBrosset commented Feb 3, 2025

Affectation automatique des utilisateurs dans un accessgroup pour une authentification OIDC

Before sending your pull request, make sure the following are done

  • You have read our contribution guidelines.
  • Your PR targets the develop branch.
  • The title of your PR starts with [WIP] or [DONE].

Affectation automatique des utilisateurs dans un accessgroup pour une authentification OIDC
Copy link
Collaborator

@Badatos Badatos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonjour Fred, Merci pour cette PR ;)
Est-ce que tu peux ajouter une explication dans le configuration.json sur nouveau paramètre OIDC_CLAIM_AFFILIATIONstp ?

@Badatos
Copy link
Collaborator

Badatos commented Feb 3, 2025

... et au passage, si tu peux ajouter un test unitaire qui s'assure que ce parametre fait bien son job stp ?

Ajout du paramètre OIDC_CLAIM_AFFILIATION permettant de récupérer les affiliations
Ajout du paramètre OIDC_CLAIM_AFFILIATION pour récupérer les affiliations
Ajout du paramètre OIDC_CLAIM_AFFILIATION
@FBrosset
Copy link
Collaborator Author

FBrosset commented Feb 3, 2025

Désolé mais c'est bon j'ai modifié le fichier configuration.json.
Par contre explique-moi où sont et comment faire les tests unitaires s'il te plaît

pod/main/configuration.json Outdated Show resolved Hide resolved
@Badatos
Copy link
Collaborator

Badatos commented Feb 3, 2025

Désolé mais c'est bon j'ai modifié le fichier configuration.json. Par contre explique-moi où sont et comment faire les tests unitaires s'il te plaît

Merci ;)

Pour les tests, ca se passe dans le dossier "tests" de l'appli à tester.
En l'occurence, pod/authentication/tests

Pour l'OIDC, je dirais qu'il faut ajouter une fonction dans la classe "PopulatedOIDCTestCase" de test_populated.py

Ajout test test_OIDC_user_with_multiple_claim_access_groups pour tester l'affectation multiple d'un utilisateur à des accessgroup contenu dans un "claim" OIDC
pod/authentication/tests/test_populated.py Show resolved Hide resolved
OIDC_OP_TOKEN_ENDPOINT="https://auth.server.com/oauth/token",
OIDC_OP_USER_ENDPOINT="https://auth.server.com/oauth/userinfo",
OIDC_DEFAULT_ACCESS_GROUP_CODE_NAMES=["specific"],
)
def test_OIDC_user_with_default_access_group(self) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attention, ici tu as perdu l'info OIDC_DEFAULT_ACCESS_GROUP_CODE_NAMES=["specific"] c'est voulu ?

pod/authentication/tests/test_populated.py Outdated Show resolved Hide resolved
pod/authentication/tests/test_populated.py Outdated Show resolved Hide resolved
@Badatos
Copy link
Collaborator

Badatos commented Feb 5, 2025

Hello Fred !
J'ai poussé une modif qui corrige les tests unitaires pour que ca passe.
J'ai du ajouter la vérification que désormais l'utilisateur a bien été assigné à un groupe "OIDC_DEFAULT_AFFILIATION".
(Ce qui n'était visiblement pas le cas avant)
Si ce n'est pas voulu, il faudra changer ce comportement dans le backend.

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.

2 participants