Coverage for benefits / oauth / urls.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-02-13 19:35 +0000

1from cdt_identity import views as cdt_identity_views 

2from cdt_identity.routes import Routes 

3from cdt_identity.urls import app_name as cdt_app_name 

4from django.urls import path 

5from django.utils.decorators import decorator_from_middleware 

6 

7from benefits.routes import routes 

8 

9from . import hooks, views 

10from .middleware import FlowUsesClaimsVerificationSessionRequired 

11 

12decorator = decorator_from_middleware(FlowUsesClaimsVerificationSessionRequired) 

13kwargs = {"hooks": hooks.OAuthHooks} 

14 

15# use cdt_identity app name so that the URL namespace matches what cdt_identity expects. 

16# (e.g. when cdt_identity reverses routes.) 

17app_name = cdt_app_name 

18urlpatterns = [ 

19 # /oauth 

20 path(Routes.login, decorator(cdt_identity_views.login), kwargs, name=Routes.login), 

21 path(Routes.authorize, decorator(cdt_identity_views.authorize), kwargs, name=Routes.authorize), 

22 path(Routes.cancel, decorator(cdt_identity_views.cancel), kwargs, name=Routes.cancel), 

23 path(Routes.logout, decorator(cdt_identity_views.logout), kwargs, name=Routes.logout), 

24 path(Routes.post_logout, decorator(cdt_identity_views.post_logout), kwargs, name=Routes.post_logout), 

25 path("error", views.SystemErrorView.as_view(), name=routes.name(routes.OAUTH_SYSTEM_ERROR)), 

26]