Skip to content

Commit

Permalink
Reviewing spring docs and maven profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroigor authored and mposolda committed May 18, 2023
1 parent 2ed2169 commit cfa5564
Show file tree
Hide file tree
Showing 36 changed files with 796 additions and 1,244 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
run: scripts/prepare-local-server.sh

- name: Build Quickstarts
run: scripts/build-quickstarts.sh
run: scripts/build-quickstarts.sh legacy

- name: Start Keycloak
run: scripts/start-local-server.sh

- name: Run tests
run: scripts/run-tests.sh
run: scripts/run-tests.sh legacy

- name: Archive logs
if: ${{ always() }}
Expand All @@ -67,7 +67,7 @@ jobs:
ref: 'main'
- uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/

Expand All @@ -93,7 +93,7 @@ jobs:
run: scripts/run-tests.sh jakarta

tests-spring:
name: Spring Framework
name: Spring
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -128,7 +128,8 @@ jobs:

- name: Run unit tests
run: |
mvn -f springframework/app-authz-rest-springboot -Djakarta clean package verify
mvn -f spring/rest-authz-resource-server -Djakarta clean package verify
tests-nodejs:
name: Node.js
runs-on: ubuntu-latest
Expand Down Expand Up @@ -187,7 +188,7 @@ jobs:
ref: 'main'
- uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ They provide small, specific, working examples that can be used as a reference f

They are organized in this repository under different categories (or directories) as follows:

| Category | Description |
|-----------------|---------------------------------------------------------------------------------------|
| extension | Examples about how to extend the server capabilities using some of the Keycloak SPIs. |
| jakarta | Examples about how secure Jakarta Applications |
| js | Examples about how to secure JavaScript Applications |
| nodejs | Examples about how to secure NodeJS Applications |
| springframework | Examples about how to secure Spring Applications |
| Category | Description |
|-----------|---------------------------------------------------------------------------------------|
| extension | Examples about how to extend the server capabilities using some of the Keycloak SPIs. |
| jakarta | Examples about how secure Jakarta Applications |
| js | Examples about how to secure JavaScript Applications |
| nodejs | Examples about how to secure NodeJS Applications |
| spring | Examples about how to secure Spring Applications |

For any missing programming language and framework, you might want to consider looking at:

Expand Down
2 changes: 1 addition & 1 deletion extension/action-token-authenticator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Integration test of the Quickstart
1. Make sure you have an Keycloak server running with an admin user in the `master` realm or use the provided docker image. Also make sure that server
was started with the parameters as described above
2. You need to have Chrome browser installed and updated to the latest version
3. Run `mvn clean install -Djakarta -Pwildfly-managed`
3. Run `mvn clean install -Djakarta`

After running the above command, the WAR file will be located in
`target/deployments/wildfly_action-token-responder-example_action-token-responder-example.war`.
Expand Down
13 changes: 12 additions & 1 deletion extension/action-token-authenticator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,22 @@
<version>${version.jee.jaxb.api}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.wildfly.arquillian.container}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>action-token-example</finalName>

<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extension/action-token-required-action/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Integration test of the Quickstart
1. Make sure you have an Keycloak server running with an admin user in the `master` realm or use the provided docker image. Also make sure that server
was started with the parameters as described above
2. You need to have Chrome browser installed and updated to the latest version
3. Run `mvn clean install -Djakarta -Pwildfly-managed`
3. Run `mvn clean install -Djakarta`

After running the above command, the WAR file will be located in
`target/deployments/wildfly_action-token-responder-example_action-token-responder-example.war`.
Expand Down
13 changes: 12 additions & 1 deletion extension/action-token-required-action/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,22 @@
<version>${version.jee.jaxb.api}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.wildfly.arquillian.container}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>action-token-req-action-example</finalName>

<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public void keycloakManThemeTest() {

loginPage.login("test-admin", "password");
Assert.assertTrue(accountPage.isOverviewPage());

accountPage.clickKeycloakManApp();
Assert.assertTrue(accountPage.isKeycloakManPage());
}
Expand Down
2 changes: 1 addition & 1 deletion jakarta/jaxrs-resource-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ You don't need Wildfly running because a temporary server is started during test
2. Run the following command to build and run tests:

````
mvn -Djakarta -Pwildfly-managed clean verify
mvn -Djakarta clean verify
````

References
Expand Down
11 changes: 9 additions & 2 deletions jakarta/jaxrs-resource-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,20 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.wildfly.arquillian.container}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>jakarta-jaxrs-resource-server</finalName>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion jakarta/servlet-authz-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ You don't need Wildfly running because a temporary server is started during test
2. Run the following command to build and run tests:

````
mvn -Djakarta -Pwildfly-managed clean verify
mvn -Djakarta clean verify
````

References
Expand Down
12 changes: 12 additions & 0 deletions jakarta/servlet-authz-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,22 @@
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.wildfly.arquillian.container}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>jakarta-servlet-authz-client</finalName>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
Expand Down
64 changes: 34 additions & 30 deletions javaee/app-profile-saml-jee-jsp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,22 @@
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client-jee</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.wildfly.arquillian.container}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>app-profile-saml</finalName>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
Expand All @@ -111,7 +123,28 @@
<skip>false</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${version.antrun.maven.plugin}</version>
<executions>
<execution>
<id>install-saml</id>
<phase>process-test-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="run">
<exec dir="target/wildfly-${version.wildfly}/bin"
executable="${jboss-cli.executable}" inputstring="">
<arg value="--file=adapter-elytron-install-saml-offline.cli"/>
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
Expand Down Expand Up @@ -196,34 +229,5 @@
</plugins>
</build>
</profile>
<profile>
<id>wildfly-managed</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${version.antrun.maven.plugin}</version>
<executions>
<execution>
<id>install-saml</id>
<phase>process-test-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="run">
<exec dir="target/wildfly-${version.wildfly}/bin"
executable="${jboss-cli.executable}" inputstring="">
<arg value="--file=adapter-elytron-install-saml-offline.cli"/>
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading

0 comments on commit cfa5564

Please sign in to comment.