From cd6cfec7f3a4008067e728b570de50e98481ec58 Mon Sep 17 00:00:00 2001 From: tw-blue Date: Sun, 7 Dec 2025 12:51:57 +0100 Subject: [PATCH] import legacy frontend & fix dependency issues --- packages/api/.vscode/launch.json | 27 + .../keycloak/realm-export/realm-export.json | 2660 +++++++++++++++++ packages/api/dev/postgres/initdb/keycloak.sql | 2 + packages/api/package.json | 32 +- .../api/src/controllers/membersController.ts | 4 +- .../api/src/controllers/usersController.ts | 4 +- packages/api/src/{models => dtos}/claim.ts | 0 packages/api/src/{models => dtos}/member.ts | 29 +- packages/api/src/{models => dtos}/topic.ts | 0 packages/api/src/{models => dtos}/user.ts | 0 packages/api/src/index.ts | 3 +- packages/api/src/middleware/authentication.ts | 31 +- packages/api/src/services/db/prisma.ts | 17 +- .../services/keycloak/admin/keycloak-admin.ts | 4 +- .../src/services/keycloak/user/keycloak.json | 14 +- packages/api/src/services/membersService.ts | 10 +- packages/api/src/services/userService.ts | 4 +- packages/frontend/.prettierrc | 14 + packages/frontend/package.json | 4 + packages/frontend/src/app/app.config.ts | 112 +- packages/frontend/src/app/app.routes.ts | 95 +- .../delete-member-dialog.component.html | 13 + .../delete-member-dialog.component.scss | 11 + .../delete-member-dialog.component.spec.ts | 23 + .../delete-member-dialog.component.ts | 57 + .../edit-member-dialog.component.html | 44 + .../edit-member-dialog.component.scss | 8 + .../edit-member-dialog.component.spec.ts | 22 + .../edit-member-dialog.component.ts | 47 + .../components/missing-page/missing-page.html | 7 +- .../components/missing-page/missing-page.ts | 15 +- .../new-member/new-member.component.html | 39 + .../new-member/new-member.component.scss | 9 + .../new-member/new-member.component.spec.ts | 23 + .../new-member/new-member.component.ts | 49 + .../src/app/components/test/test.html | 18 +- .../frontend/src/app/components/test/test.ts | 35 +- .../components/view-members/view-members.html | 125 + .../components/view-members/view-members.scss | 0 .../view-members/view-members.spec.ts | 23 + .../components/view-members/view-members.ts | 115 + .../src/app/pipes/date-pipe.pipe.spec.ts | 8 + .../frontend/src/app/pipes/date-pipe.pipe.ts | 20 + .../src/app/pipes/nobreak-hyphen.pipe.spec.ts | 8 + .../src/app/pipes/nobreak-hyphen.pipe.ts | 11 + .../src/app/pipes/stylize-names.pipe.spec.ts | 8 + .../src/app/pipes/stylize-names.pipe.ts | 41 + .../src/app/services/authentication.ts | 182 +- packages/frontend/src/app/util/member.ts | 99 + packages/frontend/src/styles.scss | 24 +- pnpm-lock.yaml | 76 +- tsoa.json | 4 +- 52 files changed, 3963 insertions(+), 267 deletions(-) create mode 100644 packages/api/.vscode/launch.json create mode 100644 packages/api/dev/keycloak/realm-export/realm-export.json rename packages/api/src/{models => dtos}/claim.ts (100%) rename packages/api/src/{models => dtos}/member.ts (62%) rename packages/api/src/{models => dtos}/topic.ts (100%) rename packages/api/src/{models => dtos}/user.ts (100%) create mode 100644 packages/frontend/.prettierrc create mode 100644 packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.html create mode 100644 packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.scss create mode 100644 packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.spec.ts create mode 100644 packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.ts create mode 100644 packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.html create mode 100644 packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.scss create mode 100644 packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.spec.ts create mode 100644 packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.ts create mode 100644 packages/frontend/src/app/components/new-member/new-member.component.html create mode 100644 packages/frontend/src/app/components/new-member/new-member.component.scss create mode 100644 packages/frontend/src/app/components/new-member/new-member.component.spec.ts create mode 100644 packages/frontend/src/app/components/new-member/new-member.component.ts create mode 100644 packages/frontend/src/app/components/view-members/view-members.html create mode 100644 packages/frontend/src/app/components/view-members/view-members.scss create mode 100644 packages/frontend/src/app/components/view-members/view-members.spec.ts create mode 100644 packages/frontend/src/app/components/view-members/view-members.ts create mode 100644 packages/frontend/src/app/pipes/date-pipe.pipe.spec.ts create mode 100644 packages/frontend/src/app/pipes/date-pipe.pipe.ts create mode 100644 packages/frontend/src/app/pipes/nobreak-hyphen.pipe.spec.ts create mode 100644 packages/frontend/src/app/pipes/nobreak-hyphen.pipe.ts create mode 100644 packages/frontend/src/app/pipes/stylize-names.pipe.spec.ts create mode 100644 packages/frontend/src/app/pipes/stylize-names.pipe.ts create mode 100644 packages/frontend/src/app/util/member.ts diff --git a/packages/api/.vscode/launch.json b/packages/api/.vscode/launch.json new file mode 100644 index 0000000..337b7eb --- /dev/null +++ b/packages/api/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}\\dist\\index.js", + "outFiles": [ + "${workspaceFolder}/**/*.js" + ], + "env": { + "TKD_DB_USER": "webapi", + "TKD_DB_PASSWORD": "devpassword", + "TKD_DB_HOST": "localhost", + "TKD_COOKIE_SECRET": "devsecret" + }, + "runtimeExecutable": "C:\\Users\\Toni\\AppData\\Roaming\\fnm\\aliases\\default\\node" + } + ] +} diff --git a/packages/api/dev/keycloak/realm-export/realm-export.json b/packages/api/dev/keycloak/realm-export/realm-export.json new file mode 100644 index 0000000..2220532 --- /dev/null +++ b/packages/api/dev/keycloak/realm-export/realm-export.json @@ -0,0 +1,2660 @@ +{ + "id": "5e5894fd-3eed-4e00-9911-0c951fe6a200", + "realm": "taekwondo", + "notBefore": 0, + "defaultSignatureAlgorithm": "RS256", + "revokeRefreshToken": false, + "refreshTokenMaxReuse": 0, + "accessTokenLifespan": 300, + "accessTokenLifespanForImplicitFlow": 900, + "ssoSessionIdleTimeout": 1800, + "ssoSessionMaxLifespan": 36000, + "ssoSessionIdleTimeoutRememberMe": 0, + "ssoSessionMaxLifespanRememberMe": 0, + "offlineSessionIdleTimeout": 2592000, + "offlineSessionMaxLifespanEnabled": false, + "offlineSessionMaxLifespan": 5184000, + "clientSessionIdleTimeout": 0, + "clientSessionMaxLifespan": 0, + "clientOfflineSessionIdleTimeout": 0, + "clientOfflineSessionMaxLifespan": 0, + "accessCodeLifespan": 60, + "accessCodeLifespanUserAction": 300, + "accessCodeLifespanLogin": 1800, + "actionTokenGeneratedByAdminLifespan": 43200, + "actionTokenGeneratedByUserLifespan": 300, + "oauth2DeviceCodeLifespan": 600, + "oauth2DevicePollingInterval": 5, + "enabled": true, + "sslRequired": "external", + "registrationAllowed": false, + "registrationEmailAsUsername": false, + "rememberMe": false, + "verifyEmail": false, + "loginWithEmailAllowed": true, + "duplicateEmailsAllowed": false, + "resetPasswordAllowed": false, + "editUsernameAllowed": false, + "bruteForceProtected": false, + "permanentLockout": false, + "maxTemporaryLockouts": 0, + "bruteForceStrategy": "MULTIPLE", + "maxFailureWaitSeconds": 900, + "minimumQuickLoginWaitSeconds": 60, + "waitIncrementSeconds": 60, + "quickLoginCheckMilliSeconds": 1000, + "maxDeltaTimeSeconds": 43200, + "failureFactor": 30, + "roles": { + "realm": [ + { + "id": "d98ea71d-4572-4618-b5d8-3ad18affb67c", + "name": "default-roles-taekwondo", + "description": "${role_default-roles}", + "composite": true, + "composites": { + "realm": [ + "offline_access", + "uma_authorization" + ], + "client": { + "account": [ + "manage-account", + "view-profile" + ] + } + }, + "clientRole": false, + "containerId": "5e5894fd-3eed-4e00-9911-0c951fe6a200", + "attributes": {} + }, + { + "id": "05ece2b9-3b04-4f0f-81f4-afacb6dda32f", + "name": "memberadmin", + "description": "", + "composite": false, + "clientRole": false, + "containerId": "5e5894fd-3eed-4e00-9911-0c951fe6a200", + "attributes": {} + }, + { + "id": "b077aada-86c1-4483-8270-a4eb9689a115", + "name": "offline_access", + "description": "${role_offline-access}", + "composite": false, + "clientRole": false, + "containerId": "5e5894fd-3eed-4e00-9911-0c951fe6a200", + "attributes": {} + }, + { + "id": "f27039eb-dfa7-4ecd-9952-d34511417633", + "name": "uma_authorization", + "description": "${role_uma_authorization}", + "composite": false, + "clientRole": false, + "containerId": "5e5894fd-3eed-4e00-9911-0c951fe6a200", + "attributes": {} + }, + { + "id": "3fc9708c-c18b-4723-b600-023d21bffd81", + "name": "useradmin", + "description": "", + "composite": false, + "clientRole": false, + "containerId": "5e5894fd-3eed-4e00-9911-0c951fe6a200", + "attributes": {} + } + ], + "client": { + "angular-frontend": [], + "realm-management": [ + { + "id": "df7ece51-f502-4a89-9bc1-c6e183e097bf", + "name": "query-realms", + "description": "${role_query-realms}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "a9c6eab9-4e82-4eaf-b0fa-a528e83aec07", + "name": "view-clients", + "description": "${role_view-clients}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-clients" + ] + } + }, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "aa25c757-1434-4a1d-b34f-658f0073b1e2", + "name": "manage-users", + "description": "${role_manage-users}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "41331bc0-4c30-4ce4-8b1c-e2fb9fd00eee", + "name": "query-groups", + "description": "${role_query-groups}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "870c390d-a841-4d82-9669-8e3d96b1b78d", + "name": "manage-authorization", + "description": "${role_manage-authorization}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "b57022a5-123f-4156-81fd-a7a5ef0397c3", + "name": "manage-clients", + "description": "${role_manage-clients}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "4e3979c7-bfa3-4c56-b739-175ef3f50eaf", + "name": "manage-identity-providers", + "description": "${role_manage-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "09fcee46-a6bf-4565-b16c-ab98aa0844b3", + "name": "view-users", + "description": "${role_view-users}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-groups", + "query-users" + ] + } + }, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "042800d7-63ed-45b7-bbcb-d498acb839f8", + "name": "create-client", + "description": "${role_create-client}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "a33b84b8-995b-49fe-b888-fe2f29b5610b", + "name": "view-events", + "description": "${role_view-events}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "79727770-9dca-4b7b-822d-f2fe3162a09e", + "name": "view-identity-providers", + "description": "${role_view-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "73af423a-fe1c-4a5d-a90c-bb89457e53ad", + "name": "manage-realm", + "description": "${role_manage-realm}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "b8472b42-a02a-4da8-99f2-ae04fe783f7c", + "name": "view-realm", + "description": "${role_view-realm}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "01fdbdb1-1232-42ca-93ec-4a8cec948c53", + "name": "impersonation", + "description": "${role_impersonation}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "afb078e8-b306-4388-beba-3a27beda6df1", + "name": "realm-admin", + "description": "${role_realm-admin}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-realms", + "view-clients", + "manage-users", + "query-groups", + "manage-authorization", + "manage-clients", + "manage-identity-providers", + "view-users", + "create-client", + "view-events", + "view-identity-providers", + "view-realm", + "manage-realm", + "impersonation", + "view-authorization", + "query-clients", + "query-users", + "manage-events" + ] + } + }, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "18368b3d-f707-4a95-a3c5-f1318ecee4d0", + "name": "view-authorization", + "description": "${role_view-authorization}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "e0d36b45-bd54-4723-b23a-37e483786af0", + "name": "query-clients", + "description": "${role_query-clients}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "7fc84523-d651-4d2b-99e0-39ba258da542", + "name": "query-users", + "description": "${role_query-users}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + }, + { + "id": "70cad478-eee1-452e-a1e5-e39dccd24fae", + "name": "manage-events", + "description": "${role_manage-events}", + "composite": false, + "clientRole": true, + "containerId": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "attributes": {} + } + ], + "security-admin-console": [], + "admin-cli": [], + "nodejs-api": [], + "account-console": [], + "broker": [ + { + "id": "6c2f6269-afe1-49a4-abba-a8e33cd78535", + "name": "read-token", + "description": "${role_read-token}", + "composite": false, + "clientRole": true, + "containerId": "b6386fdd-bf2c-4a52-8789-015d0043b8ca", + "attributes": {} + } + ], + "account": [ + { + "id": "6ae10832-a392-4d23-8220-679c1016de86", + "name": "manage-account", + "description": "${role_manage-account}", + "composite": true, + "composites": { + "client": { + "account": [ + "manage-account-links" + ] + } + }, + "clientRole": true, + "containerId": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "attributes": {} + }, + { + "id": "a47ca83c-a0ff-4cdd-94ea-8178dc668880", + "name": "manage-account-links", + "description": "${role_manage-account-links}", + "composite": false, + "clientRole": true, + "containerId": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "attributes": {} + }, + { + "id": "a097527d-bfc0-47bc-a156-4a03c5c7c433", + "name": "view-consent", + "description": "${role_view-consent}", + "composite": false, + "clientRole": true, + "containerId": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "attributes": {} + }, + { + "id": "662bfb02-2bf8-4385-8223-16302376b641", + "name": "view-groups", + "description": "${role_view-groups}", + "composite": false, + "clientRole": true, + "containerId": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "attributes": {} + }, + { + "id": "a5c3f31b-9fc4-48d0-b795-22c31583acd3", + "name": "manage-consent", + "description": "${role_manage-consent}", + "composite": true, + "composites": { + "client": { + "account": [ + "view-consent" + ] + } + }, + "clientRole": true, + "containerId": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "attributes": {} + }, + { + "id": "d7757a04-bc04-4353-9e22-91ab9f673f58", + "name": "view-profile", + "description": "${role_view-profile}", + "composite": false, + "clientRole": true, + "containerId": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "attributes": {} + }, + { + "id": "d8a48762-9a67-45da-9eae-130731161112", + "name": "delete-account", + "description": "${role_delete-account}", + "composite": false, + "clientRole": true, + "containerId": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "attributes": {} + }, + { + "id": "e049e75f-4eec-40f7-a5cc-8667e3d4f7b5", + "name": "view-applications", + "description": "${role_view-applications}", + "composite": false, + "clientRole": true, + "containerId": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "attributes": {} + } + ] + } + }, + "groups": [], + "defaultRole": { + "id": "d98ea71d-4572-4618-b5d8-3ad18affb67c", + "name": "default-roles-taekwondo", + "description": "${role_default-roles}", + "composite": true, + "clientRole": false, + "containerId": "5e5894fd-3eed-4e00-9911-0c951fe6a200" + }, + "requiredCredentials": [ + "password" + ], + "otpPolicyType": "totp", + "otpPolicyAlgorithm": "HmacSHA1", + "otpPolicyInitialCounter": 0, + "otpPolicyDigits": 6, + "otpPolicyLookAheadWindow": 1, + "otpPolicyPeriod": 30, + "otpPolicyCodeReusable": false, + "otpSupportedApplications": [ + "totpAppFreeOTPName", + "totpAppGoogleName", + "totpAppMicrosoftAuthenticatorName" + ], + "localizationTexts": {}, + "webAuthnPolicyRpEntityName": "keycloak", + "webAuthnPolicySignatureAlgorithms": [ + "ES256", + "RS256" + ], + "webAuthnPolicyRpId": "", + "webAuthnPolicyAttestationConveyancePreference": "not specified", + "webAuthnPolicyAuthenticatorAttachment": "not specified", + "webAuthnPolicyRequireResidentKey": "not specified", + "webAuthnPolicyUserVerificationRequirement": "not specified", + "webAuthnPolicyCreateTimeout": 0, + "webAuthnPolicyAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyAcceptableAaguids": [], + "webAuthnPolicyExtraOrigins": [], + "webAuthnPolicyPasswordlessRpEntityName": "keycloak", + "webAuthnPolicyPasswordlessSignatureAlgorithms": [ + "ES256", + "RS256" + ], + "webAuthnPolicyPasswordlessRpId": "", + "webAuthnPolicyPasswordlessAttestationConveyancePreference": "not specified", + "webAuthnPolicyPasswordlessAuthenticatorAttachment": "not specified", + "webAuthnPolicyPasswordlessRequireResidentKey": "Yes", + "webAuthnPolicyPasswordlessUserVerificationRequirement": "required", + "webAuthnPolicyPasswordlessCreateTimeout": 0, + "webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyPasswordlessAcceptableAaguids": [], + "webAuthnPolicyPasswordlessExtraOrigins": [], + "users": [ + { + "id": "aea8aae2-6642-4a92-9ae1-cb6b3599b75a", + "username": "service-account-nodejs-api", + "emailVerified": false, + "enabled": true, + "createdTimestamp": 1762463686460, + "totp": false, + "serviceAccountClientId": "nodejs-api", + "disableableCredentialTypes": [], + "requiredActions": [], + "realmRoles": [ + "default-roles-taekwondo" + ], + "notBefore": 0, + "groups": [] + } + ], + "scopeMappings": [ + { + "clientScope": "offline_access", + "roles": [ + "offline_access" + ] + } + ], + "clientScopeMappings": { + "account": [ + { + "client": "account-console", + "roles": [ + "manage-account", + "view-groups" + ] + } + ] + }, + "clients": [ + { + "id": "3f6f9dab-2cec-4f47-8f51-125338997a80", + "clientId": "account", + "name": "${client_account}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/taekwondo/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "/realms/taekwondo/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "post.logout.redirect.uris": "+" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "organization", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "7ae93f74-7abd-4515-bd1e-9244ed8c533f", + "clientId": "account-console", + "name": "${client_account-console}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/taekwondo/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "/realms/taekwondo/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "post.logout.redirect.uris": "+", + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "f18f3460-f9aa-43fd-81f7-725f874346a3", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + } + ], + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "organization", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "7b40ad0f-414f-4f6d-8f84-1d402e19e6b7", + "clientId": "admin-cli", + "name": "${client_admin-cli}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": false, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "client.use.lightweight.access.token.enabled": "true" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "organization", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "a5aa646b-5877-4414-964a-714501d49e71", + "clientId": "angular-frontend", + "name": "Angular", + "description": "", + "rootUrl": "http://localhost:3000", + "adminUrl": "http://localhost:3000", + "baseUrl": "/home", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "http://localhost:3000/*" + ], + "webOrigins": [ + "+" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": true, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "oidc.ciba.grant.enabled": "false", + "backchannel.logout.session.required": "true", + "standard.token.exchange.enabled": "false", + "post.logout.redirect.uris": "https://localhost/*", + "oauth2.device.authorization.grant.enabled": "false", + "pkce.code.challenge.method": "S256", + "backchannel.logout.revoke.offline.tokens": "false", + "dpop.bound.access.tokens": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "organization", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "b6386fdd-bf2c-4a52-8789-015d0043b8ca", + "clientId": "broker", + "name": "${client_broker}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": true, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "true" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "organization", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "c91ece08-5f96-46bd-8195-25b99ef99c98", + "clientId": "nodejs-api", + "name": "NodejsApi", + "description": "", + "rootUrl": "http://localhost:3000", + "adminUrl": "", + "baseUrl": "http://localhost:3000", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "devsecret", + "redirectUris": [ + "http://localhost:3000/*" + ], + "webOrigins": [ + "http://loclahost:3000" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": false, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": true, + "publicClient": false, + "frontchannelLogout": true, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "oidc.ciba.grant.enabled": "false", + "client.secret.creation.time": "1762463686", + "backchannel.logout.session.required": "true", + "standard.token.exchange.enabled": "true", + "frontchannel.logout.session.required": "true", + "display.on.consent.screen": "false", + "oauth2.device.authorization.grant.enabled": "false", + "pkce.code.challenge.method": "S256", + "backchannel.logout.revoke.offline.tokens": "false", + "dpop.bound.access.tokens": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "service_account", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "organization", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "dcede75e-da73-48a3-ba26-19a2ef12f097", + "clientId": "realm-management", + "name": "${client_realm-management}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": true, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "true" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "organization", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "44cefb02-ed60-4310-882b-5e7df90b3ff9", + "clientId": "security-admin-console", + "name": "${client_security-admin-console}", + "rootUrl": "${authAdminUrl}", + "baseUrl": "/admin/taekwondo/console/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "/admin/taekwondo/console/*" + ], + "webOrigins": [ + "+" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "client.use.lightweight.access.token.enabled": "true", + "post.logout.redirect.uris": "+", + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "3d9fc433-e601-4afd-9ac6-05781db2dbed", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "organization", + "offline_access", + "microprofile-jwt" + ] + } + ], + "clientScopes": [ + { + "id": "614809d4-f898-48d5-a448-3bcf18a18710", + "name": "email", + "description": "OpenID Connect built-in scope: email", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${emailScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "1bf0eab1-85f5-47df-b263-18072673255b", + "name": "email", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "email", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email", + "jsonType.label": "String" + } + }, + { + "id": "7bcedb7e-2b3c-4689-a588-3f510d6c1518", + "name": "email verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "emailVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email_verified", + "jsonType.label": "boolean" + } + } + ] + }, + { + "id": "f57b8953-acf9-4402-a5b9-7dd8d1655de8", + "name": "service_account", + "description": "Specific scope for a client enabled for service accounts", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "ea54f0b8-8537-4ee5-804e-edcc274339da", + "name": "Client IP Address", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "clientAddress", + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true", + "claim.name": "clientAddress", + "jsonType.label": "String" + } + }, + { + "id": "75c52d62-39bc-4e39-a2f2-0017db8256ee", + "name": "Client ID", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "client_id", + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true", + "claim.name": "client_id", + "jsonType.label": "String" + } + }, + { + "id": "90051d50-ffa9-4b87-ac99-3cc1980d3be9", + "name": "Client Host", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "clientHost", + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true", + "claim.name": "clientHost", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "3d87824e-f91f-4ce3-ac14-8e87eaab9c06", + "name": "saml_organization", + "description": "Organization Membership", + "protocol": "saml", + "attributes": { + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "9d845030-74b4-439f-bdee-e1b9f4ffd938", + "name": "organization", + "protocol": "saml", + "protocolMapper": "saml-organization-membership-mapper", + "consentRequired": false, + "config": {} + } + ] + }, + { + "id": "b6cd6518-6884-4fdc-a6b0-474b0cface92", + "name": "web-origins", + "description": "OpenID Connect scope for add allowed web origins to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "consent.screen.text": "", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "814f77ff-8120-4221-9e3d-515ade46cbd6", + "name": "allowed web origins", + "protocol": "openid-connect", + "protocolMapper": "oidc-allowed-origins-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "access.token.claim": "true" + } + } + ] + }, + { + "id": "fa93ee91-aae7-4798-a1a5-08b22e11977c", + "name": "offline_access", + "description": "OpenID Connect built-in scope: offline_access", + "protocol": "openid-connect", + "attributes": { + "consent.screen.text": "${offlineAccessScopeConsentText}", + "display.on.consent.screen": "true" + } + }, + { + "id": "9ba4a1b3-1801-4878-a5bb-e564f63ef3b8", + "name": "address", + "description": "OpenID Connect built-in scope: address", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${addressScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "ae7e454a-ad6a-4d40-afbc-3bdf2e5c030c", + "name": "address", + "protocol": "openid-connect", + "protocolMapper": "oidc-address-mapper", + "consentRequired": false, + "config": { + "user.attribute.formatted": "formatted", + "user.attribute.country": "country", + "introspection.token.claim": "true", + "user.attribute.postal_code": "postal_code", + "userinfo.token.claim": "true", + "user.attribute.street": "street", + "id.token.claim": "true", + "user.attribute.region": "region", + "access.token.claim": "true", + "user.attribute.locality": "locality" + } + } + ] + }, + { + "id": "72af5fa4-7962-41f3-b579-941bd93a0f13", + "name": "microprofile-jwt", + "description": "Microprofile - JWT built-in scope", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "eef718ac-df15-47f4-83dd-cc08c2ad00a0", + "name": "upn", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "upn", + "jsonType.label": "String" + } + }, + { + "id": "22d41173-bdf9-407b-8710-defb72419294", + "name": "groups", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "multivalued": "true", + "user.attribute": "foo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "groups", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "ef426ab1-b10e-4719-aa68-1837e50e0844", + "name": "roles", + "description": "OpenID Connect scope for add user roles to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "consent.screen.text": "${rolesScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "861bd5f5-9e6e-470f-ba79-ae63378a85c0", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "access.token.claim": "true" + } + }, + { + "id": "d2e56ea3-7900-445d-81fc-0b575899ad56", + "name": "client roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-client-role-mapper", + "consentRequired": false, + "config": { + "user.attribute": "foo", + "introspection.token.claim": "true", + "access.token.claim": "true", + "claim.name": "resource_access.${client_id}.roles", + "jsonType.label": "String", + "multivalued": "true" + } + }, + { + "id": "06aaa2ea-e3cb-4684-a2ea-5cdf0f49f96c", + "name": "realm roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "user.attribute": "foo", + "introspection.token.claim": "true", + "access.token.claim": "true", + "claim.name": "realm_access.roles", + "jsonType.label": "String", + "multivalued": "true" + } + } + ] + }, + { + "id": "805d8aa2-f2b8-4237-80cd-dc13d747f176", + "name": "organization", + "description": "Additional claims about the organization a subject belongs to", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${organizationScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "26b0418e-5bdf-4b78-a68c-81946d8fda3b", + "name": "organization", + "protocol": "openid-connect", + "protocolMapper": "oidc-organization-membership-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true", + "claim.name": "organization", + "jsonType.label": "String", + "multivalued": "true" + } + } + ] + }, + { + "id": "9644b369-e383-480d-a209-bc64dad1531b", + "name": "phone", + "description": "OpenID Connect built-in scope: phone", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${phoneScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "6ef3e644-fa51-467b-ac3f-2a6cbaedac27", + "name": "phone number", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "phoneNumber", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number", + "jsonType.label": "String" + } + }, + { + "id": "9dbdc3c4-2b46-42d2-ba42-0138711f75e6", + "name": "phone number verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "phoneNumberVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number_verified", + "jsonType.label": "boolean" + } + } + ] + }, + { + "id": "88fc95c4-7ef6-4105-8d50-f61df899ede1", + "name": "acr", + "description": "OpenID Connect scope for add acr (authentication context class reference) to the token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "f8aa6c5e-487c-4289-94c0-900b26359667", + "name": "acr loa level", + "protocol": "openid-connect", + "protocolMapper": "oidc-acr-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true" + } + } + ] + }, + { + "id": "c07e4cb0-c242-4b4e-9a61-b5c51f211beb", + "name": "profile", + "description": "OpenID Connect built-in scope: profile", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${profileScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "32c28e07-aed3-4a97-b766-f8e86974d0a4", + "name": "given name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "firstName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "given_name", + "jsonType.label": "String" + } + }, + { + "id": "168fb8c2-00a5-4c29-b52e-ef62653769c6", + "name": "profile", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "profile", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "profile", + "jsonType.label": "String" + } + }, + { + "id": "3ad8b500-9601-4960-ab6f-39764bb8fd21", + "name": "gender", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "gender", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "gender", + "jsonType.label": "String" + } + }, + { + "id": "a03ddd8a-49f4-4323-9c9f-fedeb6a0a30c", + "name": "picture", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "picture", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "picture", + "jsonType.label": "String" + } + }, + { + "id": "ae1e8cc7-688a-4fdc-811f-d418161b8d45", + "name": "website", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "website", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "website", + "jsonType.label": "String" + } + }, + { + "id": "87aba58b-0989-4f15-b9ae-7efbc111d986", + "name": "zoneinfo", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "zoneinfo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "zoneinfo", + "jsonType.label": "String" + } + }, + { + "id": "51247ebc-f5e5-491e-a918-df1eec0d45aa", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + }, + { + "id": "311f4a15-4289-4e3a-98a8-831d5c00cdc6", + "name": "full name", + "protocol": "openid-connect", + "protocolMapper": "oidc-full-name-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + }, + { + "id": "5f732d13-be76-4414-b205-f7ebfdebfa72", + "name": "middle name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "middleName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "middle_name", + "jsonType.label": "String" + } + }, + { + "id": "4f35d1a7-0a44-4c6f-a307-5298374a2549", + "name": "nickname", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "nickname", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "nickname", + "jsonType.label": "String" + } + }, + { + "id": "dd079b62-2c7b-4eee-89e1-495cb727bfe5", + "name": "updated at", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "updatedAt", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "updated_at", + "jsonType.label": "long" + } + }, + { + "id": "1c16d447-8811-4841-b18d-06bf21925ad4", + "name": "birthdate", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "birthdate", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "birthdate", + "jsonType.label": "String" + } + }, + { + "id": "dd170242-bc14-4133-a08e-550e85c465a0", + "name": "family name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "lastName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "family_name", + "jsonType.label": "String" + } + }, + { + "id": "91e88195-8f18-4cae-9183-2cf45e3358eb", + "name": "username", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "preferred_username", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "7c2d24c1-c0e4-489d-acab-8c9b799d14e6", + "name": "basic", + "description": "OpenID Connect scope for add all basic claims to the token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "f929601e-8825-4cc5-88d2-8f20681ed265", + "name": "auth_time", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "AUTH_TIME", + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true", + "claim.name": "auth_time", + "jsonType.label": "long" + } + }, + { + "id": "1289307f-106a-42db-a7a4-16c1fbad4dc5", + "name": "sub", + "protocol": "openid-connect", + "protocolMapper": "oidc-sub-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "access.token.claim": "true" + } + } + ] + }, + { + "id": "f4cd1abb-5c19-4481-ae91-4857053b40f3", + "name": "role_list", + "description": "SAML role list", + "protocol": "saml", + "attributes": { + "consent.screen.text": "${samlRoleListScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "bd70c78b-4b85-4fe6-b681-156d41f78d51", + "name": "role list", + "protocol": "saml", + "protocolMapper": "saml-role-list-mapper", + "consentRequired": false, + "config": { + "single": "false", + "attribute.nameformat": "Basic", + "attribute.name": "Role" + } + } + ] + } + ], + "defaultDefaultClientScopes": [ + "role_list", + "saml_organization", + "profile", + "email", + "roles", + "web-origins", + "acr", + "basic" + ], + "defaultOptionalClientScopes": [ + "offline_access", + "address", + "phone", + "microprofile-jwt", + "organization" + ], + "browserSecurityHeaders": { + "contentSecurityPolicyReportOnly": "", + "xContentTypeOptions": "nosniff", + "referrerPolicy": "no-referrer", + "xRobotsTag": "none", + "xFrameOptions": "SAMEORIGIN", + "contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", + "strictTransportSecurity": "max-age=31536000; includeSubDomains" + }, + "smtpServer": {}, + "eventsEnabled": false, + "eventsListeners": [ + "jboss-logging" + ], + "enabledEventTypes": [], + "adminEventsEnabled": false, + "adminEventsDetailsEnabled": false, + "identityProviders": [], + "identityProviderMappers": [], + "components": { + "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy": [ + { + "id": "9010dbd6-a341-49e8-b139-70d81bd12538", + "name": "Trusted Hosts", + "providerId": "trusted-hosts", + "subType": "anonymous", + "subComponents": {}, + "config": { + "host-sending-registration-request-must-match": [ + "true" + ], + "client-uris-must-match": [ + "true" + ] + } + }, + { + "id": "d0d37268-d509-4ba1-b3ad-f6c8e934863a", + "name": "Full Scope Disabled", + "providerId": "scope", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "69c62d57-1810-445d-988e-c0a9ebcc5ef9", + "name": "Consent Required", + "providerId": "consent-required", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "17746449-84f3-4c71-bfb1-f77b122793f3", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "c09184d0-73ea-47c9-95cd-b2afdec9a9e2", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "saml-user-property-mapper", + "oidc-address-mapper", + "saml-role-list-mapper", + "saml-user-attribute-mapper", + "oidc-usermodel-attribute-mapper", + "oidc-usermodel-property-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-full-name-mapper" + ] + } + }, + { + "id": "1c8dcee0-2109-4c62-982d-f52b0669f0ba", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "oidc-address-mapper", + "oidc-sha256-pairwise-sub-mapper", + "saml-role-list-mapper", + "saml-user-property-mapper", + "oidc-full-name-mapper", + "oidc-usermodel-attribute-mapper", + "saml-user-attribute-mapper", + "oidc-usermodel-property-mapper" + ] + } + }, + { + "id": "abeb03fc-3719-43f2-bbc6-464d4378ca3f", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "7646d248-e1ae-4c41-bf6c-30c4dffb99ed", + "name": "Max Clients Limit", + "providerId": "max-clients", + "subType": "anonymous", + "subComponents": {}, + "config": { + "max-clients": [ + "200" + ] + } + } + ], + "org.keycloak.keys.KeyProvider": [ + { + "id": "6efcefb9-aedd-4f2f-ab4e-4e3fbffc05e9", + "name": "rsa-generated", + "providerId": "rsa-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + }, + { + "id": "0834b3a0-78bb-4e85-b4c1-0440dc7f20d7", + "name": "rsa-enc-generated", + "providerId": "rsa-enc-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ], + "algorithm": [ + "RSA-OAEP" + ] + } + }, + { + "id": "579ca9c6-79b0-44d5-bcd7-2ad4195311f1", + "name": "hmac-generated-hs512", + "providerId": "hmac-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ], + "algorithm": [ + "HS512" + ] + } + }, + { + "id": "5f803016-e6bf-41b6-b911-69714681b557", + "name": "aes-generated", + "providerId": "aes-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + } + ] + }, + "internationalizationEnabled": false, + "authenticationFlows": [ + { + "id": "6ccb5d15-91f0-478e-bd9f-ede4a356fce7", + "alias": "Account verification options", + "description": "Method with which to verity the existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-email-verification", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Verify Existing Account by Re-authentication", + "userSetupAllowed": false + } + ] + }, + { + "id": "b910092a-0ce9-43f1-bf06-505b50d0959a", + "alias": "Browser - Conditional 2FA", + "description": "Flow to determine if any 2FA is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorConfig": "browser-conditional-credential", + "authenticator": "conditional-credential", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-otp-form", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 30, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "webauthn-authenticator", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 40, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-recovery-authn-code-form", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 50, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "b2cb4fe0-e09a-46ef-a5a0-9845fe2f40b6", + "alias": "Browser - Conditional Organization", + "description": "Flow to determine if the organization identity-first login is to be used", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "organization", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "a8ccbef7-86ba-4de7-a6ae-aa73dc6d0cf7", + "alias": "Direct Grant - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "direct-grant-validate-otp", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "f6c67c38-f949-4292-b8c1-5c85d1152697", + "alias": "First Broker Login - Conditional Organization", + "description": "Flow to determine if the authenticator that adds organization members is to be used", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "idp-add-organization-member", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "b4f21a26-1efa-4d27-86bd-96db00437f00", + "alias": "First broker login - Conditional 2FA", + "description": "Flow to determine if any 2FA is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorConfig": "first-broker-login-conditional-credential", + "authenticator": "conditional-credential", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-otp-form", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 30, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "webauthn-authenticator", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 40, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-recovery-authn-code-form", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 50, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "4920b384-0c2f-450e-879e-909f1fc0cec7", + "alias": "Handle Existing Account", + "description": "Handle what to do if there is existing account with same email/username like authenticated identity provider", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-confirm-link", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Account verification options", + "userSetupAllowed": false + } + ] + }, + { + "id": "7d1d94eb-8071-4dd8-9e5c-b48e9bf61b4d", + "alias": "Organization", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 10, + "autheticatorFlow": true, + "flowAlias": "Browser - Conditional Organization", + "userSetupAllowed": false + } + ] + }, + { + "id": "863de758-337d-48c1-bc8e-9db80fcab1ff", + "alias": "Reset - Conditional OTP", + "description": "Flow to determine if the OTP should be reset or not. Set to REQUIRED to force.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-otp", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "e91f268c-af04-40bd-90c0-0914f22c12fd", + "alias": "User creation or linking", + "description": "Flow for the existing/non-existing user alternatives", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "create unique user config", + "authenticator": "idp-create-user-if-unique", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Handle Existing Account", + "userSetupAllowed": false + } + ] + }, + { + "id": "2d3bf2c0-a8a8-4016-9729-f335ef6c9024", + "alias": "Verify Existing Account by Re-authentication", + "description": "Reauthentication of existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-username-password-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "First broker login - Conditional 2FA", + "userSetupAllowed": false + } + ] + }, + { + "id": "2de5f546-f174-4f12-8e16-05415bd5a5fc", + "alias": "browser", + "description": "Browser based authentication", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-cookie", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-spnego", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "identity-provider-redirector", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 25, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 26, + "autheticatorFlow": true, + "flowAlias": "Organization", + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 30, + "autheticatorFlow": true, + "flowAlias": "forms", + "userSetupAllowed": false + } + ] + }, + { + "id": "5a9e3bfe-92f6-4ef7-86c9-ddfc40981cca", + "alias": "clients", + "description": "Base authentication for clients", + "providerId": "client-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "client-secret", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-jwt", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-secret-jwt", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 30, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-x509", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 40, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "24856092-71ff-4e54-8a7a-05f0490a44c0", + "alias": "direct grant", + "description": "OpenID Connect Resource Owner Grant", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "direct-grant-validate-username", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "direct-grant-validate-password", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 30, + "autheticatorFlow": true, + "flowAlias": "Direct Grant - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "b5bb9bac-8047-4fd9-89be-72dbafe06fb6", + "alias": "docker auth", + "description": "Used by Docker clients to authenticate against the IDP", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "docker-http-basic-authenticator", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "28195be7-fbaf-4de0-ad9f-3dee6195cd5d", + "alias": "first broker login", + "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "review profile config", + "authenticator": "idp-review-profile", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "User creation or linking", + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 60, + "autheticatorFlow": true, + "flowAlias": "First Broker Login - Conditional Organization", + "userSetupAllowed": false + } + ] + }, + { + "id": "d198390e-11f5-4165-ba4f-0848bf786f2b", + "alias": "forms", + "description": "Username, password, otp and other auth forms.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-username-password-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Browser - Conditional 2FA", + "userSetupAllowed": false + } + ] + }, + { + "id": "952ee70d-6bf4-4f95-8845-f6f66472cb61", + "alias": "registration", + "description": "Registration flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-page-form", + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": true, + "flowAlias": "registration form", + "userSetupAllowed": false + } + ] + }, + { + "id": "739e7814-99d6-46d2-811a-93375c898df0", + "alias": "registration form", + "description": "Registration form", + "providerId": "form-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-user-creation", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "registration-password-action", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 50, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "registration-recaptcha-action", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 60, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "registration-terms-and-conditions", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 70, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "ed44db81-41c9-42e0-9ecc-d391410c1950", + "alias": "reset credentials", + "description": "Reset credentials for a user if they forgot their password or something", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "reset-credentials-choose-user", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-credential-email", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-password", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 30, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 40, + "autheticatorFlow": true, + "flowAlias": "Reset - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "c4bbf7e3-a665-4340-9162-8e7bb9d8a992", + "alias": "saml ecp", + "description": "SAML ECP Profile Authentication Flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "http-basic-authenticator", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + } + ], + "authenticatorConfig": [ + { + "id": "c6f07cfd-cb00-4933-9ec0-149cbec0e590", + "alias": "browser-conditional-credential", + "config": { + "credentials": "webauthn-passwordless" + } + }, + { + "id": "fff08a97-9d58-4e89-bf01-aae999a4a977", + "alias": "create unique user config", + "config": { + "require.password.update.after.registration": "false" + } + }, + { + "id": "a9cce101-c1b2-490e-a350-2ec11ff6e9b2", + "alias": "first-broker-login-conditional-credential", + "config": { + "credentials": "webauthn-passwordless" + } + }, + { + "id": "b864fed5-e551-4cd1-928d-4c08e973c1fa", + "alias": "review profile config", + "config": { + "update.profile.on.first.login": "missing" + } + } + ], + "requiredActions": [ + { + "alias": "CONFIGURE_TOTP", + "name": "Configure OTP", + "providerId": "CONFIGURE_TOTP", + "enabled": true, + "defaultAction": false, + "priority": 10, + "config": {} + }, + { + "alias": "TERMS_AND_CONDITIONS", + "name": "Terms and Conditions", + "providerId": "TERMS_AND_CONDITIONS", + "enabled": false, + "defaultAction": false, + "priority": 20, + "config": {} + }, + { + "alias": "UPDATE_PASSWORD", + "name": "Update Password", + "providerId": "UPDATE_PASSWORD", + "enabled": true, + "defaultAction": false, + "priority": 30, + "config": {} + }, + { + "alias": "UPDATE_PROFILE", + "name": "Update Profile", + "providerId": "UPDATE_PROFILE", + "enabled": true, + "defaultAction": false, + "priority": 40, + "config": {} + }, + { + "alias": "VERIFY_EMAIL", + "name": "Verify Email", + "providerId": "VERIFY_EMAIL", + "enabled": true, + "defaultAction": false, + "priority": 50, + "config": {} + }, + { + "alias": "delete_account", + "name": "Delete Account", + "providerId": "delete_account", + "enabled": false, + "defaultAction": false, + "priority": 60, + "config": {} + }, + { + "alias": "UPDATE_EMAIL", + "name": "Update Email", + "providerId": "UPDATE_EMAIL", + "enabled": false, + "defaultAction": false, + "priority": 70, + "config": {} + }, + { + "alias": "webauthn-register", + "name": "Webauthn Register", + "providerId": "webauthn-register", + "enabled": true, + "defaultAction": false, + "priority": 80, + "config": {} + }, + { + "alias": "webauthn-register-passwordless", + "name": "Webauthn Register Passwordless", + "providerId": "webauthn-register-passwordless", + "enabled": true, + "defaultAction": false, + "priority": 90, + "config": {} + }, + { + "alias": "VERIFY_PROFILE", + "name": "Verify Profile", + "providerId": "VERIFY_PROFILE", + "enabled": true, + "defaultAction": false, + "priority": 100, + "config": {} + }, + { + "alias": "delete_credential", + "name": "Delete Credential", + "providerId": "delete_credential", + "enabled": true, + "defaultAction": false, + "priority": 110, + "config": {} + }, + { + "alias": "idp_link", + "name": "Linking Identity Provider", + "providerId": "idp_link", + "enabled": true, + "defaultAction": false, + "priority": 120, + "config": {} + }, + { + "alias": "CONFIGURE_RECOVERY_AUTHN_CODES", + "name": "Recovery Authentication Codes", + "providerId": "CONFIGURE_RECOVERY_AUTHN_CODES", + "enabled": true, + "defaultAction": false, + "priority": 130, + "config": {} + }, + { + "alias": "update_user_locale", + "name": "Update User Locale", + "providerId": "update_user_locale", + "enabled": true, + "defaultAction": false, + "priority": 1000, + "config": {} + } + ], + "browserFlow": "browser", + "registrationFlow": "registration", + "directGrantFlow": "direct grant", + "resetCredentialsFlow": "reset credentials", + "clientAuthenticationFlow": "clients", + "dockerAuthenticationFlow": "docker auth", + "firstBrokerLoginFlow": "first broker login", + "attributes": { + "cibaBackchannelTokenDeliveryMode": "poll", + "cibaExpiresIn": "120", + "cibaAuthRequestedUserHint": "login_hint", + "oauth2DeviceCodeLifespan": "600", + "oauth2DevicePollingInterval": "5", + "parRequestUriLifespan": "60", + "cibaInterval": "5", + "realmReusableOtpCode": "false" + }, + "keycloakVersion": "26.4.2", + "userManagedAccessAllowed": false, + "organizationsEnabled": false, + "verifiableCredentialsEnabled": false, + "adminPermissionsEnabled": false, + "clientProfiles": { + "profiles": [] + }, + "clientPolicies": { + "policies": [] + } +} diff --git a/packages/api/dev/postgres/initdb/keycloak.sql b/packages/api/dev/postgres/initdb/keycloak.sql index 8f054dc..f90527b 100644 --- a/packages/api/dev/postgres/initdb/keycloak.sql +++ b/packages/api/dev/postgres/initdb/keycloak.sql @@ -21,3 +21,5 @@ CREATE DATABASE keycloak -- replace Frontend redirect URLS in realm-export.json -- SET NODE_ENV=production when running on server -- SET DEFAULT_PERSISSIONS for webapi user +-- add backend to allowed redirect urls in forntenc kc-client +-- fix web origins for kc-clients diff --git a/packages/api/package.json b/packages/api/package.json index abb0f5b..6db66e5 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -3,38 +3,34 @@ "version": "1.0.0", "scripts": { "start": "node dist/index.js", - "build": "tsc -p .", - "dev": "run-script-os", - "dev:win32": "wsl -- bash -ic 'pnpm run dev:linux'", - "dev:linux": "./scripts/dev.sh" + "build": "tsc -p ." }, "type": "module", "packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a", "private": true, "devDependencies": { - "@types/connect-pg-simple": "^7.0.3", "@types/cors": "^2.8.19", - "@types/express": "^5.0.6", + "@types/connect-pg-simple": "^7.0.3", + "@types/express": "^5.0.5", "@types/express-session": "^1.18.2", - "@types/node": "^24.10.1", + "@types/node": "^24.9.2", "@types/pg": "^8.15.6", - "dotenv": "^17.2.3", - "prisma": "^7.1.0", - "run-script-os": "^1.1.6", - "tsx": "^4.21.0", + "prisma": "^7.0.1", + "tsx": "^4.20.6", "typescript": "~5.9.3" }, "dependencies": { - "@keycloak/keycloak-admin-client": "^26.4.7", - "@prisma/adapter-pg": "^7.1.0", - "@prisma/client": "^7.1.0", + "cors": "^2.8.5", + "rxjs": "~7.8.2", + "@keycloak/keycloak-admin-client": "^26.4.4", + "@prisma/adapter-pg": "^7.0.1", + "@prisma/client": "^7.0.1", "@tsoa/runtime": "^6.6.0", "connect-pg-simple": "^10.0.0", - "cors": "^2.8.5", - "express": "^5.2.1", + "dotenv": "^17.2.3", + "express": "^5.1.0", "express-session": "^1.18.2", "keycloak-connect": "^26.1.1", - "pg": "^8.16.3", - "rxjs": "~7.8.2" + "pg": "^8.16.3" } } diff --git a/packages/api/src/controllers/membersController.ts b/packages/api/src/controllers/membersController.ts index d5ef676..9a5c475 100644 --- a/packages/api/src/controllers/membersController.ts +++ b/packages/api/src/controllers/membersController.ts @@ -13,10 +13,10 @@ import { SuccessResponse, } from "@tsoa/runtime"; import express from "express"; +import { Claim } from "../dtos/claim.js"; +import type { Member, MemberCreateArgs } from "../dtos/member.js"; import { inject } from "../infrastructure/di/index.js"; import { ErrorStates } from "../infrastructure/errorStates.js"; -import { Claim } from "../models/claim.js"; -import type { Member, MemberCreateArgs } from "../models/member.js"; import { KC_SECURITY_NAME } from "../services/keycloak/user/index.js"; import { MembersService } from "../services/membersService.js"; diff --git a/packages/api/src/controllers/usersController.ts b/packages/api/src/controllers/usersController.ts index 2ca1c0f..2c1ed6a 100644 --- a/packages/api/src/controllers/usersController.ts +++ b/packages/api/src/controllers/usersController.ts @@ -9,9 +9,9 @@ import { Security, SuccessResponse, } from "@tsoa/runtime"; +import { Claim } from "../dtos/claim.js"; +import { type User } from "../dtos/user.js"; import { inject } from "../infrastructure/di/index.js"; -import { Claim } from "../models/claim.js"; -import { type User } from "../models/user.js"; import { KC_SECURITY_NAME } from "../services/keycloak/user/index.js"; import { UserService } from "../services/userService.js"; diff --git a/packages/api/src/models/claim.ts b/packages/api/src/dtos/claim.ts similarity index 100% rename from packages/api/src/models/claim.ts rename to packages/api/src/dtos/claim.ts diff --git a/packages/api/src/models/member.ts b/packages/api/src/dtos/member.ts similarity index 62% rename from packages/api/src/models/member.ts rename to packages/api/src/dtos/member.ts index 6a736ac..d47cf34 100644 --- a/packages/api/src/models/member.ts +++ b/packages/api/src/dtos/member.ts @@ -1,20 +1,20 @@ import { type MemberModel as DbMember } from "../generated/prisma/models.js"; export interface Member { - id?: string | null; - vorname?: string | null; - nachname?: string | null; - geburtsdatum?: Date | null; - geburtsort?: string | null; - geschlecht?: string | null; - passnummer?: string | null; - uvertrag?: boolean | null; - verein?: boolean | null; - graduierung?: string | null; - letztePruefung?: Date | null; - kontakt?: string | null; - kuendigungzum?: Date | null; - loeschenam?: string | null; + id: string | null; + vorname: string | null; + nachname: string | null; + geburtsdatum: Date | null; + geburtsort: string | null; + geschlecht: string | null; + passnummer: string | null; + uvertrag: boolean | null; + verein: boolean | null; + graduierung: string | null; + letztePruefung: Date | null; + kontakt: string | null; + kuendigungzum: Date | null; + loeschenam: Date | null; } export type MemberCreateArgs = Omit; @@ -34,5 +34,6 @@ export function mapDbMemberToMember(dbMember: DbMember): Member { passnummer: dbMember.passnummer, uvertrag: dbMember.uvertrag, verein: dbMember.verein, + loeschenam: new Date(), //TODO }; } diff --git a/packages/api/src/models/topic.ts b/packages/api/src/dtos/topic.ts similarity index 100% rename from packages/api/src/models/topic.ts rename to packages/api/src/dtos/topic.ts diff --git a/packages/api/src/models/user.ts b/packages/api/src/dtos/user.ts similarity index 100% rename from packages/api/src/models/user.ts rename to packages/api/src/dtos/user.ts diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 3c37c92..a9f8bd4 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -14,7 +14,6 @@ const app = express(); app.use(sessionHandler); app.use(keycloak.middleware()); -// console.log("not using", keycloak.middleware); app.use(express.urlencoded({ extended: true })); app.use(express.json()); @@ -25,6 +24,8 @@ app.use( "https://tcc-1-ev-intern.web.app", "http://localhost:4200", "https://localhost:4200", + "http://localhost:3000", + "http://localhost:8080", ], //TODO reevaluate }), diff --git a/packages/api/src/middleware/authentication.ts b/packages/api/src/middleware/authentication.ts index 9c814cd..03b3326 100644 --- a/packages/api/src/middleware/authentication.ts +++ b/packages/api/src/middleware/authentication.ts @@ -8,8 +8,11 @@ function promisifyMiddleware( response?: Response, ): Promise { return new Promise((resolve, reject) => { - middleware(request, response || ({} as any), (result: any) => { - result instanceof Error ? reject(result) : resolve(result); + middleware(request, response || ({} as any), (next_result: any) => { + console.dir(next_result); + next_result instanceof Error + ? reject(next_result) + : resolve(next_result); }); }); } @@ -20,10 +23,15 @@ async function doKeycloakAuth( response?: Response, ): Promise { if (roles && roles.length > 0) { - return await promisifyMiddleware( - request, - keycloak.enforcer(roles?.map(role => `realm:${role}`)), + const grant = await keycloak.getGrant(request, response ?? ({} as any)); + const allowed = roles.every(role => + grant.access_token?.hasRealmRole(role), ); + if (allowed) { + return Promise.resolve(); + } else { + return Promise.reject(httpError(403, "Forbidden")); + } } else { return await promisifyMiddleware(request, keycloak.protect(), response); } @@ -35,12 +43,21 @@ export async function expressAuthentication( roles?: string[], response?: Response, ): Promise { + if (request.method === "OPTIONS") { + return Promise.resolve(); + } switch (securityName) { case KC_SECURITY_NAME: - return doKeycloakAuth(request, roles, response); + return await doKeycloakAuth(request, roles, response); case undefined: return Promise.resolve(); default: - return Promise.reject("Unknown security name"); + return Promise.reject(httpError(400, "Unknown security name")); } } + +function httpError(status: number, message: string) { + const err: any = new Error(message); + err.status = status; + return err; +} diff --git a/packages/api/src/services/db/prisma.ts b/packages/api/src/services/db/prisma.ts index b305d95..a395231 100644 --- a/packages/api/src/services/db/prisma.ts +++ b/packages/api/src/services/db/prisma.ts @@ -4,10 +4,10 @@ import { PrismaClient } from "../../generated/prisma/client.js"; import { Injectable } from "../../infrastructure/di/injectable-decorator.js"; type ExtendedClient = ReturnType; -type TransactionClient = Omit< - ExtendedClient, - "$connect" | "$disconnect" | "$on" | "$transaction" | "$extends" ->; +// type TransactionClient = Omit< +// ExtendedClient, +// "$connect" | "$disconnect" | "$on" | "$transaction" | "$extends" +// >; export type SafeClient = Omit< ExtendedClient, @@ -58,13 +58,8 @@ export class DatabaseService { command: (prisma: SafeClient) => Promise, request: Request, ): Promise { - const transaction = (request as any).transaction as SafeClient; + const transaction = + (request as any).transaction ?? (this.prismaClient as SafeClient); return await command(transaction); } - - public async createTransaction( - action: (prisma: TransactionClient) => Promise, - ) { - await this.prismaClient.$transaction(action); - } } diff --git a/packages/api/src/services/keycloak/admin/keycloak-admin.ts b/packages/api/src/services/keycloak/admin/keycloak-admin.ts index cc72282..859e4d4 100644 --- a/packages/api/src/services/keycloak/admin/keycloak-admin.ts +++ b/packages/api/src/services/keycloak/admin/keycloak-admin.ts @@ -3,8 +3,8 @@ import kcClientConfig from "./nodejs-api.json" with { type: "json" }; import KeycloakAdminClient from "@keycloak/keycloak-admin-client"; import type RoleRepresentation from "@keycloak/keycloak-admin-client/lib/defs/roleRepresentation.js"; -import { Claim } from "../../../models/claim.js"; -import { type User } from "../../../models/user.js"; +import { Claim } from "../../../dtos/claim.js"; +import { type User } from "../../../dtos/user.js"; @Injectable() export class KeycloakAdmin { diff --git a/packages/api/src/services/keycloak/user/keycloak.json b/packages/api/src/services/keycloak/user/keycloak.json index 1911745..44a2885 100644 --- a/packages/api/src/services/keycloak/user/keycloak.json +++ b/packages/api/src/services/keycloak/user/keycloak.json @@ -1,10 +1,8 @@ { - "realm": "taekwondo", - "auth-server-url": "https://localhost:8080", - "ssl-required": "external", - "resource": "nodejs-api", - "credentials": { - "secret": "devsecret" - }, - "confidential-port": 0 + "realm": "taekwondo", + "auth-server-url": "http://localhost:8080/", + "ssl-required": "external", + "resource": "angular-frontend", + "public-client": true, + "confidential-port": 0 } diff --git a/packages/api/src/services/membersService.ts b/packages/api/src/services/membersService.ts index fbbe41c..9705eff 100644 --- a/packages/api/src/services/membersService.ts +++ b/packages/api/src/services/membersService.ts @@ -1,11 +1,11 @@ import express from "express"; -import { inject, Injectable } from "../infrastructure/di/index.js"; -import { ErrorStates } from "../infrastructure/errorStates.js"; import { type Member, type MemberCreateArgs, mapDbMemberToMember, -} from "../models/member.js"; +} from "../dtos/member.js"; +import { inject, Injectable } from "../infrastructure/di/index.js"; +import { ErrorStates } from "../infrastructure/errorStates.js"; import { DatabaseService } from "./db/prisma.js"; @Injectable() @@ -43,6 +43,10 @@ export class MembersService { createArgs: MemberCreateArgs, request: express.Request, ): Promise { + const x: MemberCreateArgs = { + ...createArgs, + geburtsdatum: createArgs.geburtsdatum ?? null, + }; const newMember = await this.database.doRequest( async prisma => await prisma.member.create({ data: createArgs }), request, diff --git a/packages/api/src/services/userService.ts b/packages/api/src/services/userService.ts index 0341af4..dfa3e05 100644 --- a/packages/api/src/services/userService.ts +++ b/packages/api/src/services/userService.ts @@ -1,6 +1,6 @@ +import { Claim } from "../dtos/claim.js"; +import { type User } from "../dtos/user.js"; import { inject } from "../infrastructure/di/index.js"; -import { Claim } from "../models/claim.js"; -import { type User } from "../models/user.js"; import { KeycloakAdmin } from "./keycloak/admin/index.js"; export class UserService { diff --git a/packages/frontend/.prettierrc b/packages/frontend/.prettierrc new file mode 100644 index 0000000..01779e7 --- /dev/null +++ b/packages/frontend/.prettierrc @@ -0,0 +1,14 @@ +{ + "tabWidth": 4, + "arrowParens": "avoid", + "bracketSameLine": true, + "semi": true, + "overrides": [ + { + "files": "*.yml", + "options": { + "tabWidth": 2 + } + } + ] +} diff --git a/packages/frontend/package.json b/packages/frontend/package.json index eb973a4..3f30f3c 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -29,9 +29,13 @@ "@angular/core": "^20.3.15", "@angular/forms": "^20.3.15", "@angular/material": "20.2.11", + "@angular/material-date-fns-adapter": "^21.0.2", "@angular/platform-browser": "^20.3.15", "@angular/router": "^20.3.15", + "@date-fns/tz": "^1.4.1", + "@date-fns/utc": "^2.1.1", "@oazapfts/runtime": "^1.0.4", + "date-fns": "^4.1.0", "keycloak-angular": "^20.0.0", "keycloak-js": "^26.2.1", "rxjs": "~7.8.2", diff --git a/packages/frontend/src/app/app.config.ts b/packages/frontend/src/app/app.config.ts index 30d87b7..724943e 100644 --- a/packages/frontend/src/app/app.config.ts +++ b/packages/frontend/src/app/app.config.ts @@ -1,53 +1,85 @@ import { - ApplicationConfig, - isDevMode, - provideBrowserGlobalErrorListeners, - provideZoneChangeDetection, + ApplicationConfig, + LOCALE_ID, + provideBrowserGlobalErrorListeners, + provideZoneChangeDetection, } from '@angular/core'; import { - PreloadAllModules, - provideRouter, - withComponentInputBinding, - withPreloading, + PreloadAllModules, + provideRouter, + withComponentInputBinding, + withPreloading, } from '@angular/router'; import { - AutoRefreshTokenService, - createInterceptorCondition, - INCLUDE_BEARER_TOKEN_INTERCEPTOR_CONFIG, - IncludeBearerTokenCondition, - provideKeycloak, - UserActivityService, - withAutoRefreshToken, + AutoRefreshTokenService, + createInterceptorCondition, + INCLUDE_BEARER_TOKEN_INTERCEPTOR_CONFIG, + IncludeBearerTokenCondition, + provideKeycloak, + UserActivityService, + withAutoRefreshToken, } from 'keycloak-angular'; +import { + DateFnsAdapter, + MAT_DATE_FNS_FORMATS, +} from '@angular/material-date-fns-adapter'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, +} from '@angular/material/core'; +import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; +import { de } from 'date-fns/locale'; import { routes } from './app.routes'; export const appConfig: ApplicationConfig = { - providers: [ - provideRouter(routes, withPreloading(PreloadAllModules), withComponentInputBinding()), - provideBrowserGlobalErrorListeners(), - provideZoneChangeDetection({ eventCoalescing: true }), - provideKeycloak({ - config: { - url: isDevMode() ? 'http://localhost:8080/' : 'https://keycloak.toni714.de:8443/', - realm: 'taekwondo', - clientId: 'angular-frontend', - }, - initOptions: { - onLoad: 'check-sso', - silentCheckSsoRedirectUri: window.location.origin + '/silent-check-sso.html', - }, - features: [withAutoRefreshToken({ sessionTimeout: 600000 })], - providers: [AutoRefreshTokenService, UserActivityService], - }), - { - provide: INCLUDE_BEARER_TOKEN_INTERCEPTOR_CONFIG, - useValue: [ - createInterceptorCondition({ - urlPattern: isDevMode()? /^http:\/\/localhost:3000.*$/ : /^https:\/\/tkd-api\.toni714\.de.*$/, + providers: [ + provideRouter( + routes, + withPreloading(PreloadAllModules), + withComponentInputBinding(), + ), + provideBrowserGlobalErrorListeners(), + provideZoneChangeDetection({ eventCoalescing: true }), + provideKeycloak({ + config: { + url: true + ? 'http://localhost:8080/' + : 'https://keycloak.toni714.de:8443/', + realm: 'taekwondo', + clientId: 'angular-frontend', + }, + initOptions: { + onLoad: 'check-sso', + silentCheckSsoRedirectUri: + window.location.origin + '/silent-check-sso.html', + }, + features: [withAutoRefreshToken({ sessionTimeout: 600000 })], + providers: [AutoRefreshTokenService, UserActivityService], }), - ], - }, - ], + { + provide: INCLUDE_BEARER_TOKEN_INTERCEPTOR_CONFIG, + useValue: [ + createInterceptorCondition({ + urlPattern: true + ? /^http:\/\/localhost:(3000|8080)\/.*$/ + : /^https:\/\/tkd-api\.toni714\.de\/.*$/, + }), + ], + }, + { + provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, + useValue: { appearance: 'outline', subscriptSizing: 'dynamic' }, + }, + { provide: LOCALE_ID, useValue: 'de' }, + { + provide: DateAdapter, + useClass: DateFnsAdapter, + deps: [MAT_DATE_LOCALE], + }, + { provide: MAT_DATE_FORMATS, useValue: MAT_DATE_FNS_FORMATS }, + { provide: MAT_DATE_LOCALE, useValue: de }, + ], }; diff --git a/packages/frontend/src/app/app.routes.ts b/packages/frontend/src/app/app.routes.ts index 19042d2..4669c48 100644 --- a/packages/frontend/src/app/app.routes.ts +++ b/packages/frontend/src/app/app.routes.ts @@ -1,55 +1,74 @@ import { inject } from '@angular/core'; import { - ActivatedRouteSnapshot, - CanActivateFn, - Router, - RouterStateSnapshot, - Routes, - UrlTree, + ActivatedRouteSnapshot, + CanActivateFn, + Router, + RouterStateSnapshot, + Routes, + UrlTree, } from '@angular/router'; import { AuthGuardData, createAuthGuard } from 'keycloak-angular'; import { Login } from './components/login/login'; import { MissingPage } from './components/missing-page/missing-page'; +import { Claim } from './generated-api/api'; export const roles = { - UserAdmin: 'useradmin', - MemberAdmin: 'memberadmin', + UserAdmin: 'useradmin', + MemberAdmin: 'memberadmin', }; -function requireRoles(roles: string[]=[], any: boolean = false): CanActivateFn { - const isAllowed = async ( - _: ActivatedRouteSnapshot, - __: RouterStateSnapshot, - authData: AuthGuardData - ): Promise => { - const { authenticated, grantedRoles } = authData; - const allRoles = Object.values(grantedRoles).flat(); +function requireRoles( + roles: string[] = [], + any: boolean = false, +): CanActivateFn { + const isAllowed = async ( + _: ActivatedRouteSnapshot, + __: RouterStateSnapshot, + authData: AuthGuardData, + ): Promise => { + const { authenticated, grantedRoles } = authData; + const allRoles = Object.values(grantedRoles).flat(); - const hasRequiredRoles = any - ? roles.some((role) => allRoles.includes(role)) - : roles.every((role) => allRoles.includes(role)); + const hasRequiredRoles = any + ? roles.some(role => allRoles.includes(role)) + : roles.every(role => allRoles.includes(role)); - if (authenticated && hasRequiredRoles) { - return true; - } - const router = inject(Router); - return router.parseUrl('/login'); - }; + if (authenticated && hasRequiredRoles) { + return true; + } + const router = inject(Router); + return router.parseUrl('/login'); + }; - return createAuthGuard(isAllowed); + return createAuthGuard(isAllowed); } export const routes: Routes = [ - { path: 'login', component: Login }, - { - path: '', - loadComponent: () => import('./components/home/home').then((mod) => mod.Home), - canActivate: [requireRoles()], - }, - { - path: 'home', - loadComponent: () => import('./components/home/home').then((mod) => mod.Home), - canActivate: [requireRoles()], - }, - { path: '**', component: MissingPage }, + { path: 'login', component: Login }, + { + path: '', + loadComponent: () => + import('./components/home/home').then(mod => mod.Home), + canActivate: [requireRoles()], + }, + { + path: 'home', + loadComponent: () => + import('./components/home/home').then(mod => mod.Home), + canActivate: [requireRoles()], + }, + { + path: 'test', + loadComponent: () => + import('./components/test/test').then(mod => mod.Test), + }, + { + path: 'list', + loadComponent: () => + import('./components/view-members/view-members').then( + mod => mod.ViewMembers, + ), + canActivate: [requireRoles([Claim.Memberadmin])], + }, + { path: '**', component: MissingPage }, ]; diff --git a/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.html b/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.html new file mode 100644 index 0000000..863d6f4 --- /dev/null +++ b/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.html @@ -0,0 +1,13 @@ +
+

Name: {{ member.vorname }} {{ member.nachname }}

+

Passnummer: {{ member.passnummer }}

+

Geburtsdatum: {{ member.geburtsdatum??undefined | datePipe }}

+ + Kündigun zum + + DD.MM.YYYY + + + + +
diff --git a/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.scss b/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.scss new file mode 100644 index 0000000..5f27c09 --- /dev/null +++ b/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.scss @@ -0,0 +1,11 @@ +form{ + display: flex; + flex-direction: column; + justify-content: space-evenly; + align-items: center; + height: 100%; +} + +form > *{ + margin-top: 20px; +} diff --git a/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.spec.ts b/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.spec.ts new file mode 100644 index 0000000..37480b8 --- /dev/null +++ b/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DeleteMemberDialogComponent } from './delete-member-dialog.component.js'; + +describe('DeleteMemberDialogComponent', () => { + let component: DeleteMemberDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [DeleteMemberDialogComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(DeleteMemberDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.ts b/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.ts new file mode 100644 index 0000000..e078ca4 --- /dev/null +++ b/packages/frontend/src/app/components/delete-member-dialog/delete-member-dialog.component.ts @@ -0,0 +1,57 @@ +import { Component, Inject } from '@angular/core'; +import { + FormControl, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatOptionModule } from '@angular/material/core'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import * as api from '../../generated-api/api'; +import { DatePipePipe } from '../../pipes/date-pipe.pipe.js'; +import { EditMemberDialogComponent } from '../edit-member-dialog/edit-member-dialog.component.js'; + +@Component({ + selector: 'app-delete-member-dialog', + standalone: true, + imports: [ + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + MatCheckboxModule, + MatButtonModule, + MatSelectModule, + MatOptionModule, + MatDatepickerModule, + DatePipePipe, + ], + templateUrl: './delete-member-dialog.component.html', + styleUrl: './delete-member-dialog.component.scss', +}) +export class DeleteMemberDialogComponent { + form: FormGroup; + member: api.Member; + constructor( + @Inject(MAT_DIALOG_DATA) public data: { member: api.Member }, + private dialogRef: MatDialogRef, + ) { + this.member = data.member; + this.form = new FormGroup({ + kuendigungzum: new FormControl('', [Validators.required]), + }); + } + + async submit() { + await api.scheduleDeletion( + this.member.id!, + this.form.controls['kuendigungzum'].value, + ); + this.dialogRef.close(); + } +} diff --git a/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.html b/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.html new file mode 100644 index 0000000..bdb1335 --- /dev/null +++ b/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.html @@ -0,0 +1,44 @@ +
+ + Vorname + + + + Nachname + + + + Geschlecht + + + + Passnummer + + + + Geburtsdatum + + DD.MM.YYYY + + + + + Geburtsort + + + + Unterrichtsvertrag? + + Ja + Nein + + + + Vereinsmitglied? + + Ja + Nein + + + +
diff --git a/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.scss b/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.scss new file mode 100644 index 0000000..d0e55d0 --- /dev/null +++ b/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.scss @@ -0,0 +1,8 @@ +form{ + display: flex; + flex-direction: column; +} + +form > *{ + margin-top: 20px; +} diff --git a/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.spec.ts b/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.spec.ts new file mode 100644 index 0000000..31ed33c --- /dev/null +++ b/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditMemberDialogComponent } from './edit-member-dialog.component.js'; + +describe('EditMemberDialogComponent', () => { + let component: EditMemberDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [EditMemberDialogComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(EditMemberDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.ts b/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.ts new file mode 100644 index 0000000..2d0b8e4 --- /dev/null +++ b/packages/frontend/src/app/components/edit-member-dialog/edit-member-dialog.component.ts @@ -0,0 +1,47 @@ +import { Component, Inject } from '@angular/core'; +import { FormGroup, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatOptionModule } from '@angular/material/core'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import * as api from '../../generated-api/api'; +import { MemberDtoHelper } from '../../util/member.js'; + +@Component({ + selector: 'app-edit-member-dialog', + standalone: true, + imports: [ + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + MatCheckboxModule, + MatButtonModule, + MatSelectModule, + MatOptionModule, + MatDatepickerModule, + ], + templateUrl: './edit-member-dialog.component.html', + styleUrl: './edit-member-dialog.component.scss', +}) +export class EditMemberDialogComponent { + form: FormGroup; + constructor( + @Inject(MAT_DIALOG_DATA) public data: { member: api.Member }, + private memberDtoHelper: MemberDtoHelper, + private dialogRef: MatDialogRef, + ) { + this.form = this.memberDtoHelper.newMemberForm(data.member); + } + + submit() { + const member: api.Member = this.memberDtoHelper.memberFromForm( + this.form, + ); + api.updateMember(member); + this.dialogRef.close(); + } +} diff --git a/packages/frontend/src/app/components/missing-page/missing-page.html b/packages/frontend/src/app/components/missing-page/missing-page.html index 5f1f15c..94eada0 100644 --- a/packages/frontend/src/app/components/missing-page/missing-page.html +++ b/packages/frontend/src/app/components/missing-page/missing-page.html @@ -1 +1,6 @@ -

missing-page works!

+

Diese Seite existiert nicht!

+@if(this.auth.loggedIn()){ + Zur Starteite +}@else { + Zur Login Seite +} diff --git a/packages/frontend/src/app/components/missing-page/missing-page.ts b/packages/frontend/src/app/components/missing-page/missing-page.ts index 945845f..27ab21d 100644 --- a/packages/frontend/src/app/components/missing-page/missing-page.ts +++ b/packages/frontend/src/app/components/missing-page/missing-page.ts @@ -1,11 +1,14 @@ -import { Component } from '@angular/core'; +import { Component, inject } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { RouterModule } from '@angular/router'; +import { Authentication } from '../../services/authentication'; @Component({ - selector: 'app-missing-page', - imports: [], - templateUrl: './missing-page.html', - styleUrl: './missing-page.scss', + selector: 'app-missing-page', + imports: [MatButtonModule, RouterModule], + templateUrl: './missing-page.html', + styleUrl: './missing-page.scss', }) export class MissingPage { - + protected readonly auth = inject(Authentication); } diff --git a/packages/frontend/src/app/components/new-member/new-member.component.html b/packages/frontend/src/app/components/new-member/new-member.component.html new file mode 100644 index 0000000..d5edacb --- /dev/null +++ b/packages/frontend/src/app/components/new-member/new-member.component.html @@ -0,0 +1,39 @@ +

Neues Mitglied anlegen

+
+ + Vorname + + + + Nachname + + + + Geschlecht + + + + Geburtsdatum + + DD.MM.YYYY + + + + + Geburtsort + + + Unterrichtsvertrag Abgegeben? + Verein Beigetreten? + + Passnummer (falls vorhanden) + + + + Kontakt + + + +
diff --git a/packages/frontend/src/app/components/new-member/new-member.component.scss b/packages/frontend/src/app/components/new-member/new-member.component.scss new file mode 100644 index 0000000..f064303 --- /dev/null +++ b/packages/frontend/src/app/components/new-member/new-member.component.scss @@ -0,0 +1,9 @@ +form { + display: flex; + flex-direction: column; + align-items: center; +} + +h1 { + text-align: center; +} diff --git a/packages/frontend/src/app/components/new-member/new-member.component.spec.ts b/packages/frontend/src/app/components/new-member/new-member.component.spec.ts new file mode 100644 index 0000000..37475a7 --- /dev/null +++ b/packages/frontend/src/app/components/new-member/new-member.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NewMemberComponent } from './new-member.component.js'; + +describe('NewMemberComponent', () => { + let component: NewMemberComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [NewMemberComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(NewMemberComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/packages/frontend/src/app/components/new-member/new-member.component.ts b/packages/frontend/src/app/components/new-member/new-member.component.ts new file mode 100644 index 0000000..48db2bb --- /dev/null +++ b/packages/frontend/src/app/components/new-member/new-member.component.ts @@ -0,0 +1,49 @@ +import { Component, inject } from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatDialogRef } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import * as api from '../../generated-api/api.js'; +import { MemberDtoHelper } from '../../util/member.js'; + +@Component({ + selector: 'app-new-member', + standalone: true, + providers: [], + imports: [ + ReactiveFormsModule, + MatFormFieldModule, + MatDatepickerModule, + MatInputModule, + MatCheckboxModule, + MatButtonModule, + ], + templateUrl: './new-member.component.html', + styleUrl: './new-member.component.scss', +}) +export class NewMemberComponent { + private readonly memberDtoHelper = inject(MemberDtoHelper); + + constructor() {} + memberForm = this.memberDtoHelper.newMemberForm(); + private dialogRef: MatDialogRef = inject( + MatDialogRef, + ); + + onSubmit() { + const newMember: api.PickMemberExcludeKeyofMemberIdOrLoeschenam = + this.memberDtoHelper.newMemberFromForm(this.memberForm); + + api.createMember(newMember) + .then(() => { + console.log('Successfully added Member'); + this.dialogRef.close(); + }) + .catch(e => { + console.error('Error adding member', e); + }); + } +} diff --git a/packages/frontend/src/app/components/test/test.html b/packages/frontend/src/app/components/test/test.html index 941f267..ee8fb4f 100644 --- a/packages/frontend/src/app/components/test/test.html +++ b/packages/frontend/src/app/components/test/test.html @@ -1 +1,17 @@ -

test works!

+

Testeite für interne Berechtigung

+

API: {{apiStatus()}}

+

Auth: {{authTest()}}

+Claim: +
    + @let claims = this.auth.claims(); + @if(claims) { +
    +{{claims | json}}
    +
    + } +
+
+
+{{this.auth.userInfo() | json}}
+
+
diff --git a/packages/frontend/src/app/components/test/test.ts b/packages/frontend/src/app/components/test/test.ts index 2dd40d0..1648abc 100644 --- a/packages/frontend/src/app/components/test/test.ts +++ b/packages/frontend/src/app/components/test/test.ts @@ -1,11 +1,42 @@ -import { Component } from '@angular/core'; +import { JsonPipe } from '@angular/common'; +import { Component, effect, inject, signal } from '@angular/core'; +import * as api from '../../generated-api/api'; +import { Authentication } from '../../services/authentication'; @Component({ selector: 'app-test', - imports: [], + imports: [JsonPipe], templateUrl: './test.html', styleUrl: './test.scss', }) export class Test { + protected auth = inject(Authentication); + protected apiStatus = signal("Waiting"); + protected authTest = signal("Waiting"); + + public constructor(){ + effect(()=>{ + const loggedIn=this.auth.loggedIn(); + if(!loggedIn){ + this.apiStatus.set("N/A - not logged in"); + this.authTest.set("N/A - not logged in"); + return; + } + + this.apiStatus.set("Waiting for API"); + this.authTest.set("Waiting for API"); + api.getOk().then((status) => { + this.apiStatus.set("Ok"); + }).catch((e) => { + this.apiStatus.set("Error"); + }); + api.getAuth().then((response) => { + this.authTest.set("Ok"); + }).catch((e) => { + this.authTest.set(e); + }); + }) + } + } diff --git a/packages/frontend/src/app/components/view-members/view-members.html b/packages/frontend/src/app/components/view-members/view-members.html new file mode 100644 index 0000000..d61bf1b --- /dev/null +++ b/packages/frontend/src/app/components/view-members/view-members.html @@ -0,0 +1,125 @@ +

Mitglieder & Sportlerübersicht

+ +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bearb. + + Entf. + + Vorname + + Nachname + + Geschlecht{{ element.geschlecht }}Passnummer + {{ element.passnummer | nobreakHyphen }} + Geburtsdatum + {{ element.geburtsdatum | datePipe }} + Geburtsort{{ element.geburtsort }}Unterrichtsvertrag + + + Vereinsmitgliedschaft + + + Kontakt{{ element.kontakt }}Kündigung zum + {{ (element.kuendigungzum | datePipe) ?? "-" }} +
+
diff --git a/packages/frontend/src/app/components/view-members/view-members.scss b/packages/frontend/src/app/components/view-members/view-members.scss new file mode 100644 index 0000000..e69de29 diff --git a/packages/frontend/src/app/components/view-members/view-members.spec.ts b/packages/frontend/src/app/components/view-members/view-members.spec.ts new file mode 100644 index 0000000..0f9ee39 --- /dev/null +++ b/packages/frontend/src/app/components/view-members/view-members.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ViewMembers } from './view-members'; + +describe('ViewMembers', () => { + let component: ViewMembers; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ViewMembers] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ViewMembers); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/packages/frontend/src/app/components/view-members/view-members.ts b/packages/frontend/src/app/components/view-members/view-members.ts new file mode 100644 index 0000000..2791556 --- /dev/null +++ b/packages/frontend/src/app/components/view-members/view-members.ts @@ -0,0 +1,115 @@ +import { AsyncPipe, NgIf } from '@angular/common'; +import { Component } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialog } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTableDataSource, MatTableModule } from '@angular/material/table'; +import { RouterModule } from '@angular/router'; +import { BehaviorSubject, firstValueFrom, from, Observable } from 'rxjs'; +import * as api from '../../generated-api/api'; +import { DatePipePipe } from '../../pipes/date-pipe.pipe.js'; +import { NobreakHyphenPipe } from '../../pipes/nobreak-hyphen.pipe.js'; +import { StylizeNamesPipe } from '../../pipes/stylize-names.pipe.js'; +import { DeleteMemberDialogComponent } from '../delete-member-dialog/delete-member-dialog.component.js'; +import { EditMemberDialogComponent } from '../edit-member-dialog/edit-member-dialog.component.js'; +import { NewMemberComponent } from '../new-member/new-member.component'; + +@Component({ + selector: 'app-view-members', + imports: [ + MatTableModule, + MatFormFieldModule, + MatInputModule, + MatIconModule, + NgIf, + StylizeNamesPipe, + NobreakHyphenPipe, + RouterModule, + MatButtonModule, + AsyncPipe, + DatePipePipe, + ], + templateUrl: './view-members.html', + styleUrl: './view-members.scss', +}) +export class ViewMembers { + async deleteMember(memberId: any) { + const dataSource = await firstValueFrom(this.dataSource$); + + const dialogRef = this.dialog.open(DeleteMemberDialogComponent, { + data: { + member: dataSource.data.find(member => member.id === memberId), + }, + hasBackdrop: true, + width: '90%', + height: '90%', + }); + + dialogRef.afterClosed().subscribe(async result => { + this.dataSource$ = this.updateData(); + }); + } + newMember() { + const dialogRef = this.dialog.open(NewMemberComponent, {}); + dialogRef.afterClosed().subscribe(() => { + this.dataSource$ = this.updateData(); + }); + } + async editMember(memberId: any) { + const dataSource = await firstValueFrom(this.dataSource$); + + const dialogRef = this.dialog.open(EditMemberDialogComponent, { + data: { + member: dataSource.data.find(member => member.id === memberId), + }, + hasBackdrop: true, + width: '90%', + height: '90%', + }); + + dialogRef.afterClosed().subscribe(async result => { + this.dataSource$ = this.updateData(); + }); + } + dataSource$: Observable> = + new BehaviorSubject(new MatTableDataSource([] as api.Member[])); + filter$: BehaviorSubject = new BehaviorSubject(''); + displayedColumns: string[] = [ + 'edit', + 'delete', + 'vorname', + 'nachname', + 'geschlecht', + 'passnummer', + 'geburtsdatum', + 'geburtsort', + 'uvertrag', + 'verein', + 'kontakt', + 'kuendigungzum', + ]; + + applyFilter(event: KeyboardEvent) { + let filterValue = (event.target as HTMLInputElement).value ?? ''; + filterValue = filterValue.trim(); + filterValue = filterValue.toLowerCase(); + this.filter$.next(filterValue); + } + constructor(private dialog: MatDialog) { + this.dataSource$ = this.updateData(); + } + + updateData() { + return from( + api.getMembers().then(members => { + let dataSource = new MatTableDataSource(members); + this.filter$.subscribe(filter => { + dataSource.filter = filter; + }); + return dataSource; + }), + ); + } +} diff --git a/packages/frontend/src/app/pipes/date-pipe.pipe.spec.ts b/packages/frontend/src/app/pipes/date-pipe.pipe.spec.ts new file mode 100644 index 0000000..9541f4e --- /dev/null +++ b/packages/frontend/src/app/pipes/date-pipe.pipe.spec.ts @@ -0,0 +1,8 @@ +import { DatePipePipe } from './date-pipe.pipe'; + +describe('DatePipePipe', () => { + it('create an instance', () => { + const pipe = new DatePipePipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/packages/frontend/src/app/pipes/date-pipe.pipe.ts b/packages/frontend/src/app/pipes/date-pipe.pipe.ts new file mode 100644 index 0000000..90324b4 --- /dev/null +++ b/packages/frontend/src/app/pipes/date-pipe.pipe.ts @@ -0,0 +1,20 @@ +import { Inject, Pipe, PipeTransform } from '@angular/core'; +import { MAT_DATE_LOCALE } from '@angular/material/core'; +import * as tz from '@date-fns/tz'; +import { format, Locale } from 'date-fns'; + +@Pipe({ + name: 'datePipe', + standalone: true +}) +export class DatePipePipe implements PipeTransform { + constructor(@Inject(MAT_DATE_LOCALE) private locale: Locale){} + + transform(value?: string): string { + if(!value) return "-"; + const date=new tz.TZDate(value!, "UTC"); + const timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone; + const zonedDate=date.withTimeZone(timeZone); + return format(zonedDate, 'P', { locale: this.locale }); + } +} diff --git a/packages/frontend/src/app/pipes/nobreak-hyphen.pipe.spec.ts b/packages/frontend/src/app/pipes/nobreak-hyphen.pipe.spec.ts new file mode 100644 index 0000000..689d819 --- /dev/null +++ b/packages/frontend/src/app/pipes/nobreak-hyphen.pipe.spec.ts @@ -0,0 +1,8 @@ +import { NobreakHyphenPipe } from './nobreak-hyphen.pipe.js'; + +describe('NobreakHyphenPipe', () => { + it('create an instance', () => { + const pipe = new NobreakHyphenPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/packages/frontend/src/app/pipes/nobreak-hyphen.pipe.ts b/packages/frontend/src/app/pipes/nobreak-hyphen.pipe.ts new file mode 100644 index 0000000..978d38e --- /dev/null +++ b/packages/frontend/src/app/pipes/nobreak-hyphen.pipe.ts @@ -0,0 +1,11 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'nobreakHyphen', + standalone: true, +}) +export class NobreakHyphenPipe implements PipeTransform { + transform(value: string): unknown { + return value?.replaceAll('-', '‑'); // second '-' is a ‑ "no-break hyphen", first is a regular hyphen + } +} diff --git a/packages/frontend/src/app/pipes/stylize-names.pipe.spec.ts b/packages/frontend/src/app/pipes/stylize-names.pipe.spec.ts new file mode 100644 index 0000000..c797d06 --- /dev/null +++ b/packages/frontend/src/app/pipes/stylize-names.pipe.spec.ts @@ -0,0 +1,8 @@ +import { StylizeNamesPipe } from './stylize-names.pipe.js'; + +describe('StylizeNamesPipe', () => { + it('create an instance', () => { + const pipe = new StylizeNamesPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/packages/frontend/src/app/pipes/stylize-names.pipe.ts b/packages/frontend/src/app/pipes/stylize-names.pipe.ts new file mode 100644 index 0000000..9a1cbc3 --- /dev/null +++ b/packages/frontend/src/app/pipes/stylize-names.pipe.ts @@ -0,0 +1,41 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'stylizeNames', + standalone: true, +}) +export class StylizeNamesPipe implements PipeTransform { + transform(input?: string): string|undefined { + if (!input) { + return input; + } + + + let formatted = ''; + formatted=this.capitalizeFirstLetters(input); + formatted=this.boldUnderscored(formatted); + return formatted; + } + + boldUnderscored(input: string): string { + const segments=input.split('_'); + for(let i=0;i=2*i+1){ + segments[2*i+1]=''+segments[2*i+1]+''; + } + } + return segments.join(''); + } + + capitalizeFirstLetters(input: string): string { + const words=input.split(' '); + for(let i=0;i(AuthenticationState.Unknown); - private readonly _userInfo = signal(null); - public readonly authenticationState = this._authenticationState.asReadonly(); - public readonly loggedIn = computed(()=>{ - return this.authenticationState() === AuthenticationState.Authenticated; - }); - public readonly userInfo = this._userInfo.asReadonly(); - - public constructor() { - effect(() => { - const event = this.keycloakSignal(); - switch (event?.type) { - case KeycloakEventType.Ready: - this._authenticationState.set( - typeEventArgs(event.args) - ? AuthenticationState.Authenticated - : AuthenticationState.Unauthenticated - ); - break; - case KeycloakEventType.AuthSuccess: - this._authenticationState.set(AuthenticationState.Authenticated); - break; - case KeycloakEventType.AuthLogout: - this._authenticationState.set(AuthenticationState.Unauthenticated); - break; - case KeycloakEventType.AuthError: - this._authenticationState.set(AuthenticationState.Unauthenticated); - break; - case KeycloakEventType.AuthRefreshError: - this._authenticationState.set(AuthenticationState.Unauthenticated); - break; - case KeycloakEventType.AuthRefreshSuccess: - this._authenticationState.set(AuthenticationState.Authenticated); - break; - case KeycloakEventType.TokenExpired: - this._authenticationState.set(AuthenticationState.Unauthenticated); - break; - default: - break; - } + private readonly keycloak = inject(Keycloak); + private readonly keycloakSignal = inject(KEYCLOAK_EVENT_SIGNAL); + private readonly _authenticationState = signal( + AuthenticationState.Unknown, + ); + private readonly _userInfo = signal(null); + private readonly _claims = signal | null>(null); + public readonly authenticationState = + this._authenticationState.asReadonly(); + public readonly loggedIn = computed(() => { + return this.authenticationState() === AuthenticationState.Authenticated; }); + public readonly userInfo = this._userInfo.asReadonly(); + public readonly claims = this._claims.asReadonly(); - effect(async () => { - const authenticationState = this.authenticationState(); - if (authenticationState !== AuthenticationState.Authenticated) { - this._userInfo.set(null); - } - const profile = await this.keycloak.loadUserProfile(); - this._userInfo.set(profile); - }); - } + public constructor() { + effect(() => { + const event = this.keycloakSignal(); - public async login(location?: string): Promise { - if(this._authenticationState() === AuthenticationState.Authenticated){ - return; + apiDefaults.headers['Authorization'] = this.keycloak.token + ? `Bearer ${this.keycloak.token}` + : undefined; + + switch (event?.type) { + case KeycloakEventType.Ready: + this._authenticationState.set( + typeEventArgs(event.args) + ? AuthenticationState.Authenticated + : AuthenticationState.Unauthenticated, + ); + break; + case KeycloakEventType.AuthSuccess: + this._authenticationState.set( + AuthenticationState.Authenticated, + ); + break; + case KeycloakEventType.AuthLogout: + this._authenticationState.set( + AuthenticationState.Unauthenticated, + ); + break; + case KeycloakEventType.AuthError: + this._authenticationState.set( + AuthenticationState.Unauthenticated, + ); + break; + case KeycloakEventType.AuthRefreshError: + this._authenticationState.set( + AuthenticationState.Unauthenticated, + ); + break; + case KeycloakEventType.AuthRefreshSuccess: + this._authenticationState.set( + AuthenticationState.Authenticated, + ); + break; + case KeycloakEventType.TokenExpired: + this._authenticationState.set( + AuthenticationState.Unauthenticated, + ); + break; + default: + break; + } + }); + + effect(async () => { + const authenticationState = this.authenticationState(); + if (authenticationState !== AuthenticationState.Authenticated) { + this._userInfo.set(null); + } + const profile = await this.keycloak.loadUserProfile(); + + const claims: Partial> = {}; + for (const claim of Object.values(Claim)) { + if (this.keycloak.hasRealmRole(claim)) { + claims[claim] = true; + } else { + claims[claim] = false; + } + } + + this._userInfo.set(profile); + this._claims.set(claims as Record); + }); } - var redirectUri = location - ? `${window.location.origin}/${location}` - : `${window.location.origin}/login`; - return await this.keycloak.login({ - redirectUri: redirectUri, - locale: 'de-DE', - }); - } + public async login(location?: string): Promise { + if (this._authenticationState() === AuthenticationState.Authenticated) { + return; + } - public async logout(): Promise { - return await this.keycloak.logout({ redirectUri: window.location.origin + '/login' }); - } + var redirectUri = location + ? `${window.location.origin}/${location}` + : `${window.location.origin}/login`; + return await this.keycloak.login({ + redirectUri: redirectUri, + locale: 'de-DE', + }); + } + + public async logout(): Promise { + return await this.keycloak.logout({ + redirectUri: window.location.origin + '/login', + }); + } } diff --git a/packages/frontend/src/app/util/member.ts b/packages/frontend/src/app/util/member.ts new file mode 100644 index 0000000..d54c6ab --- /dev/null +++ b/packages/frontend/src/app/util/member.ts @@ -0,0 +1,99 @@ +import { Inject, Injectable } from '@angular/core'; +import { FormControl, FormGroup } from '@angular/forms'; +import { MAT_DATE_LOCALE } from '@angular/material/core'; +import { Locale, parse } from 'date-fns'; +import { + Member, + PickMemberExcludeKeyofMemberIdOrLoeschenam, +} from '../generated-api/api'; + +interface MemberForm { + id: FormControl; + vorname: FormControl; + nachname: FormControl; + geschlecht: FormControl; + geburtsdatum: FormControl; + geburtsort: FormControl; + passnummer: FormControl; + uvertrag: FormControl; + verein: FormControl; + kontakt: FormControl; + graduierung: FormControl; + kuendigungzum: FormControl; + letztePruefung: FormControl; +} + +@Injectable({ + providedIn: 'root', +}) +export class MemberDtoHelper { + constructor(@Inject(MAT_DATE_LOCALE) private locale: Locale) {} + public newMemberForm(member?: Member): FormGroup { + const geburtsdatum = member?.geburtsdatum; + let enDate: Date | null = null; + if (geburtsdatum) { + enDate = parse(geburtsdatum, 'dd.MM.yyyy', new Date(), { + //TODO get dd.MM.yyyy from MAT_DATE_LOCALE or LOCALE_ID + locale: this.locale, + }); + } + + return new FormGroup({ + id: new FormControl(member?.id), + vorname: new FormControl(member?.vorname), + nachname: new FormControl(member?.nachname), + geschlecht: new FormControl(member?.geschlecht), + geburtsdatum: new FormControl(enDate), + geburtsort: new FormControl(member?.geburtsort), + passnummer: new FormControl(member?.passnummer), + uvertrag: new FormControl(member?.uvertrag), + verein: new FormControl(member?.verein), + kontakt: new FormControl(member?.kontakt), + graduierung: new FormControl(member?.graduierung), + kuendigungzum: new FormControl(member?.kuendigungzum), + letztePruefung: new FormControl(member?.letztePruefung), + }); + } + + memberFromForm(form: FormGroup): Member { + return { + id: form.controls.id.value ?? null, + vorname: form.controls.vorname.value ?? null, + nachname: form.controls.nachname.value ?? null, + geschlecht: form.controls.geschlecht.value ?? null, + geburtsdatum: form.controls.geburtsdatum.value + ? JSON.stringify(form.controls.geburtsdatum.value) + : null, + geburtsort: form.controls.geburtsort.value ?? null, + passnummer: form.controls.passnummer.value ?? null, + uvertrag: form.controls.uvertrag.value ?? null, + verein: form.controls.verein.value ?? null, + kontakt: form.controls.kontakt.value ?? null, + graduierung: form.controls.graduierung?.value ?? null, + kuendigungzum: form.controls.kuendigungzum.value ?? null, //TODO not for new member + letztePruefung: form.controls.letztePruefung?.value ?? null, //TODO not for new member + loeschenam: null, //TODO? not client settable + }; + } + + newMemberFromForm( + form: FormGroup, + ): PickMemberExcludeKeyofMemberIdOrLoeschenam { + return { + vorname: form.controls.vorname.value ?? null, + nachname: form.controls.nachname.value ?? null, + geschlecht: form.controls.geschlecht.value ?? null, + geburtsdatum: form.controls.geburtsdatum.value + ? JSON.stringify(form.controls.geburtsdatum.value) + : null, + geburtsort: form.controls.geburtsort.value ?? null, + passnummer: form.controls.passnummer.value ?? null, + uvertrag: form.controls.uvertrag.value ?? null, + verein: form.controls.verein.value ?? null, + kontakt: form.controls.kontakt.value ?? null, + graduierung: form.controls.graduierung?.value ?? null, + kuendigungzum: null, //TODO not for new member + letztePruefung: null, //TODO not for new member + }; + } +} diff --git a/packages/frontend/src/styles.scss b/packages/frontend/src/styles.scss index 76272a3..6c49839 100644 --- a/packages/frontend/src/styles.scss +++ b/packages/frontend/src/styles.scss @@ -9,20 +9,20 @@ @include mat.core(); -@include mat.all-component-themes(my-theme.$light-theme); -@include mat.color-variants-backwards-compatibility(my-theme.$light-theme); +@include mat.core-theme(my-theme.$primary-palette); +@include mat.button-theme(my-theme.$primary-palette); html { - // @include mat.theme(( - // color: ( - // primary: my-theme.$primary-palette, - // tertiary: my-theme.$tertiary-palette, - // ), - // typography: Roboto, - // density: 0, - // )); - @include mat.core-theme(my-theme.$light-theme); - @include mat.button-theme(my-theme.$light-theme); + @include mat.theme(( + color: ( + primary: my-theme.$primary-palette, + tertiary: my-theme.$tertiary-palette, + ), + typography: Roboto, + density: 0, + )); + @include mat.core-theme(my-theme.$primary-palette); + @include mat.button-theme(my-theme.$primary-palette); } body { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cedd337..0bf26c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,13 +15,13 @@ importers: packages/api: dependencies: '@keycloak/keycloak-admin-client': - specifier: ^26.4.7 + specifier: ^26.4.4 version: 26.4.7 '@prisma/adapter-pg': - specifier: ^7.1.0 + specifier: ^7.0.1 version: 7.1.0 '@prisma/client': - specifier: ^7.1.0 + specifier: ^7.0.1 version: 7.1.0(prisma@7.1.0(@types/react@19.2.7)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3))(typescript@5.9.3) '@tsoa/runtime': specifier: ^6.6.0 @@ -32,8 +32,11 @@ importers: cors: specifier: ^2.8.5 version: 2.8.5 + dotenv: + specifier: ^17.2.3 + version: 17.2.3 express: - specifier: ^5.2.1 + specifier: ^5.1.0 version: 5.2.1 express-session: specifier: ^1.18.2 @@ -55,28 +58,22 @@ importers: specifier: ^2.8.19 version: 2.8.19 '@types/express': - specifier: ^5.0.6 + specifier: ^5.0.5 version: 5.0.6 '@types/express-session': specifier: ^1.18.2 version: 1.18.2 '@types/node': - specifier: ^24.10.1 + specifier: ^24.9.2 version: 24.10.1 '@types/pg': specifier: ^8.15.6 version: 8.15.6 - dotenv: - specifier: ^17.2.3 - version: 17.2.3 prisma: - specifier: ^7.1.0 + specifier: ^7.0.1 version: 7.1.0(@types/react@19.2.7)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3) - run-script-os: - specifier: ^1.1.6 - version: 1.1.6 tsx: - specifier: ^4.21.0 + specifier: ^4.20.6 version: 4.21.0 typescript: specifier: ~5.9.3 @@ -102,15 +99,27 @@ importers: '@angular/material': specifier: 20.2.11 version: 20.2.11(437fd31793958c779574d25f524a2c50) + '@angular/material-date-fns-adapter': + specifier: ^21.0.2 + version: 21.0.2(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/material@20.2.11(437fd31793958c779574d25f524a2c50))(date-fns@4.1.0) '@angular/platform-browser': specifier: ^20.3.15 version: 20.3.15(@angular/common@20.3.15(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1)) '@angular/router': specifier: ^20.3.15 version: 20.3.15(@angular/common@20.3.15(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.3.15(@angular/common@20.3.15(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) + '@date-fns/tz': + specifier: ^1.4.1 + version: 1.4.1 + '@date-fns/utc': + specifier: ^2.1.1 + version: 2.1.1 '@oazapfts/runtime': specifier: ^1.0.4 version: 1.0.4 + date-fns: + specifier: ^4.1.0 + version: 4.1.0 keycloak-angular: specifier: ^20.0.0 version: 20.0.0(@angular/common@20.3.15(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/router@20.3.15(@angular/common@20.3.15(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.3.15(@angular/common@20.3.15(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2))(keycloak-js@26.2.1)(rxjs@7.8.2) @@ -405,6 +414,13 @@ packages: '@angular/platform-browser': 20.3.15 rxjs: ^6.5.3 || ^7.4.0 + '@angular/material-date-fns-adapter@21.0.2': + resolution: {integrity: sha512-vNJSiC6Ik6jmtdLUPWm514yJjoRP6blpw0DsACLcEDZJuIujAtvN/YmE3e+azk3Psr3nJgR3p029nQmKfHm7pw==} + peerDependencies: + '@angular/core': ^21.0.0 || ^22.0.0 + '@angular/material': 21.0.2 + date-fns: '>2.20.0 <5.0' + '@angular/material@20.2.11': resolution: {integrity: sha512-lrmudo8n06o6UBVKx/slAfUIjJghwub5JZfIOmQd2js0Vz+eBJYcDJsgBB8lG/LSXKLlPkNwe6o6nJBMVBZg1g==} peerDependencies: @@ -980,6 +996,12 @@ packages: resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} + '@date-fns/tz@1.4.1': + resolution: {integrity: sha512-P5LUNhtbj6YfI3iJjw5EL9eUAG6OitD0W3fWQcpQjDRc/QIsL0tRNuO1PcDvPccWL1fSTXXdE1ds+l95DV/OFA==} + + '@date-fns/utc@2.1.1': + resolution: {integrity: sha512-SlJDfG6RPeEX8wEVv6ZB3kak4MmbtyiI2qX/5zuKdordbrhB/iaJ58GVMZgJ6P1sJaM1gMgENFYYeg1JWrCFrA==} + '@discoveryjs/json-ext@0.6.3': resolution: {integrity: sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ==} engines: {node: '>=14.17.0'} @@ -2862,6 +2884,9 @@ packages: resolution: {integrity: sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==} engines: {node: '>= 14'} + date-fns@4.1.0: + resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} + date-format@4.0.14: resolution: {integrity: sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==} engines: {node: '>=4.0'} @@ -4778,10 +4803,6 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - run-script-os@1.1.6: - resolution: {integrity: sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==} - hasBin: true - rxjs@7.8.2: resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} @@ -5990,6 +6011,13 @@ snapshots: rxjs: 7.8.2 tslib: 2.8.1 + '@angular/material-date-fns-adapter@21.0.2(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/material@20.2.11(437fd31793958c779574d25f524a2c50))(date-fns@4.1.0)': + dependencies: + '@angular/core': 20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1) + '@angular/material': 20.2.11(437fd31793958c779574d25f524a2c50) + date-fns: 4.1.0 + tslib: 2.8.1 + '@angular/material@20.2.11(437fd31793958c779574d25f524a2c50)': dependencies: '@angular/cdk': 20.2.11(@angular/common@20.3.15(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.3.15(@angular/compiler@20.3.15)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) @@ -6757,6 +6785,10 @@ snapshots: '@colors/colors@1.5.0': {} + '@date-fns/tz@1.4.1': {} + + '@date-fns/utc@2.1.1': {} + '@discoveryjs/json-ext@0.6.3': {} '@electric-sql/pglite-socket@0.0.6(@electric-sql/pglite@0.3.2)': @@ -7854,7 +7886,7 @@ snapshots: '@types/connect-history-api-fallback@1.5.4': dependencies: - '@types/express-serve-static-core': 4.19.7 + '@types/express-serve-static-core': 5.1.0 '@types/node': 24.10.1 '@types/connect-pg-simple@7.0.3': @@ -7993,7 +8025,7 @@ snapshots: '@types/serve-index@1.9.4': dependencies: - '@types/express': 4.17.25 + '@types/express': 5.0.6 '@types/serve-static@1.15.10': dependencies: @@ -8648,6 +8680,8 @@ snapshots: data-uri-to-buffer@6.0.2: optional: true + date-fns@4.1.0: {} + date-format@4.0.14: {} debug@2.6.9: @@ -10808,8 +10842,6 @@ snapshots: dependencies: queue-microtask: 1.2.3 - run-script-os@1.1.6: {} - rxjs@7.8.2: dependencies: tslib: 2.8.1 diff --git a/tsoa.json b/tsoa.json index 51efde0..04d9734 100644 --- a/tsoa.json +++ b/tsoa.json @@ -19,8 +19,8 @@ "bearerFormat": "JWT" } }, - "basePath": "/api/v1", - "servers": ["localhost:8080/api/v1", "tkd-api.toni714.de/api/v1"], + "basePath": "", + "servers": ["localhost:3000", "tkd-api.toni714.de"], "info": { "title": "Tcc Member API", "description": "API for the TCC Member Database",