foil-server 0.3.5 → 0.5.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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -30
  3. data/lib/foil/server/client.rb +31 -159
  4. data/lib/foil/server/sealed_token.rb +18 -1
  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/fingerprints/detail.json +1 -1
  10. data/spec/fixtures/api/fingerprints/list.json +1 -1
  11. data/spec/fixtures/api/organizations/api-key-create.json +1 -0
  12. data/spec/fixtures/api/organizations/api-key-list.json +1 -0
  13. data/spec/fixtures/api/organizations/api-key-revoke.json +1 -0
  14. data/spec/fixtures/api/organizations/api-key-rotate.json +1 -0
  15. data/spec/fixtures/api/organizations/api-key-update.json +1 -0
  16. data/spec/fixtures/api/sessions/detail.json +18 -8
  17. data/spec/fixtures/api/sessions/list.json +1 -0
  18. data/spec/fixtures/manifest.json +0 -85
  19. data/spec/fixtures/webhooks/signature.json +9 -0
  20. data/spec/openapi.json +2335 -6503
  21. metadata +4 -22
  22. data/lib/foil/server/gate_delivery.rb +0 -332
  23. data/spec/fixtures/api/gate/agent-token-revoke.json +0 -3
  24. data/spec/fixtures/api/gate/agent-token-verify.json +0 -12
  25. data/spec/fixtures/api/gate/login-session-consume.json +0 -10
  26. data/spec/fixtures/api/gate/login-session-create.json +0 -12
  27. data/spec/fixtures/api/gate/registry-detail.json +0 -45
  28. data/spec/fixtures/api/gate/registry-list.json +0 -47
  29. data/spec/fixtures/api/gate/service-create.json +0 -49
  30. data/spec/fixtures/api/gate/service-detail.json +0 -49
  31. data/spec/fixtures/api/gate/service-disable.json +0 -49
  32. data/spec/fixtures/api/gate/service-update.json +0 -49
  33. data/spec/fixtures/api/gate/services-list.json +0 -51
  34. data/spec/fixtures/api/gate/session-ack.json +0 -10
  35. data/spec/fixtures/api/gate/session-create.json +0 -13
  36. data/spec/fixtures/api/gate/session-poll.json +0 -36
  37. data/spec/fixtures/gate-delivery/approved-webhook-payload.valid.json +0 -19
  38. data/spec/fixtures/gate-delivery/delivery-request.json +0 -9
  39. data/spec/fixtures/gate-delivery/env-policy.json +0 -40
  40. data/spec/fixtures/gate-delivery/vector.v1.json +0 -28
  41. data/spec/fixtures/gate-delivery/webhook-signature.json +0 -9
@@ -10,6 +10,7 @@
10
10
  "https://example.com",
11
11
  "https://app.example.com"
12
12
  ],
13
+ "client_target": "browser",
13
14
  "scopes": [
14
15
  "sessions:list",
15
16
  "sessions:read"
@@ -4,6 +4,8 @@
4
4
  "id": "sid_0123456789abcdefghjkmnpqrs",
5
5
  "created_at": "2026-03-24T20:00:00.000Z",
6
6
  "client_user_id": "user_123",
7
+ "client_application_id": "app_123",
8
+ "behavior": null,
7
9
  "decision": {
8
10
  "event_id": "evt_23456789abcdefghjkmnpqrstv",
9
11
  "automation_status": "automated",
@@ -143,7 +145,7 @@
143
145
  "accuracy_radius_km": 10
144
146
  },
145
147
  "routing": {
146
- "asn": "64512",
148
+ "asn": "AS64512",
147
149
  "organization": "Example Networks"
148
150
  },
149
151
  "anonymity": {
@@ -173,7 +175,7 @@
173
175
  "client_types": [
174
176
  "consumer"
175
177
  ],
176
- "client_count": 3
178
+ "client_count": null
177
179
  },
178
180
  "evaluated_at": "2026-03-24T20:00:05.000Z"
179
181
  },
@@ -198,10 +200,15 @@
198
200
  "id": "vid_456789abcdefghjkmnpqrstvwx",
199
201
  "confidence": 93,
200
202
  "identified_at": "2026-03-24T20:00:01.000Z",
203
+ "resolution": {
204
+ "method": "continuity",
205
+ "basis": "deterministic"
206
+ },
201
207
  "lifecycle": {
202
208
  "first_seen_at": "2026-03-01T18:22:11.000Z",
203
209
  "last_seen_at": "2026-03-24T20:00:05.000Z",
204
- "seen_count": 14
210
+ "seen_count": 14,
211
+ "resolution_count": 14
205
212
  }
206
213
  },
207
214
  "connection_fingerprint": {
@@ -257,7 +264,8 @@
257
264
  "name": "Chromium",
258
265
  "version": "123.0.0.0",
259
266
  "major_version": "123",
260
- "engine": "blink"
267
+ "engine": "blink",
268
+ "app_name": null
261
269
  },
262
270
  "device": {
263
271
  "form_factor": "desktop",
@@ -347,6 +355,7 @@
347
355
  ],
348
356
  "client_telemetry": {
349
357
  "navigator": {
358
+ "model": null,
350
359
  "platform": "macOS",
351
360
  "vendor": "Google Inc.",
352
361
  "hardware_concurrency": null,
@@ -376,7 +385,7 @@
376
385
  },
377
386
  "canvas": {
378
387
  "hash": 123456,
379
- "geometry_hash": 998877,
388
+ "geometry_hash": null,
380
389
  "text_hash": 112233,
381
390
  "winding": null,
382
391
  "noise_detected": true,
@@ -391,6 +400,7 @@
391
400
  "parameters_hash": "params_123",
392
401
  "extensions_hash": 333444,
393
402
  "extension_parameters_hash": "webgl2_456",
403
+ "webgl2_parameters_hash": "webgl2_456",
394
404
  "shader_precision_hash": 777888
395
405
  },
396
406
  "webgpu": {
@@ -405,7 +415,7 @@
405
415
  "audio": {
406
416
  "hash": 124.0434,
407
417
  "sample_rate": 48000,
408
- "channel_count": null,
418
+ "channel_count": 2,
409
419
  "voice_count": 3,
410
420
  "local_voice_count": 2,
411
421
  "default_voice_lang": "en-US",
@@ -413,11 +423,11 @@
413
423
  },
414
424
  "fonts": {
415
425
  "detected_count": 2,
416
- "tested_count": null,
426
+ "tested_count": 41,
417
427
  "enumeration_hash": 3649417752,
418
428
  "metrics_hash": 223344,
419
429
  "preferences_hash": null,
420
- "emoji_hash": 112233
430
+ "emoji_hash": "5f0e2a71"
421
431
  },
422
432
  "media": {
423
433
  "device_count": 1,
@@ -5,6 +5,7 @@
5
5
  "id": "sid_0123456789abcdefghjkmnpqrs",
6
6
  "created_at": "2026-03-24T20:00:00.000Z",
7
7
  "client_user_id": "user_123",
8
+ "client_application_id": "app_123",
8
9
  "latest_decision": {
9
10
  "event_id": "evt_23456789abcdefghjkmnpqrstv",
10
11
  "verdict": "human",
@@ -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,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
+ }