Skip to content

Commit 5661d8c

Browse files
author
Roland Hedberg
committed
Merge pull request #331 from rebeckag/policy-compile
Use deepcopy to avoid modifying external data.
2 parents b0f11a4 + 7f03589 commit 5661d8c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/saml2/assertion.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3+
import copy
34
import importlib
45
import logging
5-
66
import re
7-
from saml2.saml import NAME_FORMAT_URI
87
import six
9-
from saml2 import xmlenc
108

119
from saml2 import saml
12-
13-
from saml2.time_util import instant, in_a_while
10+
from saml2 import xmlenc
1411
from saml2.attribute_converter import from_local, get_local_name
15-
from saml2.s_utils import sid, MissingValue
16-
from saml2.s_utils import factory
1712
from saml2.s_utils import assertion_factory
13+
from saml2.s_utils import factory
14+
from saml2.s_utils import sid, MissingValue
15+
from saml2.saml import NAME_FORMAT_URI
16+
from saml2.time_util import instant, in_a_while
1817

1918
logger = logging.getLogger(__name__)
2019

@@ -319,7 +318,7 @@ def compile(self, restrictions):
319318
a compiled regular expression.
320319
"""
321320

322-
self._restrictions = restrictions.copy()
321+
self._restrictions = copy.deepcopy(restrictions)
323322

324323
for who, spec in self._restrictions.items():
325324
if spec is None:

0 commit comments

Comments
 (0)