33"""
44from datetime import datetime , time , timedelta , date
55from functools import wraps , lru_cache
6- from typing import Any , Callable , TypeVar , cast , Union , Literal , TypedDict
6+ from typing import Any , Callable , TypeVar , cast
77
88import requests
99from flask import session , redirect
1515
1616INTRO_REALM = 'https://sso.csh.rit.edu/auth/realms/intro'
1717
18- F = TypeVar ('F ' , bound = Callable )
18+ WrappedFunc = TypeVar ('WrappedFunc ' , bound = Callable )
1919
20- def before_request (func : F ) -> F :
20+ def before_request (func : WrappedFunc ) -> WrappedFunc :
2121 """
2222 Credit to Liam Middlebrook and Ram Zallan
2323 https://github.com/liam-middlebrook/gallery
@@ -45,7 +45,7 @@ def wrapped_function(*args: list, **kwargs: dict) -> Any:
4545 kwargs ['info' ] = info
4646 return func (* args , ** kwargs )
4747
48- return cast (F , wrapped_function )
48+ return cast (WrappedFunc , wrapped_function )
4949
5050
5151@lru_cache (maxsize = 128 )
@@ -60,7 +60,7 @@ def is_freshman_on_floor(rit_username: str) -> bool:
6060 return False
6161
6262
63- def packet_auth (func : F ) -> F :
63+ def packet_auth (func : WrappedFunc ) -> WrappedFunc :
6464 """
6565 Decorator for easily configuring oidc
6666 """
@@ -76,10 +76,10 @@ def wrapped_function(*args: list, **kwargs: dict) -> Any:
7676
7777 return func (* args , ** kwargs )
7878
79- return cast (F , wrapped_function )
79+ return cast (WrappedFunc , wrapped_function )
8080
8181
82- def admin_auth (func : F ) -> F :
82+ def admin_auth (func : WrappedFunc ) -> WrappedFunc :
8383 """
8484 Decorator for easily configuring oidc
8585 """
@@ -98,7 +98,7 @@ def wrapped_function(*args: list, **kwargs: dict) -> Any:
9898
9999 return func (* args , ** kwargs )
100100
101- return cast (F , wrapped_function )
101+ return cast (WrappedFunc , wrapped_function )
102102
103103
104104def notify_slack (name : str ) -> None :
0 commit comments