Skip to content

Commit

Permalink
fix(src): 🚑 Change Keycloak version
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudelsuppe42 committed Aug 23, 2024
1 parent a8f5a88 commit 1410fa5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.427.0",
"@bte-germany/terraconvert": "^1.0.1",
"@keycloak/keycloak-admin-client": "^20.0.2",
"@keycloak/keycloak-admin-client": "24.0.5",
"@prisma/client": "^5.18.0",
"@turf/helpers": "^6.5.0",
"@turf/turf": "^6.5.0",
Expand Down
7 changes: 4 additions & 3 deletions src/controllers/ApplicationController.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
Application,
ApplicationQuestionType,
ApplicationStatus,
ApplicationStatus
} from "@prisma/client";
import { Request, Response } from "express";
import { WebhookType, sendBtWebhook } from "../util/BtWebhooks.js";
import { sendBtWebhook, WebhookType } from "../util/BtWebhooks.js";
import {
ERROR_GENERIC,
ERROR_NO_PERMISSION,
ERROR_VALIDATION,
ERROR_VALIDATION
} from "../util/Errors.js";

import { validationResult } from "express-validator";
Expand Down Expand Up @@ -471,6 +471,7 @@ class ApplicationController {
minecraft: answer,
minecraftVerified: false,
},
username: req.kcUser.username,
}
);
req.kcUser = {
Expand Down
1 change: 1 addition & 0 deletions src/controllers/UserController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ class UserController {
minecraftVerified: true,
minecraftUuid: minecraftInfo.uuid,
},
username: code.user.username,
}
);

Expand Down
10 changes: 7 additions & 3 deletions src/web/routes/utils/CheckNewUserMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Core, { ExtendedPrismaClient } from "../../../Core.js";
import { NextFunction, Request, Response } from "express";
import Core, { ExtendedPrismaClient } from "../../../Core.js";

import { PrismaClient } from "@prisma/client";

Expand Down Expand Up @@ -67,12 +67,13 @@ const checkNewUser = (prisma: ExtendedPrismaClient, core: Core) => {
.getKeycloakAdmin()
.getKeycloakAdminClient()
.users.update(
{ id: req.kauth.grant.access_token.content.sub },
{ id: req.kauth.grant.access_token.content.sub! },
{
attributes: {
minecraft: user.minecraft,
minecraftVerified: false,
},
username: kcUser.username,
}
);
req.kcUser = {
Expand Down Expand Up @@ -130,7 +131,10 @@ const checkNewUser = (prisma: ExtendedPrismaClient, core: Core) => {
.getKeycloakAdminClient()
.users.update(
{ id: req.kauth.grant.access_token.content.sub },
{ attributes: { minecraft: "", minecraftVerified: false } }
{
attributes: { minecraft: "", minecraftVerified: false },
username: kcUser.username,
}
);
req.kcUser = {
...kcUser,
Expand Down
4 changes: 4 additions & 0 deletions src/web/routes/utils/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export default class Router {
`/api/${this.version}${endpoint}`,
middlewares,
(rq: Request, rs: Response, next: any) => {
this.web
.getCore()
.getLogger()
.debug(`Calling endpoint "${rq.method} ${endpoint}"`);
if (rq.method === requestMethod.valueOf()) {
try {
executor(rq, rs);
Expand Down
44 changes: 17 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -644,16 +644,14 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"

"@keycloak/keycloak-admin-client@^20.0.2":
version "20.0.2"
resolved "https://registry.npmjs.org/@keycloak/keycloak-admin-client/-/keycloak-admin-client-20.0.2.tgz"
integrity sha512-uLk3gQxdgskvQPAXF2YPT6bZ9XGwOwy1Lxx2bqGZC7HTcf2V3YYmzYbmSp2nPs1InzCVYf708Kbdry5zR/cA1w==
dependencies:
axios "^0.27.2"
camelize-ts "^2.1.1"
lodash-es "^4.17.21"
"@keycloak/[email protected]":
version "24.0.5"
resolved "https://registry.yarnpkg.com/@keycloak/keycloak-admin-client/-/keycloak-admin-client-24.0.5.tgz#b61a3bf02faaf659525ccc815c75cc3d5a545a80"
integrity sha512-SXDVtQ3ov7GQbxXq51Uq8lzhwzQwNg6XiY50ZA9whuUe2t/0zPT4Zd/LcULcjweIjSNWWgfbDyN1E3yRSL8Qqw==
dependencies:
camelize-ts "^3.0.0"
url-join "^5.0.0"
url-template "^3.0.0"
url-template "^3.1.1"

"@nodelib/[email protected]":
version "2.1.5"
Expand Down Expand Up @@ -2668,14 +2666,6 @@ autoprefixer@^10.4.13:
picocolors "^1.0.0"
postcss-value-parser "^4.2.0"

axios@^0.27.2:
version "0.27.2"
resolved "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
dependencies:
follow-redirects "^1.14.9"
form-data "^4.0.0"

axios@^1.6.0:
version "1.6.2"
resolved "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz"
Expand Down Expand Up @@ -2846,10 +2836,10 @@ callsites@^3.0.0:
resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz"
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==

camelize-ts@^2.1.1:
version "2.2.0"
resolved "https://registry.npmjs.org/camelize-ts/-/camelize-ts-2.2.0.tgz"
integrity sha512-6jMy83qFmNrJIMQXXU6Bi7VVkyl/nBVvoxcVsGRDA6R01pPZpnO/LaIcx6dijJjHbBA2G0uHY4Irk7LeA274NQ==
camelize-ts@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/camelize-ts/-/camelize-ts-3.0.0.tgz#b9a7b4ff802464dc3d6475637a64a9742ad3db09"
integrity sha512-cgRwKKavoDKLTjO4FQTs3dRBePZp/2Y9Xpud0FhuCOTE86M2cniKN4CCXgRnsyXNMmQMifVHcv6SPaMtTx6ofQ==

caniuse-lite@^1.0.30001400, caniuse-lite@^1.0.30001426:
version "1.0.30001439"
Expand Down Expand Up @@ -3683,7 +3673,7 @@ [email protected]:
resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz"
integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==

follow-redirects@^1.14.9, follow-redirects@^1.15.0:
follow-redirects@^1.15.0:
version "1.15.2"
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz"
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
Expand Down Expand Up @@ -4237,7 +4227,7 @@ locate-path@^6.0.0:
dependencies:
p-locate "^5.0.0"

lodash-es@^4.17.11, lodash-es@^4.17.21:
lodash-es@^4.17.11:
version "4.17.21"
resolved "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
Expand Down Expand Up @@ -5446,10 +5436,10 @@ url-join@^5.0.0:
resolved "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz"
integrity sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==

url-template@^3.0.0:
version "3.1.0"
resolved "https://registry.npmjs.org/url-template/-/url-template-3.1.0.tgz"
integrity sha512-vB/eHWttzhN+NZzk9FcQB2h1cSEgb7zDYyvyxPhw02LYw7YqIzO+w1AqkcKvZ51gPH8o4+nyiWve/xuQqMdJZw==
url-template@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/url-template/-/url-template-3.1.1.tgz#c220d5f3f793d28b0de341002112879cc8a43905"
integrity sha512-4oszoaEKE/mQOtAmdMWqIRHmkxWkUZMnXFnjQ5i01CuRSK3uluxcH1MRVVVWmhlnzT1SCDfKxxficm2G37qzCA==

url-value-parser@^2.0.0:
version "2.2.0"
Expand Down

0 comments on commit 1410fa5

Please sign in to comment.