Skip to content

Commit

Permalink
feat: update to keycloak 22.0.1 (support new admin console) (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
wadahiro authored Aug 11, 2023
1 parent 15c27a9 commit 2c8da2d
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 211 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
- name: Cache for maven
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Build with Maven
run: mvn -B package

40 changes: 17 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,27 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
- name: Setup node 10
uses: actions/setup-node@v1
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '10.x'
- name: Cache for maven
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache for npm
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('.github/workflows/release.yml') }}
restore-keys: |
${{ runner.os }}-node-
node-version: '16'
cache: 'yarn'
- name: Setup semantic-release
run: npm install -g @conveyal/[email protected] semantic-release@15 @semantic-release/[email protected]
run: |
yarn global add @conveyal/[email protected] semantic-release@15
echo "$(yarn global bin)" >> $GITHUB_PATH
- name: Release
run: semantic-release --branch master --use-conveyal-workflow --skip-maven-deploy
# maven-semantic-release requires "maven-settings.xml" in the workspace directory
run: |
mv ~/.m2/settings.xml maven-settings.xml
semantic-release --branch master --use-conveyal-workflow --skip-maven-deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<packaging>jar</packaging>

<properties>
<version.keycloak>17.0.0</version.keycloak>
<version.keycloak>22.0.1</version.keycloak>
</properties>

<dependencies>
Expand Down Expand Up @@ -46,10 +46,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.keycloak.social.discord;

import com.fasterxml.jackson.databind.JsonNode;
import jakarta.ws.rs.core.Response;
import org.jboss.logging.Logger;
import org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider;
import org.keycloak.broker.oidc.mappers.AbstractJsonUserAttributeMapper;
Expand All @@ -30,7 +31,6 @@
import org.keycloak.services.ErrorPageException;
import org.keycloak.services.messages.Messages;

import javax.ws.rs.core.Response;
import java.util.Set;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

package org.keycloak.social.discord;

import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig;
import org.keycloak.models.IdentityProviderModel;

import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;

import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig;
import org.keycloak.models.IdentityProviderModel;

/**
* @author <a href="mailto:[email protected]">Hiroyuki Wada</a>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@

package org.keycloak.social.discord;

import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig;
import org.keycloak.broker.provider.AbstractIdentityProviderFactory;
import org.keycloak.broker.social.SocialIdentityProviderFactory;
import org.keycloak.models.IdentityProviderModel;
import org.keycloak.models.KeycloakSession;
import org.keycloak.provider.ProviderConfigProperty;
import org.keycloak.provider.ProviderConfigurationBuilder;

import java.util.List;

/**
* @author <a href="mailto:[email protected]">Hiroyuki Wada</a>
Expand All @@ -46,6 +49,18 @@ public DiscordIdentityProviderConfig createConfig() {
return new DiscordIdentityProviderConfig();
}

@Override
public List<ProviderConfigProperty> getConfigProperties() {
return ProviderConfigurationBuilder.create()
.property()
.name("allowedGuilds")
.type(ProviderConfigProperty.STRING_TYPE)
.label("Guild Id(s) to allow federation")
.helpText("If you want to allow federation for specific guild, enter the guild id. Please use a comma as a separator for multiple guilds.")
.add()
.build();
}

@Override
public String getId() {
return PROVIDER_ID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@

/**
* User attribute mapper.
*
*
* @author dannyAAM
*/
public class DiscordUserAttributeMapper extends AbstractJsonUserAttributeMapper {

private static final String[] cp = new String[] { DiscordIdentityProviderFactory.PROVIDER_ID };
private static final String[] cp = new String[]{DiscordIdentityProviderFactory.PROVIDER_ID};

@Override
public String[] getCompatibleProviders() {
return cp;
}
@Override
public String[] getCompatibleProviders() {
return cp;
}

@Override
public String getId() {
return "discord-user-attribute-mapper";
}
@Override
public String getId() {
return "discord-user-attribute-mapper";
}

}

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2c8da2d

Please sign in to comment.