rules: don't change passed-in argument

make a local copy of the scopes dict
This commit is contained in:
Willi Ballenthin
2023-08-11 10:35:40 +00:00
committed by GitHub
parent e100a63cc8
commit 3c069a6784

View File

@@ -137,6 +137,10 @@ class Scopes:
@classmethod
def from_dict(self, scopes: dict) -> "Scopes":
assert isinstance(scopes, dict)
# make local copy so we don't make changes outside of this routine
scopes = dict(scopes)
# mark non-specified scopes as invalid
if "static" not in scopes:
scopes["static"] = None