-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcurl-api.json
More file actions
112 lines (112 loc) · 2.99 KB
/
curl-api.json
File metadata and controls
112 lines (112 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
"version": "0.2",
"identity_profiles": [
{
"id": "api-credentials",
"provider": "env-bearer",
"subject": {
"kind": "service",
"principal": "agent://api/http-client",
"display_name": "HTTP API Agent",
"delegation_mode": "none"
},
"auth": {
"mode": "service",
"required": false,
"provider_config": {
"token_env": "API_TOKEN"
}
},
"trust": {
"level": "supervised",
"constraints": {
"max_autonomy": "supervised",
"escalation": "fail"
}
},
"presentation": {
"bindings": [
{
"source": "credentials.access_token.value",
"target": { "kind": "env", "name": "API_TOKEN" },
"required": false,
"redact": true
}
],
"handoff": "none",
"cleanup": "always"
}
}
],
"evidence_profiles": [
{
"id": "api-evidence",
"provider": "ssh",
"payload": {
"bind": ["execution_id", "declared_identity", "command", "result"],
"format": "canonical-json"
},
"verify": { "required": false }
}
],
"workflows": [
{
"id": "curl-api",
"name": "REST API Operations",
"contract": {
"sandbox": "permissive",
"network": "unrestricted",
"audit": "always"
},
"tasks": [
{
"id": "health-check",
"name": "API Health Check",
"shell": {
"program": "curl",
"args": ["-sf", "https://httpbin.org/status/200"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "api-credentials" },
"output": { "format": "text" },
"schedule": { "cron": "*/5 * * * *" }
},
{
"id": "fetch-data",
"name": "Fetch API Data",
"shell": {
"program": "curl",
"args": ["-sf", "-H", "Authorization: Bearer $API_TOKEN", "https://api.example.com/data"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "api-credentials" },
"output": {
"format": "json",
"preview_bytes": 4000,
"offload": "auto"
},
"schedule": { "cron": "0 */2 * * *" }
},
{
"id": "post-webhook",
"name": "Post Deploy Webhook",
"shell": {
"program": "curl",
"args": [
"-sf",
"-X", "POST",
"-H", "Content-Type: application/json",
"-d", "{\"event\":\"deploy\",\"status\":\"complete\"}",
"https://hooks.example.com/webhook"
]
},
"target": { "session_target": "shell" },
"identity": { "ref": "api-credentials" },
"evidence": { "ref": "api-evidence" },
"output": { "format": "text" },
"schedule": { "cron": "0 12 * * *" }
}
]
}
]
}