3
3
"""
4
4
from datetime import datetime , time , timedelta , date
5
5
from functools import wraps , lru_cache
6
- from typing import Any , Callable , TypeVar , cast , Union , Literal , TypedDict
6
+ from typing import Any , Callable , TypeVar , cast
7
7
8
8
import requests
9
9
from flask import session , redirect
15
15
16
16
INTRO_REALM = 'https://sso.csh.rit.edu/auth/realms/intro'
17
17
18
- F = TypeVar ('F ' , bound = Callable )
18
+ WrappedFunc = TypeVar ('WrappedFunc ' , bound = Callable )
19
19
20
- def before_request (func : F ) -> F :
20
+ def before_request (func : WrappedFunc ) -> WrappedFunc :
21
21
"""
22
22
Credit to Liam Middlebrook and Ram Zallan
23
23
https://github.com/liam-middlebrook/gallery
@@ -45,7 +45,7 @@ def wrapped_function(*args: list, **kwargs: dict) -> Any:
45
45
kwargs ['info' ] = info
46
46
return func (* args , ** kwargs )
47
47
48
- return cast (F , wrapped_function )
48
+ return cast (WrappedFunc , wrapped_function )
49
49
50
50
51
51
@lru_cache (maxsize = 128 )
@@ -60,7 +60,7 @@ def is_freshman_on_floor(rit_username: str) -> bool:
60
60
return False
61
61
62
62
63
- def packet_auth (func : F ) -> F :
63
+ def packet_auth (func : WrappedFunc ) -> WrappedFunc :
64
64
"""
65
65
Decorator for easily configuring oidc
66
66
"""
@@ -76,10 +76,10 @@ def wrapped_function(*args: list, **kwargs: dict) -> Any:
76
76
77
77
return func (* args , ** kwargs )
78
78
79
- return cast (F , wrapped_function )
79
+ return cast (WrappedFunc , wrapped_function )
80
80
81
81
82
- def admin_auth (func : F ) -> F :
82
+ def admin_auth (func : WrappedFunc ) -> WrappedFunc :
83
83
"""
84
84
Decorator for easily configuring oidc
85
85
"""
@@ -98,7 +98,7 @@ def wrapped_function(*args: list, **kwargs: dict) -> Any:
98
98
99
99
return func (* args , ** kwargs )
100
100
101
- return cast (F , wrapped_function )
101
+ return cast (WrappedFunc , wrapped_function )
102
102
103
103
104
104
def notify_slack (name : str ) -> None :
0 commit comments