Web Inputs: Admin signoff
Description
GCS collections can be configured with Associated Flow Policies. These policies ensure that all transfer requests are initiated from within a particular flow.
This example builds on this GCS feature, and introduces Web Inputs: an administrator must approve each transfer request into the collection.
The flow is designed with these assumptions and requirements:
-
The destination collection’s Associated Flow Policy lists this flow as its requirement when the collection is the destination in a transfer.
-
The administrators who can approve the transfer request are all part of a single Globus group.
Highlights
-
The flow and its input schema are compatible with a GCS collection whose Associated Flow Policies are configured.
-
The name of the source collection in the transfer request is gathered prior to creating the Web Input.
-
The Web Input’s context is dynamically generated with the user’s information and information about the transfer request.
Source code
{
"Comment": "Get admin approval before transferring data into a secure enclave.",
"StartAt": "GetSourceEndpointInfo",
"States": {
"GetSourceEndpointInfo": {
"Type": "Action",
"ActionUrl": "https://transfer.actions.globus.org/collection_info",
"Parameters": {
"endpoint_id.$": "$.file_manager_settings.source_endpoint"
},
"ResultPath": "$.source_endpoint_info",
"Next": "CreateWebInput"
},
"CreateWebInput": {
"Type": "CreateWebInput",
"Parameters": {
"InputType": "Selection",
"Context": {
"PresentationStyle": "Table",
"Title": "A user is requesting a data transfer into the Secure Enclave Collection",
"Rows": [
{
"Field": "Requesting user",
"Value.=": "(`$._context.email` or `$._context.username`) + ' (' + `$._context.user_id` + ')'"
},
{
"Field": "Source collection",
"Value.=": "`$.source_endpoint_info.details.display_name` + ' (' + `$.file_manager_settings.source_endpoint` + ')'"
},
{
"Field": "Total data item count",
"Value.=": "str(len(`$.file_manager_settings.DATA`))"
},
{
"Field": "First data item",
"Value.=": "`$.file_manager_settings.DATA[0].source_path` + ' -> ' + `$.file_manager_settings.DATA[0].destination_path`"
}
]
},
"Options": [
{
"Value": "approve",
"Label": "✅ Approve",
"Description": "Authorize the transfer request."
},
{
"Value": "deny",
"Label": "❌ Deny",
"Description": "Deny the transfer request."
}
],
"RespondentUrns": [
"urn:globus:group:id:11111111-2222-3333-4444-555555555555"
]
},
"ResultPath": "$.web_input_info",
"Next": "AwaitResponse"
},
"AwaitResponse": {
"Type": "AwaitWebInput",
"Parameters": {
"web_input_id.$": "$.web_input_info.web_input_id"
},
"ResultPath": "$.response_info",
"Next": "EvaluateResponse"
},
"EvaluateResponse": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.response_info.response",
"StringEquals": "approve",
"Next": "Transfer"
}
],
"Default": "TransferRequestNotApproved"
},
"TransferRequestNotApproved": {
"Type": "Fail",
"Cause": "The transfer request was not approved."
},
"Transfer": {
"Type": "Action",
"ActionUrl": "https://transfer.actions.globus.org/transfer",
"InputPath": "$.file_manager_settings",
"End": true
}
}
}
{
"title": "Start a Transfer to The Secure Enclave",
"type": "object",
"required": [
"file_manager_settings"
],
"properties": {
"file_manager_settings": {
"type": "object",
"format": "globus-transfer-transfer#0.10",
"required": [
"source_endpoint",
"DATA"
],
"properties": {
"source_endpoint": {
"type": "string",
"format": "uuid"
},
"DATA": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"source_path",
"destination_path"
],
"properties": {
"source_path": {
"type": "string"
},
"destination_path": {
"type": "string"
}
}
}
}
}
}
},
"additionalProperties": false
}
{
"file_manager_settings": {
"DATA": [
{
"DATA_TYPE": "transfer_item",
"source_path": "/path/to/file.txt",
"destination_path": "/file.txt",
"recursive": false
}
],
"source_endpoint": "11111111-4aa5-44f5-871d-f37ee5afe1c7",
"destination_endpoint": "22222222-cf92-4d9b-9450-5ac213a52455",
"delete_destination_extra": false,
"encrypt_data": false,
"fail_on_quota_errors": false,
"label": "My Personal GCP Collection to The Secure Enclave",
"preserve_timestamp": false,
"skip_source_errors": false,
"verify_checksum": true,
"notify_on_succeeded": true,
"notify_on_failed": true,
"notify_on_inactive": true,
"store_base_path_info": true
}
}