-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WFLY-18476] helloworld-mutual-ssl Quickstart Common Enhancements CY2023Q3 #727
Merged
emmartins
merged 2 commits into
wildfly:main
from
PrarthonaPaul:helloworld-mutual-ssl-enhancement
Mar 25, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: WildFly helloworld-mutual-ssl Quickstart CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
paths: | ||
- 'helloworld-mutual-ssl/**' | ||
- '.github/workflows/quickstart_ci.yml' | ||
|
||
jobs: | ||
call-quickstart_ci: | ||
uses: ./.github/workflows/quickstart_ci.yml | ||
with: | ||
QUICKSTART_PATH: helloworld-mutual-ssl | ||
SERVER_PROVISIONING_SERVER_HOST: https://localhost:8443/ | ||
TEST_PROVISIONED_SERVER: true | ||
TEST_OPENSHIFT: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Configure the client's keystore. This will be used to generate the client's certificate. | ||
# The path to the keystore file doesn’t actually have to exist yet. | ||
/subsystem=elytron/key-store=clientKS:add(path=client.keystore.P12, relative-to=jboss.server.config.dir, credential-reference={clear-text=secret}, type=PKCS12) | ||
|
||
# Generate a new key pair for the client. We'll use an RSA key of size 2048 and we'll use CN=quickstartUser | ||
/subsystem=elytron/key-store=clientKS:generate-key-pair(alias=quickstartUser, algorithm=RSA, key-size=2048, validity=365, credential-reference={clear-text=secret}, distinguished-name="cn=quickstartUser") | ||
|
||
# Export the client's certificate to a file called clientCert.crt | ||
/subsystem=elytron/key-store=clientKS:export-certificate(alias=quickstartUser, path=clientCert.crt, relative-to=jboss.server.config.dir, pem=true) | ||
|
||
# Create the server's truststore | ||
/subsystem=elytron/key-store=serverTS:add(path=server.truststore, relative-to=jboss.server.config.dir, credential-reference={clear-text=secret}, type=PKCS12) | ||
|
||
# Import the client certificate into the server's truststore | ||
/subsystem=elytron/key-store=serverTS:import-certificate(alias=quickstartUser, path=clientCert.crt, relative-to=jboss.server.config.dir, credential-reference={clear-text=secret}, validate=false) | ||
|
||
# Persist the changes we've made to the client's keystore and the server's truststore | ||
/subsystem=elytron/key-store=serverTS:store() | ||
/subsystem=elytron/key-store=clientKS:store() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,16 @@ | |
<version>6</version> | ||
<relativePath/> | ||
</parent> | ||
|
||
<properties> | ||
emmartins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<!-- the version for the Server --> | ||
<version.server>31.0.0.Beta1</version.server> | ||
<!-- The versions for BOMs, Packs and Plugins --> | ||
<version.bom.ee>${version.server}</version.bom.ee> | ||
<version.pack.cloud>5.0.0.Beta1</version.pack.cloud> | ||
<version.plugin.wildfly>4.2.1.Final</version.plugin.wildfly> | ||
</properties> | ||
|
||
<artifactId>helloworld-mutual-ssl</artifactId> | ||
<version>31.0.0.Final-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
|
@@ -43,11 +53,6 @@ | |
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<!-- The versions for BOMs, Dependencies and Plugins --> | ||
<version.server.bom>31.0.0.Beta1</version.server.bom> | ||
</properties> | ||
|
||
<repositories> | ||
<repository> | ||
<id>jboss-public-maven-repository</id> | ||
|
@@ -109,15 +114,14 @@ | |
<dependency> | ||
<groupId>org.wildfly.bom</groupId> | ||
<artifactId>wildfly-ee-with-tools</artifactId> | ||
<version>${version.server.bom}</version> | ||
<version>${version.bom.ee}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
|
||
<!-- Import the CDI API, we use provided scope as the API is included in JBoss WildFly --> | ||
<dependency> | ||
<groupId>jakarta.enterprise</groupId> | ||
|
@@ -140,5 +144,100 @@ | |
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- For tests --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --> | ||
<dependency> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>httpclient</artifactId> | ||
<version>4.5.13</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove version, it's managed by our BOM, and add test scope. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like these changes have been addressed already. |
||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.wildfly.plugins</groupId> | ||
<artifactId>wildfly-maven-plugin</artifactId> | ||
<version>${version.plugin.wildfly}</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>provisioned-server</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.wildfly.plugins</groupId> | ||
<artifactId>wildfly-maven-plugin</artifactId> | ||
<configuration> | ||
emmartins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<feature-packs> | ||
<feature-pack> | ||
<location>org.wildfly:wildfly-galleon-pack:${version.server}</location> | ||
</feature-pack> | ||
</feature-packs> | ||
<layers> | ||
<!-- layers may be used to customize the server to provision--> | ||
<layer>cloud-server</layer> | ||
<layer>undertow-https</layer> | ||
</layers> | ||
<!-- use cli script(s) to configure the server --> | ||
<packaging-scripts> | ||
<packaging-script> | ||
<scripts> | ||
<script>${basedir}/configure-client-cert.cli</script> | ||
<script>${basedir}/configure-ssl.cli</script> | ||
</scripts> | ||
<!-- Expressions resolved during server execution --> | ||
<resolve-expressions>false</resolve-expressions> | ||
</packaging-script> | ||
</packaging-scripts> | ||
<!-- deploys the quickstart on root web context --> | ||
<name>ROOT.war</name> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>package</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
emmartins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<profile> | ||
<id>integration-testing</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<configuration> | ||
<includes> | ||
<include>**/BasicRuntimeIT</include> | ||
</includes> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Remove the keypairs and certificates from the keystore and truststore | ||
/subsystem=elytron/key-store=serverTS:remove-alias(alias=quickstartUser) | ||
/subsystem=elytron/key-store=clientKS:remove-alias(alias=quickstartUser) | ||
|
||
# Remove the keystore and truststore | ||
/subsystem=elytron/key-store=serverTS:remove | ||
/subsystem=elytron/key-store=clientKS:remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this section should be moved to after server is started