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

Jlc/nid pipeline #106

Merged
merged 1 commit into from
Nov 14, 2023
Merged

Jlc/nid pipeline #106

merged 1 commit into from
Nov 14, 2023

Conversation

johanseto
Copy link
Collaborator

Description

feat: add pipeline to match user with uid

This allow if the response send correct uid and there is a user
with username equal, this match that user with using that uid.

Additional information

Jira story?
https://edunext.atlassian.net/browse/FUTUREX-621

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@github-actions github-actions bot added test size/m m lines label labels Nov 10, 2023
@johanseto johanseto self-assigned this Nov 10, 2023
dict: Dict with user if matches, if not return None.
"""
if user:
return None
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should always return a dict, in this case that should be an empty dict since the pipeline logic will check the kind of instance

Copy link
Collaborator Author

@johanseto johanseto Nov 14, 2023

Choose a reason for hiding this comment

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

I was thinking about this and why other pipes work using None in the return.
https://github.com/eduNEXT/eox-tenant/blob/master/eox_tenant/pipeline.py#L25
https://github.com/python-social-auth/social-core/blob/master/social_core/pipeline/social_auth.py#L67

Then I found that there is an or-line that allow use None changing it to {}.
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Great, I didn't realize about that

eox_nelp/third_party_auth/pipeline.py Show resolved Hide resolved
eox_nelp/third_party_auth/pipeline.py Outdated Show resolved Hide resolved
eox_nelp/third_party_auth/tests/test_pipeline.py Outdated Show resolved Hide resolved
This allow if the response send correct uid and there is a user
with username equal, this match that user with using that uid.

feat: add tests for the pipe safer associate

This add tests for the pipe method `safer_associate_username_by_uid`

feat: separate exceptions file

Due pr recomendations is better to separate responsabilities of each file.
Exception file for tpa module created.

refactor: use ddt to check staff ^ superuser tests
@johanseto johanseto merged commit f9732ad into master Nov 14, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/m m lines label test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants