Skip to content

Commit 11e46c4

Browse files
multi-module, quarkus upgrade
1 parent 3861136 commit 11e46c4

File tree

8 files changed

+57
-76
lines changed

8 files changed

+57
-76
lines changed

README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The flow is pretty simple :
2323
* A running instance of Keycloak 5.0.0 running on port 8180
2424
* If you have Docker you can also run your Keycloak Server like this :
2525
```
26-
docker run -d --name keycloak -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8180:8180 -v `pwd`/quarkus-kc-quickstart.json:/config/quarkus-kc-quickstart.json -it jboss/keycloak:5.0.0 -b 0.0.0.0 -Djboss.http.port=8180 -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=/config/quarkus-kc-quickstart.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING
26+
docker run -d --name keycloak -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8180:8180 -v `pwd`/quarkus-kc-quickstart.json:/config/quarkus-kc-quickstart.json -it jboss/keycloak:6.0.1 -b 0.0.0.0 -Djboss.http.port=8180 -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=/config/quarkus-kc-quickstart.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING
2727
```
2828

2929
## Instructions
@@ -87,8 +87,3 @@ In the properties we specify this header :
8787
```
8888
org.eclipse.microprofile.rest.client.propagateHeaders=Authorization
8989
```
90-
91-
## Going Native
92-
93-
There is actually an [issue](https://github.com/quarkusio/quarkus/issues/1163) with the `jwt-extension` in Native Mode. The fix is planned for `0.13` and I will be update this section as soon as it will be fixed.
94-

pom.xml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.keycloak.quickstart</groupId>
8+
<artifactId>quarkus-quickstart</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<packaging>pom</packaging>
11+
<properties>
12+
<surefire-plugin.version>2.22.0</surefire-plugin.version>
13+
<quarkus.version>0.14.0</quarkus.version>
14+
<maven.compiler.source>1.8</maven.compiler.source>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<maven.compiler.target>1.8</maven.compiler.target>
17+
</properties>
18+
<dependencyManagement>
19+
<dependencies>
20+
<dependency>
21+
<groupId>io.quarkus</groupId>
22+
<artifactId>quarkus-bom</artifactId>
23+
<version>${quarkus.version}</version>
24+
<type>pom</type>
25+
<scope>import</scope>
26+
</dependency>
27+
</dependencies>
28+
</dependencyManagement>
29+
<modules>
30+
<module>quarkus-front</module>
31+
<module>quarkus-rest-caps</module>
32+
<module>quarkus-rest-username</module>
33+
</modules>
34+
</project>

quarkus-front/pom.xml

+5-20
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,12 @@
22
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
44
<modelVersion>4.0.0</modelVersion>
5-
<groupId>org.keycloak.quickstart</groupId>
5+
<parent>
6+
<groupId>org.keycloak.quickstart</groupId>
7+
<artifactId>quarkus-quickstart</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
610
<artifactId>quarkus-front</artifactId>
7-
<version>1.0-SNAPSHOT</version>
8-
<properties>
9-
<surefire-plugin.version>2.22.0</surefire-plugin.version>
10-
<quarkus.version>0.12.0</quarkus.version>
11-
<maven.compiler.source>1.8</maven.compiler.source>
12-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<maven.compiler.target>1.8</maven.compiler.target>
14-
</properties>
15-
<dependencyManagement>
16-
<dependencies>
17-
<dependency>
18-
<groupId>io.quarkus</groupId>
19-
<artifactId>quarkus-bom</artifactId>
20-
<version>${quarkus.version}</version>
21-
<type>pom</type>
22-
<scope>import</scope>
23-
</dependency>
24-
</dependencies>
25-
</dependencyManagement>
2611
<dependencies>
2712
<dependency>
2813
<groupId>io.quarkus</groupId>

quarkus-front/src/main/resources/META-INF/resources/script/app.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ keycloak.onTokenExpired = function () {
5959
// Flow can be changed to 'implicit' or 'hybrid', but then client must enable implicit flow in admin console too
6060
var initOptions = {
6161
responseMode: 'fragment',
62-
flow: 'standard'
62+
flow: 'standard',
63+
onload: 'check-sso'
6364
};
6465

6566
function startTimer(duration, display) {

quarkus-rest-caps/pom.xml

+7-25
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,17 @@
22
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
44
<modelVersion>4.0.0</modelVersion>
5-
<groupId>org.keycloak.quickstart</groupId>
5+
<parent>
6+
<groupId>org.keycloak.quickstart</groupId>
7+
<artifactId>quarkus-quickstart</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
610
<artifactId>quarkus-rest-caps</artifactId>
7-
<version>1.0-SNAPSHOT</version>
8-
<properties>
9-
<surefire-plugin.version>2.22.0</surefire-plugin.version>
10-
<quarkus.version>0.11.0</quarkus.version>
11-
<maven.compiler.source>1.8</maven.compiler.source>
12-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<maven.compiler.target>1.8</maven.compiler.target>
14-
</properties>
15-
<dependencyManagement>
16-
<dependencies>
17-
<dependency>
18-
<groupId>io.quarkus</groupId>
19-
<artifactId>quarkus-bom</artifactId>
20-
<version>${quarkus.version}</version>
21-
<type>pom</type>
22-
<scope>import</scope>
23-
</dependency>
24-
</dependencies>
25-
</dependencyManagement>
2611
<dependencies>
2712
<dependency>
2813
<groupId>io.quarkus</groupId>
2914
<artifactId>quarkus-resteasy</artifactId>
3015
</dependency>
31-
<dependency>
32-
<groupId>io.quarkus</groupId>
33-
<artifactId>quarkus-arc</artifactId>
34-
</dependency>
3516
<dependency>
3617
<groupId>io.quarkus</groupId>
3718
<artifactId>quarkus-smallrye-jwt</artifactId>
@@ -43,6 +24,7 @@
4324
<dependency>
4425
<groupId>io.quarkus</groupId>
4526
<artifactId>quarkus-junit5</artifactId>
27+
<scope>test</scope>
4628
</dependency>
4729
<dependency>
4830
<groupId>io.rest-assured</groupId>
@@ -121,4 +103,4 @@
121103
</build>
122104
</profile>
123105
</profiles>
124-
</project>
106+
</project>

quarkus-rest-caps/src/main/java/org/keycloak/quickstart/CapsResource.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package org.keycloak.quickstart;
22

3-
4-
53
import javax.annotation.security.RolesAllowed;
4+
import javax.enterprise.context.RequestScoped;
65
import javax.ws.rs.GET;
76
import javax.ws.rs.Path;
87
import javax.ws.rs.PathParam;
98
import javax.ws.rs.Produces;
109

1110

1211
@Path("caps/{username}")
12+
@RequestScoped
1313
public class CapsResource {
1414

1515
@GET

quarkus-rest-caps/src/test/java/org/keycloak/quickstart/CapsResourceTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
import org.junit.jupiter.api.Test;
55

66
import static io.restassured.RestAssured.given;
7-
import static org.hamcrest.CoreMatchers.is;
87

98
@QuarkusTest
109
public class CapsResourceTest {
1110

1211
@Test
1312
public void testHelloEndpoint() {
1413
given()
15-
.when().get("/sebi")
14+
.when().get("caps/sebi")
1615
.then()
1716
.statusCode(401);
1817
}

quarkus-rest-username/pom.xml

+5-20
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,12 @@
22
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
44
<modelVersion>4.0.0</modelVersion>
5-
<groupId>org.keycloak.quickstart</groupId>
5+
<parent>
6+
<groupId>org.keycloak.quickstart</groupId>
7+
<artifactId>quarkus-quickstart</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
610
<artifactId>quarkus-rest-username</artifactId>
7-
<version>1.0-SNAPSHOT</version>
8-
<properties>
9-
<surefire-plugin.version>2.22.0</surefire-plugin.version>
10-
<quarkus.version>0.12.0</quarkus.version>
11-
<maven.compiler.source>1.8</maven.compiler.source>
12-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<maven.compiler.target>1.8</maven.compiler.target>
14-
</properties>
15-
<dependencyManagement>
16-
<dependencies>
17-
<dependency>
18-
<groupId>io.quarkus</groupId>
19-
<artifactId>quarkus-bom</artifactId>
20-
<version>${quarkus.version}</version>
21-
<type>pom</type>
22-
<scope>import</scope>
23-
</dependency>
24-
</dependencies>
25-
</dependencyManagement>
2611
<dependencies>
2712
<dependency>
2813
<groupId>io.quarkus</groupId>

0 commit comments

Comments
 (0)