Skip to content

Commit

Permalink
chore(deps): update parent to 0.62.0 (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras authored Aug 16, 2024
1 parent 79b2690 commit 6b4335a
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,123 +11,123 @@ h| Version
| tkit-quarkus-log-cdi

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-cdi.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link]
| 2.28.0
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link]
| 2.31.0

| tkit-quarkus-log-rs

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-rs.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link]
| 2.28.0
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link]
| 2.31.0

| tkit-quarkus-log-json

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-json.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link]
| 2.28.0
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link]
| 2.31.0

| tkit-quarkus-rest

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link]
| 2.28.0
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link]
| 2.31.0

| tkit-quarkus-rest-context

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest-context.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link]
| 2.28.0
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link]
| 2.31.0

| quarkus-opentelemetry

| https://quarkus.io/guides/opentelemetry[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-opentelemetry.adoc[Link]
| 3.12.2
| 3.13.2
| quarkus-smallrye-health
| https://quarkus.io/guides/smallrye-health[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-health.adoc[Link]
| 3.12.2
| 3.13.2
| quarkus-micrometer-registry-prometheus
| https://quarkus.io/guides/telemetry-micrometer[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-micrometer-registry-prometheus.adoc[Link]
| 3.12.2
| 3.13.2
| quarkus-rest
| https://quarkus.io/guides/rest[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-rest.adoc[Link]
| 3.12.2
| 3.13.2
| quarkus-rest-jackson
| https://quarkus.io/guides/rest-json[Link]
|
| 3.12.2
| 3.13.2
| quarkus-smallrye-openapi
| https://quarkus.io/guides/openapi-swaggerui[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-openapi.adoc[Link]
| 3.12.2
| 3.13.2
| quarkus-smallrye-jwt
| https://quarkus.io/guides/security-jwt-build[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-jwt.adoc[Link]
| 3.12.2
| 3.13.2
| quarkus-hibernate-validator
| https://quarkus.io/guides/validation[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-hibernate-validator.adoc[Link]
| 3.12.2
| 3.13.2
| quarkus-oidc
| https://quarkus.io/guides/security-oidc-bearer-token-authentication-tutorial[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-oidc.adoc[Link]
| 3.12.2
| 3.13.2
| tkit-quarkus-security
| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-security.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link]
| 2.28.0
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link]
| 2.31.0
| onecx-core
| https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-core.html[Link]
|
| 0.24.0
| 0.26.0
| quarkus-arc
| https://quarkus.io/guides/cdi-reference[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-arc.adoc[Link]
| 3.12.2
| 3.13.2
| quarkus-container-image-docker
| https://quarkus.io/guides/container-image[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-container-image-docker.adoc[Link]
| 3.12.2
| 3.13.2
| onecx-security
|
|
| 0.24.0
| 0.26.0
| quarkus-keycloak-admin-client-reactive
|
|
| 3.12.2
| 3.13.2
|===
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.tkit.onecx</groupId>
<artifactId>onecx-quarkus3-parent</artifactId>
<version>0.58.0</version>
<version>0.62.0</version>
</parent>

<artifactId>onecx-iam-kc-svc</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class AdminRoleRestController implements AdminRoleControllerApi {
KeycloakMapper mapper;

@Override
public Response searchRolesByCriteria(RoleSearchCriteriaDTOV1 roleSearchCriteriaDTOV1) {
public Response rolesSearchByCriteria(RoleSearchCriteriaDTOV1 roleSearchCriteriaDTOV1) {
var criteria = mapper.map(roleSearchCriteriaDTOV1);
var result = adminService.searchRoles(criteria);
return Response.ok(mapper.map(result)).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class AdminUserRestController implements AdminUserControllerApi {
ExceptionMapper exceptionMapper;

@Override
public Response resetPassword(UserResetPasswordRequestDTOV1 userResetPasswordRequestDTOV1) {
public Response userResetPassword(UserResetPasswordRequestDTOV1 userResetPasswordRequestDTOV1) {
adminService.resetPassword(userResetPasswordRequestDTOV1.getPassword());
return Response.noContent().build();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/openapi/onecx-iam-kc-svc-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ paths:
tags:
- AdminRoleController
summary: Search roles by criteria
operationId: searchRolesByCriteria
operationId: rolesSearchByCriteria
requestBody:
required: true
content:
Expand All @@ -45,7 +45,7 @@ paths:
tags:
- AdminUserController
summary: user reset password
operationId: resetPassword
operationId: userResetPassword
requestBody:
required: true
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void roleSearchNoBodyTest() {
assertThat(exception).isNotNull();
assertThat(exception.getErrorCode()).isNotNull().isEqualTo(ExceptionMapper.ErrorKeys.CONSTRAINT_VIOLATIONS.name());
assertThat(exception.getDetail()).isNotNull()
.isEqualTo("searchRolesByCriteria.roleSearchCriteriaDTOV1: must not be null");
.isEqualTo("rolesSearchByCriteria.roleSearchCriteriaDTOV1: must not be null");
assertThat(exception.getInvalidParams()).isNotNull().isNotEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ static void setUp() {

@Test
void resetPasswordTest() {
var bobToken = keycloakClient.getAccessToken(USER_BOB);
var tokens = this.getTokens(keycloakClient, USER_BOB);
var bobToken = tokens.getIdToken();

UserResetPasswordRequestDTOV1 dto = new UserResetPasswordRequestDTOV1();
dto.setPassword("changedPassword");
Expand All @@ -54,7 +55,7 @@ void resetPasswordTest() {
var tmp = keycloakClient.getAccessToken(USER_BOB);
Assertions.assertNull(tmp);

bobToken = keycloakClient.getAccessToken(USER_BOB, dto.getPassword(), getClientId());
bobToken = getTokens(keycloakClient, USER_BOB, dto.getPassword()).getIdToken();
dto.setPassword(USER_BOB);

given()
Expand Down Expand Up @@ -113,7 +114,7 @@ void resetPasswordEmptyRequestTest() {
Assertions.assertNotNull(exception);
Assertions.assertEquals(CONSTRAINT_VIOLATIONS.name(), exception.getErrorCode());
Assertions.assertEquals(
"resetPassword.userResetPasswordRequestDTOV1.password: must not be null",
"userResetPassword.userResetPasswordRequestDTOV1.password: must not be null",
exception.getDetail());
Assertions.assertNotNull(exception.getInvalidParams());
}
Expand All @@ -133,7 +134,7 @@ void resetPasswordNoRequestTest() {
Assertions.assertNotNull(exception);
Assertions.assertEquals(CONSTRAINT_VIOLATIONS.name(), exception.getErrorCode());
Assertions.assertEquals(
"resetPassword.userResetPasswordRequestDTOV1: must not be null",
"userResetPassword.userResetPasswordRequestDTOV1: must not be null",
exception.getDetail());
Assertions.assertNotNull(exception.getInvalidParams());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void searchUsersNoRequest() {

@Test
void resetPasswordTest() {
var bobToken = keycloakClient.getAccessToken(USER_BOB);

var tokens = this.getTokens(keycloakClient, USER_BOB);
var bobToken = tokens.getIdToken();
UserResetPasswordRequestDTO dto = new UserResetPasswordRequestDTO();
dto.setPassword("changedPassword");

Expand All @@ -149,7 +149,7 @@ void resetPasswordTest() {
var tmp = keycloakClient.getAccessToken(USER_BOB);
Assertions.assertNull(tmp);

bobToken = keycloakClient.getAccessToken(USER_BOB, dto.getPassword(), getClientId());
bobToken = getTokens(keycloakClient, USER_BOB, dto.getPassword()).getIdToken();
dto.setPassword(USER_BOB);

given()
Expand Down
31 changes: 31 additions & 0 deletions src/test/java/org/tkit/onecx/iam/kc/test/AbstractTest.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
package org.tkit.onecx.iam.kc.test;

import static org.keycloak.common.util.Encode.urlEncode;

import java.util.List;

import org.eclipse.microprofile.config.ConfigProvider;
import org.keycloak.representations.AccessTokenResponse;

import io.quarkus.test.common.DevServicesContext;
import io.quarkus.test.keycloak.client.KeycloakTestClient;
import io.restassured.RestAssured;
import io.restassured.specification.RequestSpecification;

public abstract class AbstractTest {

Expand All @@ -27,4 +35,27 @@ private String getDevProperty(String prop, String defaultValue) {
return value == null ? defaultValue : value;
}

protected AccessTokenResponse getTokens(KeycloakTestClient ktc, String userName) {
return getTokens(ktc, userName, userName);
}

protected AccessTokenResponse getTokens(KeycloakTestClient ktc, String userName, String password) {

String clientId = "quarkus-app";
String clientSecret = "secret";
List<String> scopes = List.of("openid");

String authServerUrl = ktc.getAuthServerUrl();

RequestSpecification requestSpec = RestAssured.given()
.param("grant_type", "password")
.param("username", userName)
.param("password", password)
.param("client_id", clientId)
.param("client_secret", clientSecret)
.param("scope", urlEncode(String.join(" ", scopes)));

return requestSpec.when().post(authServerUrl + "/protocol/openid-connect/token")
.as(AccessTokenResponse.class);
}
}

0 comments on commit 6b4335a

Please sign in to comment.