forked from m.lettere/orchestrator-setup
fixed missing append on root group, assign role to user is tolerant to non existing roles
This commit is contained in:
parent
81f17861e0
commit
74d400fa9d
|
@ -145,25 +145,48 @@
|
|||
"location" : "${create_kc_group.output.headers.location}",
|
||||
"client_location" : "${create_client.output.headers.location}",
|
||||
"groups" : "${list_kc_groups.output.body}",
|
||||
"scriptExpression": "var newid=$.location.split('/').pop(); var client_id = $.client_location.split('/').pop(); function recurse(inp){for(var i=0;i<inp.length;i++){if(inp[i]['path'] === $.append) return{'group' : inp[i], 'newid' : newid, 'client_id' : client_id}; else{var subr = recurse(inp[i].subGroups); if(subr != null) return {'group' : subr, 'newid' : newid, 'client_id' : client_id};}} return null}; return recurse($.groups)"
|
||||
"scriptExpression": "var newid=$.location.split('/').pop(); var client_id = $.client_location.split('/').pop(); function recurse(inp){for(var i=0;i<inp.length;i++){if(inp[i]['path'] === $.append) return inp[i]; else{var subr = recurse(inp[i].subGroups); if(subr != null) return subr;}} return null}; return {'group' : $.append == '' ? '' : recurse($.groups), 'newid' : newid, 'client_id' : client_id}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "pyrest",
|
||||
"taskReferenceName" : "move_new_kc_group_to_parent",
|
||||
"type" : "SIMPLE",
|
||||
"inputParameters" : {
|
||||
"url" : "${init.input.keycloak_admin}/groups/${prepare.output.result.group.id}/children",
|
||||
"method" : "POST",
|
||||
"body" : {
|
||||
"id" : "${prepare.output.result.newid}"
|
||||
},
|
||||
"headers" : {
|
||||
"Authorization" : "Bearer ${authorize.output.body.access_token}",
|
||||
"Accept" : "application/json",
|
||||
"Content-Type" : "application/json"
|
||||
"name": "decide_task",
|
||||
"taskReferenceName": "decide1",
|
||||
"inputParameters": {
|
||||
"groupid": "${prepare.output.result.group}"
|
||||
},
|
||||
"type": "DECISION",
|
||||
"caseValueParam": "groupid",
|
||||
"decisionCases": {
|
||||
"": [
|
||||
{
|
||||
"name": "LAMBDA_TASK",
|
||||
"taskReferenceName": "dummy",
|
||||
"type": "LAMBDA",
|
||||
"inputParameters": {
|
||||
"scriptExpression": "1"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"defaultCase": [
|
||||
{
|
||||
"name" : "pyrest",
|
||||
"taskReferenceName" : "move_new_kc_group_to_parent",
|
||||
"type" : "SIMPLE",
|
||||
"inputParameters" : {
|
||||
"url" : "${init.input.keycloak_admin}/groups/${prepare.output.result.group.id}/children",
|
||||
"method" : "POST",
|
||||
"body" : {
|
||||
"id" : "${prepare.output.result.newid}"
|
||||
},
|
||||
"headers" : {
|
||||
"Authorization" : "Bearer ${authorize.output.body.access_token}",
|
||||
"Accept" : "application/json",
|
||||
"Content-Type" : "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "pyrest",
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
"type" : "SIMPLE",
|
||||
"inputParameters" : {
|
||||
"url" : "${init.input.keycloak_admin}/users/${lookup_user.output.body[0].id}/role-mappings/clients/${lookup_client.output.body[0].id}",
|
||||
"expect" : 204,
|
||||
"expect" : [204, 404],
|
||||
"method" : "POST",
|
||||
"body" : "${select_role.output.result}",
|
||||
"headers" : {
|
||||
|
|
Loading…
Reference in New Issue