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

Fix GitLab OpenID instance as it breaks with latest pydantic #143

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

chrisK824
Copy link
Contributor

Latest versions of Pydantic reject objects that are not created with their values aligned to their hints.

This results in GitLab SSO breaking when trying to form the OpenID object, as the response from GitLab comes with an int for the 'id' field while OpenID pydantic model expects a string.

Fix is simple and easy with just casting the field to string when creating the object in openid_from_response of GitlabSSO class.

Latest versions of Pydantic reject objects that are not created with their values aligned to their hints.

This results in GitLab SSO breaking when trying to form the OpenID object, as the response from GitLab comes with an int for the 'id' field while OpenID pydantic model expects a string.

Fix is simple and easy with just casting the field to string when creating the object in openid_from_response of GitlabSSO class.
@chrisK824
Copy link
Contributor Author

@tomasvotava ^^

@tomasvotava
Copy link
Owner

@chrisK824 hi! Thanks for the PR, I'll merge and release straight away.

@tomasvotava tomasvotava merged commit 4d16468 into tomasvotava:master Apr 1, 2024
12 checks passed
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Merging #143 (75b8440) into master (736db8e) will not change coverage.
Report is 2 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #143   +/-   ##
=======================================
  Coverage   94.27%   94.27%           
=======================================
  Files          19       19           
  Lines         437      437           
=======================================
  Hits          412      412           
  Misses         25       25           
Files Coverage Δ
fastapi_sso/sso/gitlab.py 100.00% <ø> (ø)

@tomasvotava
Copy link
Owner

@chrisK824 released as 0.13.1

@chrisK824
Copy link
Contributor Author

Awesome @tomasvotava ! Thanks!

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