Skip to content

Commit 0df0bc2

Browse files
hotfix2
1 parent f0f22d8 commit 0df0bc2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

3-PB/documentidiprogetto/specificatecnica_1.0.0.typ

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,12 +778,19 @@ L'utilizzo del _decorator_ ha consentito di separare la logica di autenticazione
778778
==== Implementazione ed esempio di utilizzo
779779
#codly(header: [utils/protected.py])
780780
```py
781+
from collections.abc import Callable
781782
from functools import wraps
782783
from utils.jwtUtils import verifyJwt
783784
from flask import request, g, redirect
784785
import logging
786+
from typing import Protocol
785787
logger = logging.getLogger(__name__)
786-
class ProtectedDecorator:
788+
789+
class ProtectedDecoratorInterface(Protocol):
790+
def __call__(self, f: Callable) -> Callable:
791+
...
792+
793+
class ProtectedDecorator(ProtectedDecoratorInterface):
787794
def __call__(self, f):
788795
@wraps(f)
789796
def decorated_function(*args, **kwargs):

0 commit comments

Comments
 (0)