mirror of https://github.com/tiangolo/fastapi.git
Add fix to scope propagation: Do not mutate incoming list.
This commit is contained in:
parent
b0115d0ab5
commit
f9cc73867e
|
|
@ -147,7 +147,7 @@ def get_sub_dependant(
|
|||
security_scopes = security_scopes or []
|
||||
if isinstance(depends, params.Security):
|
||||
dependency_scopes = depends.scopes
|
||||
security_scopes.extend(dependency_scopes)
|
||||
security_scopes = security_scopes + list(dependency_scopes)
|
||||
if isinstance(dependency, SecurityBase):
|
||||
use_scopes: List[str] = []
|
||||
if isinstance(dependency, (OAuth2, OpenIdConnect)):
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ def recursive_scopes(dep=Security(dep3, scopes=["scope3"])):
|
|||
client = TestClient(app)
|
||||
|
||||
|
||||
@pytest.mark.xfail()
|
||||
# issue https://github.com/tiangolo/fastapi/issues/5623
|
||||
def test_recursive_scopes(mocks):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue