Skip to content

Commit

Permalink
upgrade to keycloak 19
Browse files Browse the repository at this point in the history
  • Loading branch information
st3v0rr committed Jul 28, 2022
1 parent 169768a commit b4fcbdb
Show file tree
Hide file tree
Showing 6 changed files with 2,196 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Used in docker-compose
# shellcheck disable=SC2034
KEYCLOAK_VERSION=18.0.2
KEYCLOAK_VERSION=19.0.0
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
fail-fast: false
matrix:
env:
- KEYCLOAK_VERSION: 15.1.1
- KEYCLOAK_VERSION: 16.1.1
- KEYCLOAK_VERSION: 17.0.1
- KEYCLOAK_VERSION: 18.0.2
- KEYCLOAK_VERSION: 19.0.0
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
fail-fast: false
matrix:
env:
- KEYCLOAK_VERSION: 18.0.2
- KEYCLOAK_VERSION: 19.0.0
steps:
- uses: actions/checkout@v3

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Added
- Support for Keycloak 19

### Removed
- Support for Keycloak 15

## [5.2.2] - 2022-07-25

### Added
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM ${BUILDER_IMAGE} AS BUILDER

WORKDIR /app/

ARG KEYCLOAK_VERSION=18.0.2
ARG KEYCLOAK_VERSION=19.0.0
ARG MAVEN_CLI_OPTS="-ntp -B"

COPY .mvn .mvn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,21 @@
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.keycloak.authorization.client.AuthzClient;
import org.keycloak.authorization.client.Configuration;
import org.keycloak.representations.idm.*;
import org.keycloak.representations.idm.authorization.*;
import org.keycloak.representations.idm.AuthenticationFlowRepresentation;
import org.keycloak.representations.idm.ClientRepresentation;
import org.keycloak.representations.idm.CredentialRepresentation;
import org.keycloak.representations.idm.GroupRepresentation;
import org.keycloak.representations.idm.IdentityProviderRepresentation;
import org.keycloak.representations.idm.ProtocolMapperRepresentation;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.representations.idm.RoleRepresentation;
import org.keycloak.representations.idm.authorization.DecisionStrategy;
import org.keycloak.representations.idm.authorization.Logic;
import org.keycloak.representations.idm.authorization.PolicyEnforcementMode;
import org.keycloak.representations.idm.authorization.PolicyRepresentation;
import org.keycloak.representations.idm.authorization.ResourceRepresentation;
import org.keycloak.representations.idm.authorization.ResourceServerRepresentation;
import org.keycloak.representations.idm.authorization.ScopeRepresentation;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.IOException;
Expand All @@ -45,7 +58,19 @@
import java.util.stream.Collectors;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.aMapWithSize;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.anEmptyMap;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.emptyString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
Expand Down Expand Up @@ -247,13 +272,7 @@ void shouldUpdateRealmAddProtocolMapper() throws IOException {
assertThat(createdClient.getClientAuthenticatorType(), is("client-secret"));
assertThat(createdClient.getRedirectUris(), is(containsInAnyOrder("https://moped-client.org/redirect")));
assertThat(createdClient.getWebOrigins(), is(containsInAnyOrder("https://moped-client.org/webOrigin")));

// client secret on this place is always null...
assertThat(createdClient.getSecret(), is(nullValue()));

// ... and has to be retrieved separately
String clientSecret2 = getClientSecret(REALM_NAME, createdClient.getId());
assertThat(clientSecret2, is("changed-special-client-secret"));
assertThat(createdClient.getSecret(), is("changed-special-client-secret"));

ProtocolMapperRepresentation createdClientProtocolMappers = createdClient.getProtocolMappers().stream().filter(m -> Objects.equals(m.getName(), "BranchCodeMapper")).findFirst().orElse(null);

Expand Down
Loading

0 comments on commit b4fcbdb

Please sign in to comment.