addition of policies for roles

This commit is contained in:
dcore94 2021-03-03 18:27:15 +01:00
parent 7658af52f8
commit c007896a55
1 changed files with 56 additions and 19 deletions

View File

@ -157,7 +157,7 @@
}
},
{
"name" : "pyrest",
"name" : "pyrest",
"taskReferenceName" : "create_kc_group",
"type" : "SIMPLE",
"inputParameters" : {
@ -173,7 +173,7 @@
}
},
{
"name" : "pyrest",
"name" : "pyrest",
"taskReferenceName" : "list_kc_groups",
"type" : "SIMPLE",
"inputParameters" : {
@ -238,7 +238,7 @@
]
},
{
"name" : "pyrest",
"name" : "pyrest",
"taskReferenceName" : "assign_client_member_role_to_kc_group",
"type" : "SIMPLE",
"inputParameters" : {
@ -253,22 +253,59 @@
}
}
],
[{
"name" : "pyrest",
"taskReferenceName" : "create_role_accountingmanager",
"type" : "SIMPLE",
"inputParameters" : {
"url" : "${create_client.output.headers.location}/roles",
"body" : {
"clientRole" : true, "name" : "Accounting-Manager", "description" : "Accounting-Manager for ${init.output.result.name}"
},
"method" : "POST",
"headers" : {
"Authorization" : "Bearer ${authorize.output.body.access_token}",
"Content-Type" : "application/json"
}
}
}],
[
{
"name" : "pyrest",
"taskReferenceName" : "create_role_accountingmanager",
"type" : "SIMPLE",
"inputParameters" : {
"url" : "${create_client.output.headers.location}/roles",
"body" : {
"clientRole" : true, "name" : "Accounting-Manager", "description" : "Accounting-Manager for ${init.output.result.name}"
},
"method" : "POST",
"headers" : {
"Authorization" : "Bearer ${authorize.output.body.access_token}",
"Content-Type" : "application/json"
}
}
},
{
"name": "LAMBDA_TASK",
"taskReferenceName": "extract_accountimgmanager_role_id",
"type": "LAMBDA",
"inputParameters": {
"role_location" : "${create_role_accountingmanager.output.headers.location}",
"scriptExpression": "var role_id = $.role_location.split('/').pop(); return {'role_id' : role_id}"
}
},
{
"name" : "pyrest",
"taskReferenceName" : "create_role_policy_accountingmanager",
"type" : "SIMPLE",
"inputParameters" : {
"url" : "${init.input.keycloak_admin}/clients/${extract_client_id.output.result.client_id}/authz/resource-server/policy/role",
"body" : {
"name": "Accounting-Manager_policy",
"description": "",
"type" : "role",
"logic": "POSITIVE",
"decisionStrategy": "UNANIMOUS",
"roles" : [
{
"id" : "${extract_accountimgmanager_role_id.output.result.role_id}",
"required" : true
}
]
},
"method" : "POST",
"headers" : {
"Authorization" : "Bearer ${authorize.output.body.access_token}",
"Content-Type" : "application/json"
}
}
}
],
[{
"name" : "pyrest",
"taskReferenceName" : "create_role_catalogueadmin",