Skip to content

Commit

Permalink
[squash] change to preview:2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PrarthonaPaul committed Mar 22, 2024
1 parent 7426070 commit 46c84b9
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 14 deletions.
Expand Up @@ -16,7 +16,7 @@
enum ElytronOidcClientSubsystemModel implements SubsystemModel {
VERSION_1_0_0(1, 0, 0),
VERSION_2_0_0(2, 0, 0),
VERSION_3_0_0(3, 0, 0),
VERSION_3_0_0(2, 0, 0),
;
static final ElytronOidcClientSubsystemModel CURRENT = VERSION_3_0_0;

Expand Down
Expand Up @@ -57,6 +57,6 @@ public void initialize(ExtensionContext context) {
public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, ElytronOidcSubsystemSchema.VERSION_1_0.getNamespace().toString(), ElytronOidcSubsystemSchema.VERSION_1_0);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, ElytronOidcSubsystemSchema.VERSION_2_0.getNamespace().toString(), ElytronOidcSubsystemSchema.VERSION_2_0);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, ElytronOidcSubsystemSchema.VERSION_3_0_COMMUNITY.getNamespace().toString(), ElytronOidcSubsystemSchema.VERSION_3_0_COMMUNITY);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, ElytronOidcSubsystemSchema.VERSION_2_0_PREVIEW.getNamespace().toString(), ElytronOidcSubsystemSchema.VERSION_2_0_PREVIEW);
}
}
Expand Up @@ -39,10 +39,10 @@
public enum ElytronOidcSubsystemSchema implements PersistentSubsystemSchema<ElytronOidcSubsystemSchema> {
VERSION_1_0(1, Stability.DEFAULT),
VERSION_2_0(2, Stability.DEFAULT),
VERSION_3_0_COMMUNITY(3, 0, Stability.COMMUNITY),
VERSION_2_0_PREVIEW(2, 0, Stability.PREVIEW),
;

static final Map<Stability, ElytronOidcSubsystemSchema> CURRENT = Feature.map(EnumSet.of(VERSION_3_0_COMMUNITY, VERSION_2_0));
static final Map<Stability, ElytronOidcSubsystemSchema> CURRENT = Feature.map(EnumSet.of(VERSION_2_0_PREVIEW, VERSION_2_0));

private final VersionedNamespace<IntVersion, ElytronOidcSubsystemSchema> namespace;

Expand Down
Expand Up @@ -43,7 +43,6 @@ private static void from2(ChainedTransformationDescriptionBuilder chainedBuilder
ResourceTransformationDescriptionBuilder builder = chainedBuilder.createBuilder(VERSION_2_0_0.getVersion(), VERSION_1_0_0.getVersion());
builder.rejectChildResource(PathElement.pathElement(SECURE_SERVER));
}

private static void from3(ChainedTransformationDescriptionBuilder chainedBuilder) {
ResourceTransformationDescriptionBuilder builder = chainedBuilder.createBuilder(VERSION_3_0_0.getVersion(), VERSION_2_0_0.getVersion());
builder.addChildResource(PathElement.pathElement(SECURE_SERVER))
Expand Down
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wildfly:elytron-oidc-client:community:3.0"
xmlns="urn:wildfly:elytron-oidc-client:community:3.0"
targetNamespace="urn:wildfly:elytron-oidc-client:preview:2.0"
xmlns="urn:wildfly:elytron-oidc-client:preview:2.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="1.0">
Expand Down
Expand Up @@ -15,6 +15,7 @@
import org.jboss.as.subsystem.test.AbstractSubsystemTest;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.KernelServices;
import org.jboss.as.version.Stability;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -42,14 +43,19 @@ public ExpressionsTestCase(ElytronOidcSubsystemSchema schema) {
public void testExpressions() throws Throwable {
if (services != null) return;
String subsystemXml = "oidc-expressions.xml";
services = super.createKernelServicesBuilder(new DefaultInitializer()).setSubsystemXmlResource(subsystemXml).build();
services = super.createKernelServicesBuilder(new DefaultInitializer(Stability.PREVIEW)).setSubsystemXmlResource(subsystemXml).build();
if (! services.isSuccessfulBoot()) {
Assert.fail(services.getBootError().toString());
}
}

private static class DefaultInitializer extends AdditionalInitialization {
protected static class DefaultInitializer extends AdditionalInitialization {

private final Stability stability;

public DefaultInitializer(Stability stability) {
this.stability = stability;
}
@Override
protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegistry, Resource rootResource, ManagementResourceRegistration rootRegistration, RuntimeCapabilityRegistry capabilityRegistry) {
super.initializeExtraSubystemsAndModel(extensionRegistry, rootResource, rootRegistration, capabilityRegistry);
Expand All @@ -61,6 +67,11 @@ protected RunningMode getRunningMode() {
return RunningMode.NORMAL;
}

@Override
public Stability getStability() {
return stability;
}

}

}
Expand Up @@ -16,6 +16,7 @@
import org.jboss.as.subsystem.test.AbstractSubsystemTest;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.KernelServices;
import org.jboss.as.version.Stability;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -46,7 +47,7 @@ public OidcTestCase(ElytronOidcSubsystemSchema schema) {
public void prepare() throws Throwable {
if (services != null) return;
String subsystemXml = "oidc.xml";
services = super.createKernelServicesBuilder(new DefaultInitializer()).setSubsystemXmlResource(subsystemXml).build();
services = super.createKernelServicesBuilder(new DefaultInitializer(Stability.PREVIEW)).setSubsystemXmlResource(subsystemXml).build();
if (! services.isSuccessfulBoot()) {
Assert.fail(services.getBootError().toString());
}
Expand Down Expand Up @@ -102,8 +103,13 @@ public void testSecureServerWithRealm() throws Exception {
assertEquals(expectedJson, configService.getJSON("wildfly-console"));
}

private static class DefaultInitializer extends AdditionalInitialization {
protected static class DefaultInitializer extends AdditionalInitialization {

private final Stability stability;

public DefaultInitializer(Stability stability) {
this.stability = stability;
}
@Override
protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegistry, Resource rootResource, ManagementResourceRegistration rootRegistration, RuntimeCapabilityRegistry capabilityRegistry) {
super.initializeExtraSubystemsAndModel(extensionRegistry, rootResource, rootRegistration, capabilityRegistry);
Expand All @@ -115,6 +121,11 @@ protected RunningMode getRunningMode() {
return RunningMode.NORMAL;
}

@Override
public Stability getStability() {
return stability;
}

}

}
Expand Up @@ -3,7 +3,7 @@
~ SPDX-License-Identifier: Apache-2.0
-->

<subsystem xmlns="urn:wildfly:elytron-oidc-client:community:3.0">
<subsystem xmlns="urn:wildfly:elytron-oidc-client:preview:2.0">
<realm name="main">
<realm-public-key>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4siLKUew0WYxdtq6/rwk4Uj/4amGFFnE/yzIxQVU0PUqz3QBRVkUWpDj0K6ZnS5nzJV/y6DHLEy7hjZTdRDphyF1sq09aDOYnVpzu8o2sIlMM8q5RnUyEfIyUZqwo8pSZDJ90fS0s+IDUJNCSIrAKO3w1lqZDHL6E/YFHXyzkvQIDAQAB</realm-public-key>
<auth-server-url>http://localhost:8080/auth</auth-server-url>
Expand Down
Expand Up @@ -3,7 +3,7 @@
~ SPDX-License-Identifier: Apache-2.0
-->

<subsystem xmlns="urn:wildfly:elytron-oidc-client:community:3.0">
<subsystem xmlns="urn:wildfly:elytron-oidc-client:preview:2.0">
<realm name="main-expressions">
<realm-public-key>${exp.realm-public-key:MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4siLKUew0WYxdtq6/rwk4Uj/4amGFFnE/yzIxQVU0PUqz3QBRVkUWpDj0K6ZnS5nzJV/y6DHLEy7hjZTdRDphyF1sq09aDOYnVpzu8o2sIlMM8q5RnUyEfIyUZqwo8pSZDJ90fS0s+IDUJNCSIrAKO3w1lqZDHL6E/YFHXyzkvQIDAQAB}</realm-public-key>
<auth-server-url>${exp.auth-server-url:http://localhost:8080/auth}</auth-server-url>
Expand Down
Expand Up @@ -3,7 +3,7 @@
~ SPDX-License-Identifier: Apache-2.0
-->

<subsystem xmlns="urn:wildfly:elytron-oidc-client:community:3.0">
<subsystem xmlns="urn:wildfly:elytron-oidc-client:preview:2.0">
<realm name="main">
<realm-public-key>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4siLKUew0WYxdtq6/rwk4Uj/4amGFFnE/yzIxQVU0PUqz3QBRVkUWpDj0K6ZnS5nzJV/y6DHLEy7hjZTdRDphyF1sq09aDOYnVpzu8o2sIlMM8q5RnUyEfIyUZqwo8pSZDJ90fS0s+IDUJNCSIrAKO3w1lqZDHL6E/YFHXyzkvQIDAQAB</realm-public-key>
<auth-server-url>http://localhost:8080/auth</auth-server-url>
Expand Down

0 comments on commit 46c84b9

Please sign in to comment.