- id: input_config_file
name: input_config_file
tool: INPUT_FILE_AS_TEXT
input:
- name: value
value: "https://example.com/config.json"
- name: description
value: "Configuration file for processing"
- name: use_as_input
value: true
- id: parse_configuration
name: parse_configuration
tool: PYTHON_SANDBOX_RUN
input:
- name: code
value: |
import json
import requests
# Download and parse the config file
file_url = "{{steps.input_config_file.result}}"
response = requests.get(file_url)
config = json.loads(response.text)
print("Configuration loaded:")
for key, value in config.items():
print(f" {key}: {value}")
# Extract specific settings
database_url = config.get('database_url', 'Not found')
api_key = config.get('api_key', 'Not found')
print(f"\nDatabase URL: {database_url}")
print(f"API Key: {'*' * len(api_key) if api_key != 'Not found' else 'Not found'}")
- id: validate_config
name: validate_config
tool: CHECKER_CHECK_BY_JSON
input:
- name: text
value: "{{steps.parse_configuration.result.stdout | join(' ')}}"
- name: task_name
value: "Configuration Validation"
- name: rules
value: |
[
{
"rule": "Database URL present",
"pattern": "database_url.*://",
"required": true
},
{
"rule": "API key configured",
"pattern": "api_key.*\\*+",
"required": true
}
]