Skip to content

Commit

Permalink
Load the encryption template using package resources
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
  • Loading branch information
c00kiemon5ter committed Jan 7, 2021
1 parent bdc3707 commit 17f4daf
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ install_requires =
pytz
requests >= 1.0.0
six
importlib_resources


[options.packages.find]
Expand Down
Empty file added src/saml2/data/__init__.py
Empty file.
Empty file.
File renamed without changes.
5 changes: 3 additions & 2 deletions src/saml2/sigver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import saml2.cryptography.asymmetric
import saml2.cryptography.pki
import saml2.xmldsig as ds
import saml2.data.templates as _data_template
from saml2 import samlp
from saml2 import SamlBase
from saml2 import SAMLError
Expand Down Expand Up @@ -1288,8 +1289,8 @@ def __init__(
self.only_use_keys_in_metadata = only_use_keys_in_metadata

if not template:
this_dir, this_filename = os.path.split(__file__)
self.template = os.path.join(this_dir, 'xml_template', 'template.xml')
with _resource_path(_data_template, "template_enc.xml") as fp:
self.template = str(fp)
else:
self.template = template

Expand Down

0 comments on commit 17f4daf

Please sign in to comment.