Browse Source

fix: type hinting get_security_scopes with typing List

using List from typing package, as python's list can't be subscriptable
in python 3.8
pull/13369/head
Joao-Pedro-P-Holanda 2 months ago
parent
commit
9513d48196
  1. 3
      tests/test_security_oauth2_scopes.py

3
tests/test_security_oauth2_scopes.py

@ -1,3 +1,4 @@
from typing import List
from fastapi import FastAPI, Security
from fastapi.params import Depends
from fastapi.security import OAuth2PasswordBearer
@ -14,7 +15,7 @@ oauth2_scheme = OAuth2PasswordBearer(
def get_security_scopes(
security_scopes: SecurityScopes, token=Depends(oauth2_scheme)
) -> list[str]:
) -> List[str]:
return security_scopes.scopes

Loading…
Cancel
Save