foil-server 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -29
  3. data/lib/foil/server/client.rb +6 -155
  4. data/lib/foil/server/sealed_token.rb +83 -16
  5. data/lib/foil/server/version.rb +1 -1
  6. data/lib/foil/server/webhooks.rb +71 -0
  7. data/lib/foil/server.rb +8 -6
  8. data/spec/README.md +14 -28
  9. data/spec/fixtures/api/organizations/api-key-create.json +1 -0
  10. data/spec/fixtures/api/organizations/api-key-list.json +1 -0
  11. data/spec/fixtures/api/organizations/api-key-revoke.json +1 -0
  12. data/spec/fixtures/api/organizations/api-key-rotate.json +1 -0
  13. data/spec/fixtures/api/organizations/api-key-update.json +1 -0
  14. data/spec/fixtures/api/sessions/detail.json +8 -1
  15. data/spec/fixtures/manifest.json +0 -85
  16. data/spec/fixtures/sealed-token/vector.v2.json +59 -0
  17. data/spec/fixtures/webhooks/signature.json +9 -0
  18. data/spec/openapi.json +1683 -6333
  19. data/spec/sealed-token.md +47 -18
  20. metadata +5 -22
  21. data/lib/foil/server/gate_delivery.rb +0 -332
  22. data/spec/fixtures/api/gate/agent-token-revoke.json +0 -3
  23. data/spec/fixtures/api/gate/agent-token-verify.json +0 -12
  24. data/spec/fixtures/api/gate/login-session-consume.json +0 -10
  25. data/spec/fixtures/api/gate/login-session-create.json +0 -12
  26. data/spec/fixtures/api/gate/registry-detail.json +0 -45
  27. data/spec/fixtures/api/gate/registry-list.json +0 -47
  28. data/spec/fixtures/api/gate/service-create.json +0 -49
  29. data/spec/fixtures/api/gate/service-detail.json +0 -49
  30. data/spec/fixtures/api/gate/service-disable.json +0 -49
  31. data/spec/fixtures/api/gate/service-update.json +0 -49
  32. data/spec/fixtures/api/gate/services-list.json +0 -51
  33. data/spec/fixtures/api/gate/session-ack.json +0 -10
  34. data/spec/fixtures/api/gate/session-create.json +0 -13
  35. data/spec/fixtures/api/gate/session-poll.json +0 -36
  36. data/spec/fixtures/gate-delivery/approved-webhook-payload.valid.json +0 -19
  37. data/spec/fixtures/gate-delivery/delivery-request.json +0 -9
  38. data/spec/fixtures/gate-delivery/env-policy.json +0 -40
  39. data/spec/fixtures/gate-delivery/vector.v1.json +0 -28
  40. data/spec/fixtures/gate-delivery/webhook-signature.json +0 -9
@@ -4,6 +4,7 @@
4
4
  "id": "sid_0123456789abcdefghjkmnpqrs",
5
5
  "created_at": "2026-03-24T20:00:00.000Z",
6
6
  "client_user_id": "user_123",
7
+ "behavior": null,
7
8
  "decision": {
8
9
  "event_id": "evt_23456789abcdefghjkmnpqrstv",
9
10
  "automation_status": "automated",
@@ -198,6 +199,10 @@
198
199
  "id": "vid_456789abcdefghjkmnpqrstvwx",
199
200
  "confidence": 93,
200
201
  "identified_at": "2026-03-24T20:00:01.000Z",
202
+ "resolution": {
203
+ "method": "continuity",
204
+ "basis": "deterministic"
205
+ },
201
206
  "lifecycle": {
202
207
  "first_seen_at": "2026-03-01T18:22:11.000Z",
203
208
  "last_seen_at": "2026-03-24T20:00:05.000Z",
@@ -257,7 +262,8 @@
257
262
  "name": "Chromium",
258
263
  "version": "123.0.0.0",
259
264
  "major_version": "123",
260
- "engine": "blink"
265
+ "engine": "blink",
266
+ "app_name": null
261
267
  },
262
268
  "device": {
263
269
  "form_factor": "desktop",
@@ -347,6 +353,7 @@
347
353
  ],
348
354
  "client_telemetry": {
349
355
  "navigator": {
356
+ "model": null,
350
357
  "platform": "macOS",
351
358
  "vendor": "Google Inc.",
352
359
  "hardware_concurrency": null,
@@ -101,91 +101,6 @@
101
101
  "path": "/v1/organizations/{organizationId}/api-keys/{keyId}",
102
102
  "method": "patch",
103
103
  "status": "200"
104
- },
105
- {
106
- "file": "api/gate/registry-list.json",
107
- "path": "/v1/gate/registry",
108
- "method": "get",
109
- "status": "200"
110
- },
111
- {
112
- "file": "api/gate/registry-detail.json",
113
- "path": "/v1/gate/registry/{serviceId}",
114
- "method": "get",
115
- "status": "200"
116
- },
117
- {
118
- "file": "api/gate/services-list.json",
119
- "path": "/v1/gate/services",
120
- "method": "get",
121
- "status": "200"
122
- },
123
- {
124
- "file": "api/gate/service-detail.json",
125
- "path": "/v1/gate/services/{serviceId}",
126
- "method": "get",
127
- "status": "200"
128
- },
129
- {
130
- "file": "api/gate/service-create.json",
131
- "path": "/v1/gate/services",
132
- "method": "post",
133
- "status": "201"
134
- },
135
- {
136
- "file": "api/gate/service-update.json",
137
- "path": "/v1/gate/services/{serviceId}",
138
- "method": "patch",
139
- "status": "200"
140
- },
141
- {
142
- "file": "api/gate/service-disable.json",
143
- "path": "/v1/gate/services/{serviceId}",
144
- "method": "delete",
145
- "status": "200"
146
- },
147
- {
148
- "file": "api/gate/session-create.json",
149
- "path": "/v1/gate/sessions",
150
- "method": "post",
151
- "status": "201"
152
- },
153
- {
154
- "file": "api/gate/session-poll.json",
155
- "path": "/v1/gate/sessions/{gateSessionId}",
156
- "method": "get",
157
- "status": "200"
158
- },
159
- {
160
- "file": "api/gate/session-ack.json",
161
- "path": "/v1/gate/sessions/{gateSessionId}/ack",
162
- "method": "post",
163
- "status": "200"
164
- },
165
- {
166
- "file": "api/gate/login-session-create.json",
167
- "path": "/v1/gate/login-sessions",
168
- "method": "post",
169
- "status": "201"
170
- },
171
- {
172
- "file": "api/gate/login-session-consume.json",
173
- "path": "/v1/gate/login-sessions/consume",
174
- "method": "post",
175
- "status": "200"
176
- },
177
- {
178
- "file": "api/gate/agent-token-verify.json",
179
- "path": "/v1/gate/agent-tokens/verify",
180
- "method": "post",
181
- "status": "200"
182
- },
183
- {
184
- "file": "api/gate/agent-token-revoke.json",
185
- "path": "/v1/gate/agent-tokens/revoke",
186
- "method": "post",
187
- "status": "204",
188
- "body": "none"
189
104
  }
190
105
  ]
191
106
  }
@@ -0,0 +1,59 @@
1
+ {
2
+ "secretKeys": [
3
+ "sk_live_fixture_secret",
4
+ "sk_live_fixture_secondary"
5
+ ],
6
+ "secretHashes": [
7
+ "c173e2c1467e446744e3b6aba8fc07e639008fdf3c4b82e32dceef9b41217dc3",
8
+ "7b7f1904e9f78f93fdaf5cb739b84a549f379774dce8e48d2e7318a38a71619d"
9
+ ],
10
+ "token": "AgACkGnTY6/gdAPOSejTAAABueItTz8WCgMBzOUeaG8XiLTGYNZ6/n+XKodAEavsB4nr/HXdLMPNin6k99VSMt4pm7xQDgq00NHf4pcUX98bVtrD9McjaPVhN0PQOcbwBncRqEXPQDLvdevFp6SvNcThP7F0LNnCN4WikARAYD/5hoJcfi3qpehcDRxIkFWXy9Rn5D7WnSAY1Ef2/2v3wT/aP2D89xjs9xIGmavfGNJaUq3eXRMdddQYaB1V5wtmRBZIkgePubsbcCptBtgma3ZObp5A8cdb9PQFvNxBR/B2ttKupMQ/uiVN05/RNPHziKm+aada8+gPwRJR8PDNbNy/TEA8L82iB8LgCMmPnqyVefqm+VoNYa/AmDefcWrBogQ7lIB49KezbRiXIbZ5RiAPq2VgqUTHq2cRAN6BprH89g2FajBs5I7wj7nTQwtPu74FRu3BRHF9k8Vgf4A4jdocn4sU/GCH5Gm1x7d1Rxd8T4OkyQtJ1YaRLwksf/lkttqoOD+fZ3twJxXtYKVKt0wmavVlMUl5+IP3Yrl8SdfmGENMyfkjjuhfPq/TpA00PDoB4RXf2MAh6fTVF+sVw7vXndQ8tYMLFjBgLx2y++W6LT+glvHhROf3LWnk3EgrhhB6FxEpmfuogp2y3pZ8fkMaKplOFFfw0AnVDRbCqx+0u6P9JiQmV0hUl4LHn7rqPNPbtv7adX778RptvMjWG87rwFiU/whhVWbIoF4P0W8081lVDTEe9V3LRNd9t7U9Ca/pIowEzXe5X5rWrlqm/CtCYLzT6apTMLXuacGYBJY7VfY+8uXG0WymZ8GfcMUrFpvF8bwPMs0nPaq3i1Jm+zVy9QMz9pl6xTKwN2CwfIFeHOp8",
11
+ "payload": {
12
+ "object": "session_verification",
13
+ "session_id": "sid_0123456789abcdefghjkmnpqrs",
14
+ "decision": {
15
+ "event_id": "evt_0123456789abcdefghjkmnpqrs",
16
+ "verdict": "human",
17
+ "risk_score": 7,
18
+ "phase": "behavioral",
19
+ "is_provisional": false,
20
+ "manipulation": {
21
+ "score": 0,
22
+ "verdict": "none"
23
+ },
24
+ "evaluation_duration_ms": 123,
25
+ "evaluated_at": "2026-03-24T20:00:00.000Z"
26
+ },
27
+ "request": {
28
+ "user_agent": "Mozilla/5.0",
29
+ "url": "https://example.com/signup",
30
+ "screen_size": "1440x900",
31
+ "is_touch_capable": false,
32
+ "ip_address": "203.0.113.9"
33
+ },
34
+ "visitor_fingerprint": {
35
+ "object": "visitor_fingerprint",
36
+ "id": "vid_0123456789abcdefghjkmnpqrs",
37
+ "confidence": 94,
38
+ "identified_at": "2026-03-24T19:59:59.000Z"
39
+ },
40
+ "signals": [
41
+ {
42
+ "id": "E6",
43
+ "category": "environment",
44
+ "confidence": "strong",
45
+ "score": 20
46
+ }
47
+ ],
48
+ "score_breakdown": {
49
+ "categories": {
50
+ "behavioral": 9,
51
+ "environment": 20
52
+ }
53
+ },
54
+ "attribution": {
55
+ "bot": null
56
+ },
57
+ "embed": null
58
+ }
59
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "secret": "whsec_test",
3
+ "timestamp": "1735776000",
4
+ "expired_timestamp": "1735775400",
5
+ "now_seconds": 1735776000,
6
+ "raw_body": "{\"id\":\"wevt_0123456789abcdef0123456789abcdef\",\"object\":\"webhook_event\",\"type\":\"session.result.persisted\",\"created\":\"2026-01-02T00:00:00.000Z\",\"data\":{\"object\":\"session_result\",\"session\":{\"id\":\"sid_0123456789abcdefghjkmnpqrs\"}}}",
7
+ "signature": "bd76efe49c06ccb25ed39db7422fc3f58641337b57b6d73a2b5061dc4ea59192",
8
+ "invalid_signature": "0d76efe49c06ccb25ed39db7422fc3f58641337b57b6d73a2b5061dc4ea59192"
9
+ }