Merge pull request #331 from rebeckag/policy-compile
Use deepcopy to avoid modifying external data.
This commit is contained in:
@@ -1,20 +1,19 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import copy
|
||||||
import importlib
|
import importlib
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from saml2.saml import NAME_FORMAT_URI
|
|
||||||
import six
|
import six
|
||||||
from saml2 import xmlenc
|
|
||||||
|
|
||||||
from saml2 import saml
|
from saml2 import saml
|
||||||
|
from saml2 import xmlenc
|
||||||
from saml2.time_util import instant, in_a_while
|
|
||||||
from saml2.attribute_converter import from_local, get_local_name
|
from saml2.attribute_converter import from_local, get_local_name
|
||||||
from saml2.s_utils import sid, MissingValue
|
|
||||||
from saml2.s_utils import factory
|
|
||||||
from saml2.s_utils import assertion_factory
|
from saml2.s_utils import assertion_factory
|
||||||
|
from saml2.s_utils import factory
|
||||||
|
from saml2.s_utils import sid, MissingValue
|
||||||
|
from saml2.saml import NAME_FORMAT_URI
|
||||||
|
from saml2.time_util import instant, in_a_while
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -319,7 +318,7 @@ class Policy(object):
|
|||||||
a compiled regular expression.
|
a compiled regular expression.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._restrictions = restrictions.copy()
|
self._restrictions = copy.deepcopy(restrictions)
|
||||||
|
|
||||||
for who, spec in self._restrictions.items():
|
for who, spec in self._restrictions.items():
|
||||||
if spec is None:
|
if spec is None:
|
||||||
|
Reference in New Issue
Block a user