Skip to content

Commit

Permalink
v1.1.4 (#84)
Browse files Browse the repository at this point in the history
globally configurable parameters:

- added settings.SAML2_ENTITY_ID
- added settings.SPID_ATTR_MAP_DIR
  • Loading branch information
Giuseppe De Marco authored Sep 8, 2021
1 parent 119c0b4 commit 43998c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="djangosaml2-spid",
version='1.1.3',
version='1.1.4',
description="Djangosaml2 SPID Service Provider",
long_description=README,
long_description_content_type='text/markdown',
Expand Down
14 changes: 10 additions & 4 deletions src/djangosaml2_spid/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@
},
)

settings.SPID_ATTR_MAP_DIR = getattr(
settings,
"SPID_ATTR_MAP_DIR",
os.path.join(
djangosaml2_spid_config.path, "attribute_maps/"
)
)

# Attributes that this project need to identify a user
settings.SPID_REQUIRED_ATTRIBUTES = getattr(
settings,
Expand Down Expand Up @@ -282,10 +290,8 @@ def config_settings_loader(request: Optional[HttpRequest] = None) -> SPConfig:
_OPTIONAL_ATTRIBUTES = []

saml_config = {
"entityid": metadata_url,
"attribute_map_dir": os.path.join(
djangosaml2_spid_config.path, "attribute_maps/"
),
"entityid": getattr(settings, 'SAML2_ENTITY_ID', metadata_url),
"attribute_map_dir": settings.SPID_ATTR_MAP_DIR,
"service": {
"sp": {
"name": metadata_url,
Expand Down

0 comments on commit 43998c9

Please sign in to comment.