60 lines
2.2 KiB
Django/Jinja
60 lines
2.2 KiB
Django/Jinja
{
|
|
"ownerApp" : "Orchestrator",
|
|
"name" : "enable_workspace_clients_for_context",
|
|
"createBy" : "Marco Lettere",
|
|
"description": "All workspace clients registered on Information system for given context are enabled for VRE by calling add_workspace_client_to_context",
|
|
"version" : 1,
|
|
"ownerEmail" : "marco.lettere@nubisware.com",
|
|
"inputParameters" : ["filter", "context"],
|
|
"tasks" : [
|
|
{
|
|
"name": "LAMBDA_TASK",
|
|
"taskReferenceName": "init",
|
|
"type": "LAMBDA",
|
|
"inputParameters": {
|
|
"root_vo": "{{ root_vo }}",
|
|
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
|
|
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
|
|
"id" : "${workflow.input.client_id}",
|
|
"ctx" : "${workflow.input.context}",
|
|
"filter" : "${workflow.input.filter}",
|
|
"scriptExpression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))} if(e($.ctx)) throw('Context must not be empty'); f=$.filter; if(e(f)) f = []; else if(typeof(f) === 'string') f=[f]; else f=Java.from(f); return { encoded_root_vo : encodeURI($.root_vo), filter : Java.to(f,'java.lang.String[]')}"
|
|
}
|
|
},
|
|
{
|
|
"name" : "pyrest",
|
|
"taskReferenceName" : "authorize_with_uma_rpt",
|
|
"type" : "SIMPLE",
|
|
"inputParameters" : {
|
|
"url" : "{{ keycloak }}/{{ keycloak_realm }}/protocol/openid-connect/token",
|
|
"method" : "POST",
|
|
"headers" : {
|
|
"Accept" : "application/json"
|
|
},
|
|
"body" : {
|
|
"audience" : "${workflow.input.context}",
|
|
"grant_type" : "urn:ietf:params:oauth:grant-type:uma-ticket",
|
|
"client_id" : "orchestrator",
|
|
"client_secret" : "{{ keycloak_auth }}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name" : "pyrest",
|
|
"taskReferenceName" : "query_workspace_clients_on_icproxy",
|
|
"type" : "SIMPLE",
|
|
"inputParameters" : {
|
|
"url" : "{{ ic_proxy }}/icproxy/gcube/service/ServiceEndpoint/SystemWorkspaceClient",
|
|
"method" : "GET",
|
|
"headers" : {
|
|
"Accept" : "application/json",
|
|
"Authorization" : "Bearer ${authorize_with_uma_rpt.output.body.access_token}"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
|
|
curl --location --request GET 'https://node10-d-d4s.d4science.org/icproxy/gcube/service/ServiceEndpoint/SystemWorkspaceClient' \
|
|
--header 'Authorization: Bearer ACCESS TOKEN CON AUDIENCE **CTX** '
|