Skip to content

Commit

Permalink
Update the Keycloak SAML adapter subsystem to no longer use the Attri…
Browse files Browse the repository at this point in the history
…buteDefinition#getAttributeMarshaller method

Closes #22593

Signed-off-by: Peter Skopek <pskopek@redhat.com>
(cherry picked from commit ec08a7b)
  • Loading branch information
fjuma authored and ahus1 committed Sep 7, 2023
1 parent caafd65 commit 4481b1b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
5 changes: 5 additions & 0 deletions adapters/saml/wildfly/wildfly-jakarta-subsystem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-subsystem-test-framework</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions adapters/saml/wildfly/wildfly-subsystem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-subsystem-test-framework</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void writeSps(final XMLExtendedStreamWriter writer, final ModelNode model) throw
writer.writeAttribute(Constants.XML.ENTITY_ID, sp.getName());
ModelNode spAttributes = sp.getValue();
for (SimpleAttributeDefinition attr : ServiceProviderDefinition.ATTRIBUTES) {
attr.marshallAsAttribute(spAttributes, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, spAttributes, false, writer);
}
writeKeys(writer, spAttributes.get(Constants.Model.KEY));
writePrincipalNameMapping(writer, spAttributes);
Expand All @@ -521,7 +521,7 @@ void writeIdentityProvider(XMLExtendedStreamWriter writer, ModelNode model) thro

ModelNode idpAttributes = idp.getValue();
for (SimpleAttributeDefinition attr : IdentityProviderDefinition.ATTRIBUTES) {
attr.marshallAsAttribute(idpAttributes, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, idpAttributes, false, writer);
}

writeSingleSignOn(writer, idpAttributes.get(Constants.Model.SINGLE_SIGN_ON));
Expand All @@ -539,7 +539,7 @@ void writeSingleSignOn(XMLExtendedStreamWriter writer, ModelNode model) throws X
}
writer.writeStartElement(Constants.XML.SINGLE_SIGN_ON);
for (SimpleAttributeDefinition attr : SingleSignOnDefinition.ATTRIBUTES) {
attr.marshallAsAttribute(model, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, model, false, writer);
}
writer.writeEndElement();
}
Expand All @@ -550,7 +550,7 @@ void writeSingleLogout(XMLExtendedStreamWriter writer, ModelNode model) throws X
}
writer.writeStartElement(Constants.XML.SINGLE_LOGOUT);
for (SimpleAttributeDefinition attr : SingleLogoutDefinition.ATTRIBUTES) {
attr.marshallAsAttribute(model, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, model, false, writer);
}
writer.writeEndElement();
}
Expand All @@ -569,10 +569,10 @@ void writeKeys(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStream

ModelNode keyAttributes = key.getValue();
for (SimpleAttributeDefinition attr : KeyDefinition.ATTRIBUTES) {
attr.marshallAsAttribute(keyAttributes, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, keyAttributes, false, writer);
}
for (SimpleAttributeDefinition attr : KeyDefinition.ELEMENTS) {
attr.marshallAsElement(keyAttributes, false, writer);
attr.getMarshaller().marshallAsElement(attr, keyAttributes, false, writer);
}
writeKeyStore(writer, keyAttributes.get(Constants.Model.KEY_STORE));

Expand All @@ -599,7 +599,7 @@ void writeAllowedClockSkew(XMLExtendedStreamWriter writer, ModelNode allowedCloc
return;
}
writer.writeStartElement(Constants.XML.ALLOWED_CLOCK_SKEW);
AllowedClockSkew.ALLOWED_CLOCK_SKEW_UNIT.marshallAsAttribute(allowedClockSkew, false, writer);
AllowedClockSkew.ALLOWED_CLOCK_SKEW_UNIT.getMarshaller().marshallAsAttribute(AllowedClockSkew.ALLOWED_CLOCK_SKEW_UNIT, allowedClockSkew, false, writer);
ModelNode allowedClockSkewValue = allowedClockSkew.get(Constants.Model.ALLOWED_CLOCK_SKEW_VALUE);
char[] chars = allowedClockSkewValue.asString().toCharArray();
writer.writeCharacters(chars, 0, chars.length);
Expand All @@ -612,7 +612,7 @@ void writeKeyStore(XMLExtendedStreamWriter writer, ModelNode model) throws XMLSt
}
writer.writeStartElement(Constants.XML.KEY_STORE);
for (SimpleAttributeDefinition attr : KeyStoreDefinition.ATTRIBUTES) {
attr.marshallAsAttribute(model, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, model, false, writer);
}
writePrivateKey(writer, model);
writeCertificate(writer, model);
Expand All @@ -626,7 +626,7 @@ void writeCertificate(XMLExtendedStreamWriter writer, ModelNode model) throws XM
}
writer.writeStartElement(Constants.XML.CERTIFICATE);
SimpleAttributeDefinition attr = KeyStoreCertificateDefinition.CERTIFICATE_ALIAS;
attr.marshallAsAttribute(model, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, model, false, writer);
writer.writeEndElement();
}

Expand All @@ -639,7 +639,7 @@ void writePrivateKey(XMLExtendedStreamWriter writer, ModelNode model) throws XML
}
writer.writeStartElement(Constants.XML.PRIVATE_KEY);
for (SimpleAttributeDefinition attr : KeyStorePrivateKeyDefinition.ATTRIBUTES) {
attr.marshallAsAttribute(model, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, model, false, writer);
}
writer.writeEndElement();
}
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,12 @@
<artifactId>httpclient</artifactId>
<version>${apache.httpcomponents.version}</version>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<version>${wildfly.common.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-controller</artifactId>
Expand Down

0 comments on commit 4481b1b

Please sign in to comment.