Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
moqui
/
moqui-keycloak
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
8641efa9
authored
2023-05-10 08:25:10 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix entity hook processing.
1 parent
93137dec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
service/keycloak/HookServices.groovy
service/keycloak/HookServices.groovy
View file @
8641efa
...
...
@@ -64,6 +64,11 @@ class HookSynchronization implements Synchronization {
newExtraParameters
.
putAll
(
extraParameters
)
}
updates
.
put
(
entityToken
,
newExtraParameters
)
if
(
existingExtraParameters
==
null
)
{
ec
.
getLogger
().
info
(
"Add new synchronization for ${entityName}: [${keyValue}]"
)
}
else
{
ec
.
getLogger
().
info
(
"Updated synchronization for ${entityName}: [${keyValue}]"
)
}
}
@Override
...
...
@@ -79,7 +84,9 @@ class HookSynchronization implements Synchronization {
extraParameters:
extraParameters
,
])
}
ec
.
getService
().
async
().
name
(
"keycloak.HookServices.process#Updates"
).
parameter
(
'updates'
,
updates
).
call
()
if
(
updates
)
{
ec
.
getService
().
async
().
name
(
"keycloak.HookServices.process#Updates"
).
parameter
(
'updates'
,
updates
).
call
()
}
}
@Override
...
...
@@ -190,11 +197,6 @@ Map<String, Object> handleEntityUpdate() {
logger
.
info
(
"context: ${context}"
)
ExecutionContext
ec
=
context
.
ec
Map
<
String
,
Object
>
contextRoot
=
ec
.
getContextRoot
()
Map
<
String
,
Set
<
Object
>>
toRegister
=
contextRoot
[
'KeycloakEntityRegistrations'
]
logger
.
info
(
"toRegister: ${toRegister}"
)
if
(
toRegister
==
null
)
{
toRegister
=
contextRoot
[
'KeycloakEntityRegistrations'
]
=
[:]
}
HookSynchronization
hookSync
=
getHookSync
()
...
...
@@ -205,13 +207,6 @@ Map<String, Object> handleEntityUpdate() {
logger
.
info
(
"processing entry: ${entry}"
)
String
entityName
=
entry
.
entityName
Object
value
=
entry
.
value
Set
<
Object
>
entityRegistrations
=
toRegister
[
entityName
]
if
(
entityRegistrations
==
null
)
{
entityRegistrations
=
toRegister
[
entityName
]
=
new
HashSet
()
entityRegistrations
.
add
(
value
)
}
else
if
(
entityRegistrations
.
contains
(
value
))
{
continue
}
String
keyName
switch
(
entityName
)
{
case
'Party'
:
...
...
@@ -245,7 +240,6 @@ Map<String, Object> handleEntityUpdate() {
keyName
=
'roleTypeId'
break
}
ec
.
getLogger
().
info
(
"Registered synchronization for ${entityName}: [${value}]"
)
hookSync
.
add
(
entityName
,
keyName
,
value
,
[:])
//ec.getService().special().name("keycloak.KeycloakServices.send#${entityName}").parameter(keyName, value).registerOnCommit()
}
...
...
Please
register
or
sign in
to post a comment