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 keycloak#22593
  • Loading branch information
fjuma authored and pedroigor committed Aug 22, 2023
1 parent a7c2fd8 commit 8617857
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 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.getAttributeMarshaller().marshallAsAttribute(attr, 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.getAttributeMarshaller().marshallAsAttribute(attr, 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.getAttributeMarshaller().marshallAsAttribute(attr, 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.getAttributeMarshaller().marshallAsAttribute(attr, 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.getAttributeMarshaller().marshallAsAttribute(attr, keyAttributes, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, keyAttributes, false, writer);
}
for (SimpleAttributeDefinition attr : KeyDefinition.ELEMENTS) {
attr.getAttributeMarshaller().marshallAsElement(attr, 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.getAttributeMarshaller().marshallAsAttribute(AllowedClockSkew.ALLOWED_CLOCK_SKEW_UNIT, 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.getAttributeMarshaller().marshallAsAttribute(attr, 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.getAttributeMarshaller().marshallAsAttribute(attr, 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.getAttributeMarshaller().marshallAsAttribute(attr, model, false, writer);
attr.getMarshaller().marshallAsAttribute(attr, model, false, writer);
}
writer.writeEndElement();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<packaging>pom</packaging>

<properties>
<wildfly.version>27.0.0.Final</wildfly.version>
<wildfly.version>29.0.0.Final</wildfly.version>
<wildfly.build-tools.version>1.2.13.Final</wildfly.build-tools.version>
<wildfly.core.version>19.0.0.Final</wildfly.core.version>
<wildfly.core.version>21.1.0.Final</wildfly.core.version>

<feature-pack.resources.directory>${basedir}/../../saml-adapters/wildfly-adapter/wildfly-jakarta-modules/src/main/resources</feature-pack.resources.directory>
<version.org.wildfly.galleon-plugins>6.4.0.Final</version.org.wildfly.galleon-plugins>
Expand Down Expand Up @@ -261,4 +261,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,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 8617857

Please sign in to comment.