diff --git a/defaults/main.yaml b/defaults/main.yaml index 4c33b77..f2845c6 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -18,6 +18,7 @@ workflows: # - add_all_system_services_to_vre - create_workspace_client - add_workspace_client_to_context + - enable_workspace_clients_for_context keycloak_host: "https://accounts.dev.d4science.org/auth" keycloak: "{{ keycloak_host }}/realms" keycloak_realm: "d4science" diff --git a/templates/enable_workspace_clients_for_context.json.j2 b/templates/enable_workspace_clients_for_context.json.j2 new file mode 100644 index 0000000..3df5c52 --- /dev/null +++ b/templates/enable_workspace_clients_for_context.json.j2 @@ -0,0 +1,25 @@ +{ + "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(!(f instanceof Array)) else throw('Filter must be empty or Array'); return { encoded_root_vo : encodeURI($.root_vo), filter : filter}" + } + } + ] +}