[java-shib-attribute] branch main updated: IDP-2057 - Support transcoders that derive SAML naming from metadata
Scott Cantor
cantor.2 at osu.edu
Tue Dec 12 16:10:47 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-shib-attribute.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=93ec69a3e3aa1a46b184028936a35b24cb05fb91
The following commit(s) were added to refs/heads/main by this push:
new 93ec69a3e IDP-2057 - Support transcoders that derive SAML naming from metadata
93ec69a3e is described below
commit 93ec69a3e3aa1a46b184028936a35b24cb05fb91
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Dec 12 11:10:44 2023 -0500
IDP-2057 - Support transcoders that derive SAML naming from metadata
https://shibboleth.atlassian.net/browse/IDP-2057
Tighten SAML 1 to ensure AttributeNamespace is set.
---
.../transcoding/AbstractSAML1AttributeTranscoder.java | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/shib-saml-attribute-api/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/AbstractSAML1AttributeTranscoder.java b/shib-saml-attribute-api/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/AbstractSAML1AttributeTranscoder.java
index c763f152e..92720b998 100644
--- a/shib-saml-attribute-api/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/AbstractSAML1AttributeTranscoder.java
+++ b/shib-saml-attribute-api/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/AbstractSAML1AttributeTranscoder.java
@@ -138,19 +138,16 @@ public abstract class AbstractSAML1AttributeTranscoder<EncodedType extends IdPAt
final int lastSpace = tagValue.lastIndexOf(' ');
final String name;
final String namespace;
- if (lastSpace < 0) {
- name = StringSupport.trimOrNull(tagValue);
- namespace = null;
- } else {
+ if (lastSpace > 0) {
name = StringSupport.trimOrNull(tagValue.substring(0, lastSpace));
namespace = StringSupport.trimOrNull(tagValue.substring(lastSpace));
- }
- if (name != null) {
- samlAttribute.setAttributeName(name);
- samlAttribute.setAttributeNamespace(namespace);
- log.debug("Encoding IdPAttribute {} via metadata tag as Name {}, Namespace {}", id,
- name, namespace);
- return;
+ if (name != null && namespace != null) {
+ samlAttribute.setAttributeName(name);
+ samlAttribute.setAttributeNamespace(namespace);
+ log.debug("Encoding IdPAttribute {} via metadata tag as Name {}, Namespace {}", id,
+ name, namespace);
+ return;
+ }
}
log.warn("Metadata tag {}, value {}, was not in the expected form", METADATA_TAG_NAME, tagValue);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list