Skip to content

Commit

Permalink
feat: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderMatt committed Jun 19, 2024
1 parent 74438f1 commit 71f262f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,19 @@
"NODE_EXTRA_CA_CERTS": "${workspaceFolder}/.env.ca"
}
},
{
"type": "node",
"request": "launch",
"name": "Debug Keycloak operator",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "operator:keycloak-dev"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"NODE_EXTRA_CA_CERTS": "${workspaceFolder}/.env.ca"
}
},
{
"type": "node",
"request": "launch",
Expand Down
5 changes: 4 additions & 1 deletion src/operator/keycloak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
IdentityProvidersApi,
ProtocolMapperRepresentation,
ProtocolMappersApi,
RealmRepresentation,
RealmsAdminApi,
RoleMapperApi,
RoleRepresentation,
Expand Down Expand Up @@ -360,7 +361,9 @@ async function keycloakRealmProviderConfigurer(api: KeycloakApi) {
realmConf.accessTokenLifespanForImplicitFlow = env.KEYCLOAK_TOKEN_TTL
// the api does not offer a list method, and trying to get by id throws an error
// which we wan to discard, so we run the next command with an empty errors array
const existingRealm = await doApiCall([], `Getting realm ${keycloakRealm}`, () => api.realms.realmGet(keycloakRealm))
console.log('api: ', api)
console.log('api realms: ', api.realms.authentications)
const existingRealm = await doApiCall([], `Getting realm ${keycloakRealm}`, () => api.realms.realmGet(keycloakRealm)) as RealmRepresentation
if (existingRealm) {
await doApiCall(errors, `Updating realm ${keycloakRealm}`, async () =>
api.realms.realmPut(keycloakRealm, realmConf),
Expand Down

0 comments on commit 71f262f

Please sign in to comment.