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

Create VerifierSessionRequired middleware that expects a verifier to exist in session #323

Closed
5 tasks done
Tracked by #317
thekaveman opened this issue Mar 16, 2022 · 0 comments · Fixed by #333
Closed
5 tasks done
Tracked by #317
Assignees

Comments

@thekaveman
Copy link
Member

thekaveman commented Mar 16, 2022

Background

Once the session tracks the selected verifier in #321, we can make use of that infrastructure to put guards on certain view functions that require a verifier to be selected. The first step is to create a new middleware class that enforces the requirement.

This is similar to how the AgencySessionRequired and EligibileSessionRequired middleware are used.

Tasks

  • Create a new middleware class like VerifierSessionRequired inheriting from MiddlewareMixin, see the other *SessionRequired as examples
  • In process_request(), check session.verifier() for the request.
    • If None, raise an error to stop the request
    • Otherwise return None to allow the request to continue
  • Apply this middleware to the following views to enforce that a verifier is needed:
@thekaveman thekaveman added this to the Courtesy Cards milestone Mar 16, 2022
@thekaveman thekaveman moved this to This Sprint in Digital Services Mar 16, 2022
@thekaveman thekaveman moved this from This Sprint to Blocked in Digital Services Mar 16, 2022
@thekaveman thekaveman moved this from Blocked to This Sprint in Digital Services Mar 17, 2022
@thekaveman thekaveman self-assigned this Mar 18, 2022
@thekaveman thekaveman moved this from This Sprint to In Progress in Digital Services Mar 18, 2022
@thekaveman thekaveman moved this from In Progress to PR Open in Digital Services Mar 18, 2022
Repository owner moved this from PR Open to Done in Digital Services Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant