Skip to content

Commit

Permalink
Ensure SPI works with keycloak 22, bump version to reflect change
Browse files Browse the repository at this point in the history
Change-Id: Iac68a7f5121174540353dc0ef92744c9880b3e92
  • Loading branch information
mhuin committed Jul 20, 2023
1 parent ccdedf8 commit 1c3eac3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
16 changes: 12 additions & 4 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
- project:
check:
jobs:
- keycloak-extensions-maven-build
- keycloak-extensions-test-deploy-21.0
- keycloak-extensions-maven-build:
vars:
jdk_version: 17
- keycloak-extensions-test-deploy-22.0:
vars:
jdk_version: 17
- keycloak-extensions-test-deploy-latest:
voting: false
gate:
jobs:
- keycloak-extensions-maven-build
- keycloak-extensions-test-deploy-21.0
- keycloak-extensions-maven-build:
vars:
jdk_version: 17
- keycloak-extensions-test-deploy-22.0:
vars:
jdk_version: 17
- keycloak-extensions-test-deploy-latest:
voting: false
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ This custom attribute mapper can be used to fetch a user's public SSH key whenev
mvn clean install
```

To build the SPI for use with a version of Keycloak prior to 22.X, you need to use openjdk 11 and patch pom.xml to target java 11:

```
<source>11</source>
<target>11</target>
```

# Prerequisites

A SQL database backend is required. The user attributes table must be manually modified to allow larger attributes like public keys.
Expand Down
2 changes: 1 addition & 1 deletion demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "Done."
echo

echo "Building keycloak with github ssh key mapper ..."
podman build -t test_kc_github_ssh_key_mapper --build-arg KEYCLOAK_VERSION=${KEYCLOAK_VERSION:-21.0} -f testing/Dockerfile .
podman build -t test_kc_github_ssh_key_mapper --build-arg KEYCLOAK_VERSION=${KEYCLOAK_VERSION:-22.0} -f testing/Dockerfile .
echo "Done."
echo

Expand Down
18 changes: 10 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<groupId>org.softwarefactory.keycloak.social.github.sshkeysmapper</groupId>
<version>1.0.19</version>
<version>2.0.0</version>

<name>Keycloak: Github provider SSH keys mapper</name>
<description/>
<description />
<modelVersion>4.0.0</modelVersion>

<artifactId>github-ssh-mapper</artifactId>
Expand All @@ -29,12 +30,12 @@
<properties>
<!-- general settings -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>

<!-- dependency versions -->
<keycloak.version>19.0.2</keycloak.version>
<keycloak.version>22.0.0</keycloak.version>

<lombok.version>1.18.26</lombok.version>
<auto-service.version>1.0-rc7</auto-service.version>
Expand Down Expand Up @@ -94,7 +95,8 @@
<!-- This is required since we need to add the jboss module references
to the resulting jar -->
<manifestEntries>
<!-- Adding explicit dependencies to avoid class-loading issues at runtime -->
<!-- Adding explicit dependencies to avoid class-loading issues at
runtime -->
<Dependencies>
<![CDATA[org.keycloak.keycloak-common,org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.apache.httpcomponents,org.keycloak.keycloak-services,org.jboss.logging,javax.api,javax.jms.api,javax.transaction.api,com.fasterxml.jackson.core.jackson-core,com.fasterxml.jackson.core.jackson-annotations,com.fasterxml.jackson.core.jackson-databind]]></Dependencies>
</manifestEntries>
Expand All @@ -103,4 +105,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
2 changes: 1 addition & 1 deletion testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG KEYCLOAK_VERSION=21.0
ARG KEYCLOAK_VERSION=22.0

FROM quay.io/keycloak/keycloak:$KEYCLOAK_VERSION as builder

Expand Down
1 change: 1 addition & 0 deletions testing/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
KC_DB_PASSWORD: keycloak
KC_HTTP_PORT: 8082
KC_HEALTH_ENABLED: true
KC_LOG_LEVEL: debug
JGROUPS_DISCOVERY_PROTOCOL: JDBC_PING
command:
- "start-dev"
Expand Down

0 comments on commit 1c3eac3

Please sign in to comment.