modernize create-user-add-to-vre

This commit is contained in:
Marco Lettere 2023-10-12 18:10:44 +02:00
parent 021304f651
commit 35ce4dc32e
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@
"evaluatorType" : "javascript", "evaluatorType" : "javascript",
"groups" : "${extract_groups.output.result.groups}", "groups" : "${extract_groups.output.result.groups}",
"auth" : "Bearer ${authorize.output.body.access_token}", "auth" : "Bearer ${authorize.output.body.access_token}",
"kc_user_url" : "${init.input.keycloak_admin}/users/${select_user.output.result[0].id}/groups/", "kc_user_url" : "${init.input.keycloak_admin}/users/${select_user.output.result.id}/groups/",
"expression": "inputs={};tasks=[];function f(){for(var i=0;i<$.groups.length;i++)group=$.groups[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'user_to_group_'+i}),inputs['user_to_group_'+i]={ url : $.kc_user_url + group.id, method : 'PUT', headers: { Authorization : $.auth} };return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};} f();" "expression": "inputs={};tasks=[];function f(){for(var i=0;i<$.groups.length;i++)group=$.groups[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'user_to_group_'+i}),inputs['user_to_group_'+i]={ url : $.kc_user_url + group.id, method : 'PUT', headers: { Authorization : $.auth} };return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};} f();"
} }
}, },