Skip to content

Commit

Permalink
Add fix to scope propagation: Do not mutate incoming list.
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Nov 11, 2022
1 parent df55372 commit 2e47883
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion fastapi/dependencies/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down
1 change: 0 additions & 1 deletion tests/test_dependency_scopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 2e47883

Please sign in to comment.