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

Updated version of FastAPI (migrate to Pydantic2 and others) #448

Merged
merged 7 commits into from
Apr 2, 2024

Conversation

loneil
Copy link
Contributor

@loneil loneil commented Mar 27, 2024

To cover FastAPI security updates (new versions of FastAPI use Pydantic 2) and future-proofing, need to update the oidc controller in VCAuthn to use Pydantic 2. Other minor FastAPI update tweaks required as well.

Some relevant Pydantic2 changes

Optional logic changed in Pydantic 2
https://docs.pydantic.dev/latest/migration/#required-optional-and-nullable-fields

Using ConfigDict instead of class based config
https://docs.pydantic.dev/latest/migration/#changes-to-config

Get validators is gone
https://docs.pydantic.dev/latest/migration/#defining-custom-types

Additionally needed minor tweak to the way the socket.io endpoint sets up as the mount to /ws stopped working in newer FastAPI (or python-socket) so defining the whole path in the socket app works now (explicitly set socketio_path).

@loneil loneil marked this pull request as ready for review March 28, 2024 15:34
Signed-off-by: Lucas ONeil <[email protected]>
@loneil loneil requested review from Gavinok, Jsyro and esune and removed request for Jsyro March 28, 2024 16:44
Copy link
Member

@esune esune left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

@loneil loneil merged commit c6f7b68 into main Apr 2, 2024
4 of 5 checks passed
@loneil loneil deleted the feature/pydantic2Update branch May 3, 2024 17:25
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