Skip to content

Commit c86c9c2

Browse files
fix: metadata_creation: for SAML backend, use sp.config to render metadata
... because SAMLBackend modifies the config (adding encryption_keypairs to config) and this modified config is stored under sp.config. Otherwise, metadata created via the metadata-creation scripts (satosa-saml-metadata) would be missing encryption keys (KeyDescriptor use="encryption").
1 parent 58f9381 commit c86c9c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/satosa/metadata_creation/saml_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
def _create_entity_descriptor(entity_config):
20-
cnf = Config().load(copy.deepcopy(entity_config))
20+
cnf = entity_config if isinstance(entity_config, Config) else Config().load(copy.deepcopy(entity_config))
2121
return entity_descriptor(cnf)
2222

2323

@@ -28,7 +28,7 @@ def _create_backend_metadata(backend_modules):
2828
if isinstance(plugin_module, SAMLBackend):
2929
logline = "Generating SAML backend '{}' metadata".format(plugin_module.name)
3030
logger.info(logline)
31-
backend_metadata[plugin_module.name] = [_create_entity_descriptor(plugin_module.config["sp_config"])]
31+
backend_metadata[plugin_module.name] = [_create_entity_descriptor(plugin_module.sp.config)]
3232

3333
return backend_metadata
3434

0 commit comments

Comments
 (0)