Skip to content

Commit 6bc73f3

Browse files
authored
1093 added support for KC26.1.0 (#1094)
* 1093 added support for KC26.1.0 Signed-off-by: Sebastian Schuster <[email protected]> * Add building the user-federation-example in CI Signed-off-by: Sebastian Schuster <[email protected]> * Pushed KC26 version to 26.1.3, enabled all tests in CI, disabled testing of custom-user-federation-example for all but the latest versions Signed-off-by: Sebastian Schuster <[email protected]> --------- Signed-off-by: Sebastian Schuster <[email protected]>
1 parent c732685 commit 6bc73f3

File tree

7 files changed

+44
-42
lines changed

7 files changed

+44
-42
lines changed

.github/workflows/test.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
strategy:
6767
matrix:
6868
keycloak-version:
69+
- '26.1.3'
6970
- '26.0.8'
7071
- '25.0.6'
7172
- '24.0.5'
@@ -89,10 +90,20 @@ jobs:
8990
uses: hashicorp/setup-terraform@v3
9091
with:
9192
terraform_wrapper: false
92-
terraform_version: 1.9.8
93+
terraform_version: 1.11.1
94+
95+
- name: Setup Gradle
96+
uses: gradle/actions/setup-gradle@v3
97+
- name: Build user-federation-example with Gradle
98+
run: make user-federation-example
9399

94100
- name: Start Keycloak Container
95101
run: |
102+
MOUNT_FEDERATION_EXAMPLE_VOLUME=""
103+
if [[ "${{ matrix.keycloak-version }}" == "26.1.3" ]]; then
104+
MOUNT_FEDERATION_EXAMPLE_VOLUME="-v $PWD/custom-user-federation-example/build/libs/custom-user-federation-example-all.jar:/opt/keycloak/providers/custom-user-federation-example-all.jar:z"
105+
fi
106+
96107
docker run -d --name keycloak \
97108
-p 8080:8080 \
98109
-e KC_DB=dev-mem \
@@ -101,6 +112,7 @@ jobs:
101112
-e KEYCLOAK_ADMIN_PASSWORD=password \
102113
-e KC_FEATURES=preview \
103114
-v $PWD/provider/misc:/opt/keycloak/misc:z \
115+
$MOUNT_FEDERATION_EXAMPLE_VOLUME \
104116
quay.io/keycloak/keycloak:${{ matrix.keycloak-version }} start-dev
105117
106118
- name: Initialize Keycloak

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ This provider will officially support the latest three major versions of Keycloa
4848

4949
The following versions are used when running acceptance tests in CI:
5050

51-
- 26.0.8 (latest)
51+
- 26.1.3 (latest)
52+
- 26.0.8
5253
- 25.0.6
5354
- 24.0.5
5455
- 23.0.7
@@ -71,7 +72,7 @@ build you can use the `linux_amd64` build as long as `libc6-compat` is installed
7172

7273
## Development
7374

74-
This project requires Go 1.22 and Terraform 1.4.1.
75+
This project requires Go 1.22 and Terraform 1.11.1.
7576
This project uses [Go Modules](https://github.com/golang/go/wiki/Modules) for dependency management, which allows this project to exist outside an existing GOPATH.
7677

7778
After cloning the repository, you can build the project by running `make build`.

custom-user-federation-example/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
ext {
8-
keycloakVersion = '26.0.8'
8+
keycloakVersion = '26.1.3'
99
}
1010

1111
dependencies {

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
environment:
1515
LDAP_PORT_NUMBER: 389
1616
keycloak:
17-
image: quay.io/keycloak/keycloak:26.0.8
17+
image: quay.io/keycloak/keycloak:26.1.3
1818
command: --verbose start-dev --features=preview
1919
depends_on:
2020
- postgres

keycloak/version.go

+22-21
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,28 @@ import (
88
type Version string
99

1010
const (
11-
Version_6 Version = "6.0.0"
12-
Version_7 Version = "7.0.0"
13-
Version_8 Version = "8.0.0"
14-
Version_9 Version = "9.0.0"
15-
Version_10 Version = "10.0.0"
16-
Version_11 Version = "11.0.0"
17-
Version_12 Version = "12.0.0"
18-
Version_13 Version = "13.0.0"
19-
Version_14 Version = "14.0.0"
20-
Version_15 Version = "15.0.0"
21-
Version_16 Version = "16.0.0"
22-
Version_17 Version = "17.0.0"
23-
Version_18 Version = "18.0.0"
24-
Version_19 Version = "19.0.0"
25-
Version_20 Version = "20.0.0"
26-
Version_21 Version = "21.0.0"
27-
Version_22 Version = "22.0.0"
28-
Version_23 Version = "23.0.0"
29-
Version_24 Version = "24.0.0"
30-
Version_25 Version = "25.0.0"
31-
Version_26 Version = "26.0.0"
11+
Version_6 Version = "6.0.0"
12+
Version_7 Version = "7.0.0"
13+
Version_8 Version = "8.0.0"
14+
Version_9 Version = "9.0.0"
15+
Version_10 Version = "10.0.0"
16+
Version_11 Version = "11.0.0"
17+
Version_12 Version = "12.0.0"
18+
Version_13 Version = "13.0.0"
19+
Version_14 Version = "14.0.0"
20+
Version_15 Version = "15.0.0"
21+
Version_16 Version = "16.0.0"
22+
Version_17 Version = "17.0.0"
23+
Version_18 Version = "18.0.0"
24+
Version_19 Version = "19.0.0"
25+
Version_20 Version = "20.0.0"
26+
Version_21 Version = "21.0.0"
27+
Version_22 Version = "22.0.0"
28+
Version_23 Version = "23.0.0"
29+
Version_24 Version = "24.0.0"
30+
Version_25 Version = "25.0.0"
31+
Version_26 Version = "26.0.0"
32+
Version_26_1 Version = "26.1.0"
3233
)
3334

3435
func (v Version) AsVersion() *version.Version {

provider/resource_keycloak_custom_user_federation_test.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ import (
1212
)
1313

1414
func TestAccKeycloakCustomUserFederation_basic(t *testing.T) {
15+
skipIfVersionIsLessThan(testCtx, t, keycloakClient, keycloak.Version_26_1)
1516
t.Parallel()
1617

17-
skipIfEnvSet(t, "CI") // temporary while I figure out how to load this custom provider in CI
18-
1918
name := acctest.RandomWithPrefix("tf-acc")
2019
providerId := "custom"
2120

@@ -39,10 +38,9 @@ func TestAccKeycloakCustomUserFederation_basic(t *testing.T) {
3938
}
4039

4140
func TestAccKeycloakCustomUserFederation_customConfig(t *testing.T) {
41+
skipIfVersionIsLessThan(testCtx, t, keycloakClient, keycloak.Version_26_1)
4242
t.Parallel()
4343

44-
skipIfEnvSet(t, "CI") // temporary while I figure out how to load this custom provider in CI
45-
4644
name := acctest.RandomWithPrefix("tf-acc")
4745
configValue := acctest.RandomWithPrefix("tf-acc")
4846
providerId := "custom"
@@ -75,10 +73,9 @@ func TestAccKeycloakCustomUserFederation_customConfig(t *testing.T) {
7573
}
7674

7775
func TestAccKeycloakCustomUserFederation_createAfterManualDestroy(t *testing.T) {
76+
skipIfVersionIsLessThan(testCtx, t, keycloakClient, keycloak.Version_26_1)
7877
t.Parallel()
7978

80-
skipIfEnvSet(t, "CI") // temporary while I figure out how to load this custom provider in CI
81-
8279
var customFederation = &keycloak.CustomUserFederation{}
8380

8481
name := acctest.RandomWithPrefix("tf-acc")

provider/resource_keycloak_realm_keystore_java_kyestore_test.go

+1-10
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import (
1515
func TestAccKeycloakRealmKeystoreJava_basic(t *testing.T) {
1616
t.Parallel()
1717

18-
skipIfEnvSet(t, "CI") // temporary while I figure out how to put java keystore file to keycloak container in CI
19-
2018
javaKeystoreName := acctest.RandomWithPrefix("tf-acc")
2119

2220
resource.Test(t, resource.TestCase{
@@ -41,8 +39,6 @@ func TestAccKeycloakRealmKeystoreJava_basic(t *testing.T) {
4139
func TestAccKeycloakRealmKeystoreJava_createAfterManualDestroy(t *testing.T) {
4240
t.Parallel()
4341

44-
skipIfEnvSet(t, "CI") // temporary while I figure out how to put java keystore file to keycloak container in CI
45-
4642
var javaKeystore = &keycloak.RealmKeystoreJavaKeystore{}
4743

4844
fullNameKeystoreName := acctest.RandomWithPrefix("tf-acc")
@@ -73,8 +69,6 @@ func TestAccKeycloakRealmKeystoreJava_createAfterManualDestroy(t *testing.T) {
7369
func TestAccKeycloakRealmKeystoreJava_algorithmValidation(t *testing.T) {
7470
t.Parallel()
7571

76-
skipIfEnvSet(t, "CI") // temporary while I figure out how to put java keystore file to keycloak container in CI
77-
7872
algorithm := randomStringInSlice(keycloakRealmKeystoreJavaKeystoreAlgorithm)
7973

8074
resource.Test(t, resource.TestCase{
@@ -98,8 +92,6 @@ func TestAccKeycloakRealmKeystoreJava_algorithmValidation(t *testing.T) {
9892
func TestAccKeycloakRealmKeystoreJava_updateRsaKeystoreGenerated(t *testing.T) {
9993
t.Parallel()
10094

101-
skipIfEnvSet(t, "CI") // temporary while I figure out how to put java keystore file to keycloak container in CI
102-
10395
enabled := randomBool()
10496
active := randomBool()
10597

@@ -149,8 +141,7 @@ func testAccCheckRealmKeystoreJavaExists(resourceName string) resource.TestCheck
149141
}
150142
}
151143

152-
func testAccCheckRealmKeystoreJavaFetch(resourceName string, keystore *keycloak.RealmKeystoreJavaKeystore) resource.
153-
TestCheckFunc {
144+
func testAccCheckRealmKeystoreJavaFetch(resourceName string, keystore *keycloak.RealmKeystoreJavaKeystore) resource.TestCheckFunc {
154145
return func(s *terraform.State) error {
155146
fetchedKeystore, err := getKeycloakRealmKeystoreJavaFromState(s, resourceName)
156147
if err != nil {

0 commit comments

Comments
 (0)