We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0f22d8 commit 0df0bc2Copy full SHA for 0df0bc2
1 file changed
3-PB/documentidiprogetto/specificatecnica_1.0.0.typ
@@ -778,12 +778,19 @@ L'utilizzo del _decorator_ ha consentito di separare la logica di autenticazione
778
==== Implementazione ed esempio di utilizzo
779
#codly(header: [utils/protected.py])
780
```py
781
+from collections.abc import Callable
782
from functools import wraps
783
from utils.jwtUtils import verifyJwt
784
from flask import request, g, redirect
785
import logging
786
+from typing import Protocol
787
logger = logging.getLogger(__name__)
-class ProtectedDecorator:
788
+
789
+class ProtectedDecoratorInterface(Protocol):
790
+ def __call__(self, f: Callable) -> Callable:
791
+ ...
792
793
+class ProtectedDecorator(ProtectedDecoratorInterface):
794
def __call__(self, f):
795
@wraps(f)
796
def decorated_function(*args, **kwargs):
0 commit comments