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

Parametrize callback views #105

Merged
merged 4 commits into from
May 24, 2024

Conversation

sergei-maertens
Copy link
Member

Closes #99

This is the last bit for the view/backend aspect, the refresh middleware will need to be tackled in another phase as that one seems trickier.

I noticed in Open Forms that I was struggling to implement the error handling during the callback view, there are essentially 3 possible flows (admin login, org-oid and digid/eh oidc) where the latter two are similar but not the same. The code organization for this is pretty nasty since those auth plugins should be decoupled from each other.

This view rework solves that - it allows us to use a single (!) callback endpoint while customizing the behaviour at the view level. The config class is used to route/invoke the desired view callable.

Different configurations may come with different requirements, for
example our own concrete model is intended for the admin, so the
callback view should only redirect to the admin failure URL when that
config is applied.

The config class can now provide a view function/callable to use, and
custom views can easily be subclassed from our base view.

TODO: documentation
@sergei-maertens sergei-maertens requested a review from stevenbal May 24, 2024 07:48
@sergei-maertens sergei-maertens force-pushed the feature/99-parametrized-callback-view branch from a363b91 to 6cc0e61 Compare May 24, 2024 08:49
Copy link
Collaborator

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

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

Looks good, just minor docs stuff 👍

docs/architecture.rst Outdated Show resolved Hide resolved
docs/architecture.rst Outdated Show resolved Hide resolved
@sergei-maertens sergei-maertens force-pushed the feature/99-parametrized-callback-view branch from 6cc0e61 to b844327 Compare May 24, 2024 12:42
@sergei-maertens sergei-maertens merged commit a7189eb into master May 24, 2024
7 checks passed
@sergei-maertens sergei-maertens deleted the feature/99-parametrized-callback-view branch May 24, 2024 12:51
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.

Rework: implement generic OIDCInit and Callback view classes
2 participants