Browse Source
Merge pull request #54 from wadahiro/dev
feat: update to keycloak 26.0.5
pull/55/head
Hiroyuki Wada
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with
84 additions and
5306 deletions
-
.github/workflows/pull_request.yml
-
.github/workflows/release.yml
-
.releaserc
-
pom.xml
-
src/main/java/org/keycloak/social/discord/DiscordIdentityProvider.java
-
yarn.lock
|
@ -1,35 +1,25 @@ |
|
|
name: Pull Request CI |
|
|
|
|
|
|
|
|
name: Build and test for the pull request |
|
|
|
|
|
|
|
|
on: [pull_request] |
|
|
|
|
|
|
|
|
on: |
|
|
|
|
|
pull_request: |
|
|
|
|
|
types: [opened, synchronize] |
|
|
|
|
|
|
|
|
jobs: |
|
|
jobs: |
|
|
build: |
|
|
build: |
|
|
name: Build |
|
|
|
|
|
|
|
|
name: Build and test |
|
|
runs-on: ubuntu-latest |
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
if: "!contains(github.event.head_commit.message, '[ci skip]')" |
|
|
steps: |
|
|
steps: |
|
|
- uses: actions/checkout@v3 |
|
|
|
|
|
|
|
|
- name: Checkout sources |
|
|
|
|
|
uses: actions/checkout@v4 |
|
|
|
|
|
|
|
|
- name: Set up JDK 17 |
|
|
- name: Set up JDK 17 |
|
|
uses: actions/setup-java@v3 |
|
|
|
|
|
|
|
|
uses: actions/setup-java@v4 |
|
|
with: |
|
|
with: |
|
|
distribution: 'temurin' |
|
|
distribution: 'temurin' |
|
|
java-version: '17' |
|
|
|
|
|
|
|
|
java-version: 17 |
|
|
cache: 'maven' |
|
|
cache: 'maven' |
|
|
- name: Setup node |
|
|
|
|
|
uses: actions/setup-node@v3 |
|
|
|
|
|
with: |
|
|
|
|
|
node-version: '16' |
|
|
|
|
|
cache: 'yarn' |
|
|
|
|
|
- name: Setup semantic-release |
|
|
|
|
|
run: | |
|
|
|
|
|
yarn global add @conveyal/maven-semantic-release@v4.5.0 semantic-release@15 |
|
|
|
|
|
echo "$(yarn global bin)" >> $GITHUB_PATH |
|
|
|
|
|
|
|
|
|
|
|
- name: Build with Maven |
|
|
- name: Build with Maven |
|
|
run: mvn -B package |
|
|
run: mvn -B package |
|
|
- name: Dry Release |
|
|
|
|
|
# maven-semantic-release requires "maven-settings.xml" in the workspace directory |
|
|
|
|
|
run: | |
|
|
|
|
|
mv ~/.m2/settings.xml maven-settings.xml |
|
|
|
|
|
semantic-release --dry-run --branch master --use-conveyal-workflow --skip-maven-deploy |
|
|
|
|
|
env: |
|
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
|
|
|
|
|
|
|
@ -11,27 +11,32 @@ jobs: |
|
|
runs-on: ubuntu-latest |
|
|
runs-on: ubuntu-latest |
|
|
if: "!contains(github.event.head_commit.message, '[ci skip]')" |
|
|
if: "!contains(github.event.head_commit.message, '[ci skip]')" |
|
|
steps: |
|
|
steps: |
|
|
- uses: actions/checkout@v3 |
|
|
|
|
|
- name: Set up JDK 17 |
|
|
|
|
|
uses: actions/setup-java@v3 |
|
|
|
|
|
|
|
|
- name: Checkout sources |
|
|
|
|
|
uses: actions/checkout@v4 |
|
|
|
|
|
with: |
|
|
|
|
|
# Disabling shallow clone is needed for correctly determing next release with semantic release |
|
|
|
|
|
fetch-depth: 0 |
|
|
|
|
|
persist-credentials: false |
|
|
|
|
|
|
|
|
|
|
|
- name: Set up JDK |
|
|
|
|
|
uses: actions/setup-java@v4 |
|
|
with: |
|
|
with: |
|
|
distribution: 'temurin' |
|
|
distribution: 'temurin' |
|
|
java-version: '17' |
|
|
|
|
|
|
|
|
java-version: 17 |
|
|
cache: 'maven' |
|
|
cache: 'maven' |
|
|
- name: Setup node |
|
|
|
|
|
uses: actions/setup-node@v3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Test |
|
|
|
|
|
run: mvn -B test |
|
|
|
|
|
|
|
|
|
|
|
- name: Semantic release |
|
|
|
|
|
id: semantic |
|
|
|
|
|
uses: cycjimmy/semantic-release-action@v4 |
|
|
with: |
|
|
with: |
|
|
node-version: '16' |
|
|
|
|
|
cache: 'yarn' |
|
|
|
|
|
- name: Setup semantic-release |
|
|
|
|
|
run: | |
|
|
|
|
|
yarn global add @conveyal/maven-semantic-release@v4.5.0 semantic-release@15 |
|
|
|
|
|
echo "$(yarn global bin)" >> $GITHUB_PATH |
|
|
|
|
|
- name: Release |
|
|
|
|
|
# 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 |
|
|
|
|
|
|
|
|
semantic_version: 23 |
|
|
|
|
|
extra_plugins: | |
|
|
|
|
|
@semantic-release/changelog@6 |
|
|
|
|
|
@terrestris/maven-semantic-release@2 |
|
|
|
|
|
@semantic-release/git@10 |
|
|
env: |
|
|
env: |
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
|
|
|
|
@ -1,13 +1,36 @@ |
|
|
{ |
|
|
{ |
|
|
|
|
|
"branches": [ |
|
|
|
|
|
"master" |
|
|
|
|
|
], |
|
|
"plugins": [ |
|
|
"plugins": [ |
|
|
"@semantic-release/commit-analyzer", |
|
|
"@semantic-release/commit-analyzer", |
|
|
"@semantic-release/release-notes-generator", |
|
|
"@semantic-release/release-notes-generator", |
|
|
"@conveyal/maven-semantic-release", |
|
|
|
|
|
["@semantic-release/github", { |
|
|
|
|
|
|
|
|
"@semantic-release/changelog", |
|
|
|
|
|
[ |
|
|
|
|
|
"@terrestris/maven-semantic-release", |
|
|
|
|
|
{ |
|
|
|
|
|
"mavenTarget": "install", |
|
|
|
|
|
"clean": false, |
|
|
|
|
|
"updateSnapshotVersion": true, |
|
|
|
|
|
"settingsPath": "/home/runner/.m2/settings.xml", |
|
|
|
|
|
"processAllModules": true |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
"@semantic-release/git", |
|
|
|
|
|
{ |
|
|
"assets": [ |
|
|
"assets": [ |
|
|
{"path": "ear/target/*.ear"} |
|
|
|
|
|
|
|
|
"CHANGELOG.md", "pom.xml", "**/pom.xml" |
|
|
|
|
|
], |
|
|
|
|
|
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
"@semantic-release/github", |
|
|
|
|
|
{ |
|
|
|
|
|
"successComment": false, |
|
|
|
|
|
"failTitle": false |
|
|
|
|
|
} |
|
|
] |
|
|
] |
|
|
}] |
|
|
|
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ |
|
|
<packaging>jar</packaging> |
|
|
<packaging>jar</packaging> |
|
|
|
|
|
|
|
|
<properties> |
|
|
<properties> |
|
|
<version.keycloak>22.0.1</version.keycloak> |
|
|
|
|
|
|
|
|
<version.keycloak>26.0.5</version.keycloak> |
|
|
</properties> |
|
|
</properties> |
|
|
|
|
|
|
|
|
<dependencies> |
|
|
<dependencies> |
|
|
|
@ -67,11 +67,15 @@ public class DiscordIdentityProvider extends AbstractOAuth2IdentityProvider<Disc |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event, JsonNode profile) { |
|
|
protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event, JsonNode profile) { |
|
|
BrokeredIdentityContext user = new BrokeredIdentityContext(getJsonProperty(profile, "id")); |
|
|
|
|
|
|
|
|
BrokeredIdentityContext user = new BrokeredIdentityContext(getJsonProperty(profile, "id"), getConfig()); |
|
|
|
|
|
|
|
|
user.setUsername(getJsonProperty(profile, "username") + "#" + getJsonProperty(profile, "discriminator")); |
|
|
|
|
|
|
|
|
String username = getJsonProperty(profile, "username"); |
|
|
|
|
|
String discriminator = getJsonProperty(profile, "discriminator"); |
|
|
|
|
|
if (!discriminator.equals("0")) { |
|
|
|
|
|
username = username + "#" + discriminator; |
|
|
|
|
|
} |
|
|
|
|
|
user.setUsername(username); |
|
|
user.setEmail(getJsonProperty(profile, "email")); |
|
|
user.setEmail(getJsonProperty(profile, "email")); |
|
|
user.setIdpConfig(getConfig()); |
|
|
|
|
|
user.setIdp(this); |
|
|
user.setIdp(this); |
|
|
|
|
|
|
|
|
AbstractJsonUserAttributeMapper.storeUserProfileForMapper(user, profile, getConfig().getAlias()); |
|
|
AbstractJsonUserAttributeMapper.storeUserProfileForMapper(user, profile, getConfig().getAlias()); |
|
|