Skip to content

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

Badatos and others added 30 commits October 24, 2024 12:10
* Upgrade securtity dependances
* Remove deprecated django-tagging
* Add new django-tagulous
* Elasticsearch default version is Now 8 (remove compatibility with ES 6)
* Replace deprecated ugettext_lazy by gettext_lazy
* Add some temporary deprecations Hacks for cas-client & Chunked-upload
* Replace deprecated url() by re_path()
* Disable all Pods apps by default
* Correct error handling for ElasticSearch
# Conflicts:
#	pod/settings.py
* Replace some re_path() by path()
* Replace remaining ugettext by gettext
* Replace admin.site.register() call by @admin.register decorator
* Replace HTTP_X_REQUESTED_WITH by `headers={"x-requested-with"`
* Replace request.META by headers
* Replace `assertQuerysetEqual` by `assertQuerySetEqual`
* Replace force_text by force_str
* Remove default_app_config in __init__.py
…select2 CSS calls)

* Correct Enrichment form validation process
* Replace Django 3.2 by 4.2 in all links
# Conflicts:
#	pod/settings.py
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Disable Shib Middleware tests as it seems deprecated
+ remove some ES deprecations
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

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

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

# Conflicts:
#	.github/workflows/pod_dev.yml
#	pod/authentication/tests/test_populated.py
#	pod/authentication/tests/test_views.py
#	pod/authentication/urls.py
#	pod/authentication/views.py
#	pod/settings.py
#	pod/urls.py
#	requirements.txt
@Badatos
Copy link
Collaborator

Badatos commented Mar 13, 2025

@FBrosset , si tu passes par là, peux-tu jeter un œil à cette PR stp ?

@FBrosset
Copy link
Collaborator Author

Salut Olivier
Je reviens sur le projet, j'ai été pas mal occupé ailleurs. Je regarde ce que tu as fait.

Base automatically changed from replace_cas to main April 8, 2025 13:51
@Badatos Badatos marked this pull request as draft April 23, 2025 12:16
@Badatos Badatos changed the base branch from main to dev_v4 July 21, 2025 08:37
@Badatos Badatos added this to the 4.x milestone Sep 12, 2025
Base automatically changed from dev_v4 to main November 10, 2025 11:03
@Badatos Badatos changed the base branch from main to dev_v4 November 12, 2025 08:41
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