|
|
|
@ -8,13 +8,14 @@
|
|
|
|
|
"inputParameters" : ["role", "first", "max"],
|
|
|
|
|
"tasks" : [
|
|
|
|
|
{
|
|
|
|
|
"name": "LAMBDA_TASK",
|
|
|
|
|
"name": "INLINE_TASK",
|
|
|
|
|
"taskReferenceName": "init",
|
|
|
|
|
"type": "LAMBDA",
|
|
|
|
|
"type": "INLINE",
|
|
|
|
|
"inputParameters": {
|
|
|
|
|
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
|
|
|
|
|
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
|
|
|
|
|
"scriptExpression": "1 == 1"
|
|
|
|
|
"evaluatorType" : "javascript",
|
|
|
|
|
"expression": "1 == 1"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -65,13 +66,14 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "LAMBDA_TASK",
|
|
|
|
|
"name": "INLINE_TASK",
|
|
|
|
|
"taskReferenceName": "build_add_role_tasks",
|
|
|
|
|
"type": "LAMBDA",
|
|
|
|
|
"type": "INLINE",
|
|
|
|
|
"inputParameters": {
|
|
|
|
|
"role" : "${workflow.input.role}",
|
|
|
|
|
"vres" : "${get_all_vres.output.body}",
|
|
|
|
|
"scriptExpression": "inputs={};tasks=[];for(var i=0;i<$.vres.length;i++)vre=$.vres[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'create_role_'+i}),inputs['create_role_'+i]={url:'${init.input.keycloak_admin}/clients/' + vre.id + '/roles',body:{clientRole:true,name:$.role,description: $.role + ' role'},method:'POST',headers:{Authorization:'Bearer ${authorize2.output.body.access_token}','Content-Type':'application/json'}};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
|
|
|
|
|
"evaluatorType" : "javascript",
|
|
|
|
|
"expression": "inputs={};tasks=[];function f(){for(var i=0;i<$.vres.length;i++)vre=$.vres[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'create_role_'+i}),inputs['create_role_'+i]={url:'${init.input.keycloak_admin}/clients/' + vre.id + '/roles',body:{clientRole:true,name:$.role,description: $.role + ' role'},method:'POST',headers:{Authorization:'Bearer ${authorize2.output.body.access_token}','Content-Type':'application/json'}};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs}} f();"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -108,12 +110,13 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "LAMBDA_TASK",
|
|
|
|
|
"name": "INLINE_TASK",
|
|
|
|
|
"taskReferenceName": "build_get_back_role_tasks",
|
|
|
|
|
"type": "LAMBDA",
|
|
|
|
|
"type": "INLINE",
|
|
|
|
|
"inputParameters": {
|
|
|
|
|
"evaluatorType" : "javascript",
|
|
|
|
|
"roleurls" : "${join_parallel_role_addition.output[*]..location}",
|
|
|
|
|
"scriptExpression": "inputs={},tasks=[];for(var i=0;i<$.roleurls.length;i++)u=$.roleurls[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'get_back_'+i}),inputs['get_back_'+i]={url:u,method:'GET',headers:{Authorization:'Bearer ${authorize3.output.body.access_token}',Accept:'application/json'}};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
|
|
|
|
|
"expression": "inputs={},tasks=[];function f(){for(var i=0;i<$.roleurls.length;i++)u=$.roleurls[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'get_back_'+i}),inputs['get_back_'+i]={url:u,method:'GET',headers:{Authorization:'Bearer ${authorize3.output.body.access_token}',Accept:'application/json'}};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs}} f();"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -133,12 +136,13 @@
|
|
|
|
|
"taskReferenceName" : "join_parallel_getting_back"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "LAMBDA_TASK",
|
|
|
|
|
"name": "INLINE_TASK",
|
|
|
|
|
"taskReferenceName": "build_policy_permission_tasks",
|
|
|
|
|
"type": "LAMBDA",
|
|
|
|
|
"type": "INLINE",
|
|
|
|
|
"inputParameters": {
|
|
|
|
|
"evaluatorType" : "javascript",
|
|
|
|
|
"roles" : "${join_parallel_getting_back.output[*].body}",
|
|
|
|
|
"scriptExpression": "inputs={},tasks=[];for(var i=0;i<$.roles.length;i++)r=$.roles[i],tasks.push({name:'sub_workflow_task',type:'SUB_WORKFLOW',taskReferenceName:'call_policy_workflow_'+i, subWorkflowParam:{ name:'add_role_policy_permission'}}),inputs['call_policy_workflow_'+i]={role:r};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
|
|
|
|
|
"expression": "inputs={},tasks=[];function f(){for(var i=0;i<$.roles.length;i++)r=$.roles[i],tasks.push({name:'sub_workflow_task',type:'SUB_WORKFLOW',taskReferenceName:'call_policy_workflow_'+i, subWorkflowParam:{ name:'add_role_policy_permission'}}),inputs['call_policy_workflow_'+i]={role:r};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs}} f();"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|