Move and modernize X509AuthMiddleware.

Review Request #9998 — Created June 4, 2018 and submitted

Information

Review Board
release-3.0.x
564ca1b...

Reviewers

X509AuthMiddleware is an old piece of code designed to authenticate
users using X.509 certificates. It was living in
reviewboard.admin.middleware, rather than
reviewboard.accounts.middleware, had some unnecessary checks, and
determined whether to process based on logic that the account backend
split is going to break. That last reason is why this change is being
made.

This change fixes all that up, simplifying the code, moving it under
reviewboard.accounts, and determining the auth backend through safer
means. It also adds unit tests to ensure that authentication only
happens under the proper circumstances.

Unit tests pass.

Description From Last Updated

F401 'djblets.registries.errors.RegistrationError' imported but unused

reviewbotreviewbot

F401 'reviewboard.accounts.forms.pages.AccountPageForm' imported but unused

reviewbotreviewbot

F401 'reviewboard.accounts.pages.AccountPage' imported but unused

reviewbotreviewbot

F401 'reviewboard.accounts.pages.unregister_account_page_class' imported but unused

reviewbotreviewbot

F401 'reviewboard.accounts.pages.register_account_page_class' imported but unused

reviewbotreviewbot

F401 'reviewboard.accounts.pages.get_page_classes' imported but unused

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (6bdd959)