tripwire-server 0.1.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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +99 -0
- data/lib/tripwire/server/client.rb +265 -0
- data/lib/tripwire/server/errors.rb +21 -0
- data/lib/tripwire/server/sealed_token.rb +76 -0
- data/lib/tripwire/server/types.rb +5 -0
- data/lib/tripwire/server/version.rb +5 -0
- data/lib/tripwire/server.rb +19 -0
- data/spec/LICENSE +21 -0
- data/spec/README.md +129 -0
- data/spec/fixtures/errors/invalid-api-key.json +10 -0
- data/spec/fixtures/errors/missing-api-key.json +10 -0
- data/spec/fixtures/errors/not-found.json +10 -0
- data/spec/fixtures/errors/validation-error.json +21 -0
- data/spec/fixtures/public-api/fingerprints/detail.json +40 -0
- data/spec/fixtures/public-api/fingerprints/list.json +31 -0
- data/spec/fixtures/public-api/sessions/detail.json +47 -0
- data/spec/fixtures/public-api/sessions/list.json +33 -0
- data/spec/fixtures/public-api/teams/api-key-create.json +18 -0
- data/spec/fixtures/public-api/teams/api-key-list.json +23 -0
- data/spec/fixtures/public-api/teams/api-key-revoke.json +3 -0
- data/spec/fixtures/public-api/teams/api-key-rotate.json +18 -0
- data/spec/fixtures/public-api/teams/team-create.json +11 -0
- data/spec/fixtures/public-api/teams/team-update.json +11 -0
- data/spec/fixtures/public-api/teams/team.json +11 -0
- data/spec/fixtures/sealed-token/invalid.json +4 -0
- data/spec/fixtures/sealed-token/vector.v1.json +41 -0
- data/spec/openapi.json +1435 -0
- data/spec/sealed-token.md +95 -0
- metadata +73 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"error": {
|
|
3
|
+
"code": "auth.missing_api_key",
|
|
4
|
+
"message": "Missing Authorization header. Send Authorization: Bearer <token> to authenticate this request.",
|
|
5
|
+
"status": 401,
|
|
6
|
+
"retryable": false,
|
|
7
|
+
"requestId": "req_missing_api_key",
|
|
8
|
+
"docsUrl": "https://tripwire.com/docs/api-reference/introduction"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"error": {
|
|
3
|
+
"code": "request.validation_failed",
|
|
4
|
+
"message": "Session list query parameters are invalid. Check limit, cursor, and verdict before retrying.",
|
|
5
|
+
"status": 400,
|
|
6
|
+
"retryable": false,
|
|
7
|
+
"requestId": "req_validation_error",
|
|
8
|
+
"docsUrl": "https://tripwire.com/docs/api-reference/sessions",
|
|
9
|
+
"details": {
|
|
10
|
+
"fieldErrors": [
|
|
11
|
+
{
|
|
12
|
+
"field": "limit",
|
|
13
|
+
"issue": "invalid_integer",
|
|
14
|
+
"expected": "integer between 1 and 200",
|
|
15
|
+
"received": "999"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"query": "sessions"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"object": "fingerprint",
|
|
4
|
+
"id": "vis_example_one",
|
|
5
|
+
"firstSeenAt": "2026-03-24T19:58:00.000Z",
|
|
6
|
+
"lastSeenAt": "2026-03-24T20:00:05.000Z",
|
|
7
|
+
"seenCount": 3,
|
|
8
|
+
"lastUserAgent": "Mozilla/5.0",
|
|
9
|
+
"lastIp": "203.0.113.9",
|
|
10
|
+
"expiresAt": "2026-06-22T20:00:05.000Z",
|
|
11
|
+
"anchorWebglHash": null,
|
|
12
|
+
"anchorParamsHash": null,
|
|
13
|
+
"anchorAudioHash": null,
|
|
14
|
+
"fingerprintVector": [
|
|
15
|
+
1,
|
|
16
|
+
0,
|
|
17
|
+
1
|
|
18
|
+
],
|
|
19
|
+
"hasCookie": true,
|
|
20
|
+
"hasLs": true,
|
|
21
|
+
"hasIdb": true,
|
|
22
|
+
"hasSw": false,
|
|
23
|
+
"hasWn": false,
|
|
24
|
+
"sessions": [
|
|
25
|
+
{
|
|
26
|
+
"eventId": "evt_example_one",
|
|
27
|
+
"verdict": "human",
|
|
28
|
+
"riskScore": 9,
|
|
29
|
+
"scoredAt": "2026-03-24T20:00:05.000Z",
|
|
30
|
+
"userAgent": "Mozilla/5.0",
|
|
31
|
+
"url": "https://example.com/signup",
|
|
32
|
+
"clientIp": "203.0.113.9",
|
|
33
|
+
"screenSize": "1440x900",
|
|
34
|
+
"categoryScores": {
|
|
35
|
+
"behavioral": 9
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"object": "fingerprint",
|
|
5
|
+
"id": "vis_example_one",
|
|
6
|
+
"firstSeenAt": "2026-03-24T19:58:00.000Z",
|
|
7
|
+
"lastSeenAt": "2026-03-24T20:00:05.000Z",
|
|
8
|
+
"seenCount": 3,
|
|
9
|
+
"lastUserAgent": "Mozilla/5.0",
|
|
10
|
+
"lastIp": "203.0.113.9",
|
|
11
|
+
"expiresAt": "2026-06-22T20:00:05.000Z",
|
|
12
|
+
"anchorWebglHash": null,
|
|
13
|
+
"anchorParamsHash": null,
|
|
14
|
+
"anchorAudioHash": null,
|
|
15
|
+
"fingerprintVector": [
|
|
16
|
+
1,
|
|
17
|
+
0,
|
|
18
|
+
1
|
|
19
|
+
],
|
|
20
|
+
"hasCookie": true,
|
|
21
|
+
"hasLs": true,
|
|
22
|
+
"hasIdb": true,
|
|
23
|
+
"hasSw": false,
|
|
24
|
+
"hasWn": false
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"pagination": {
|
|
28
|
+
"limit": 50,
|
|
29
|
+
"hasMore": false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"object": "session",
|
|
4
|
+
"id": "sid_example_one",
|
|
5
|
+
"createdAt": "2026-03-24T20:00:00.000Z",
|
|
6
|
+
"latestEventId": "evt_example_one",
|
|
7
|
+
"latestResult": {
|
|
8
|
+
"eventId": "evt_example_one",
|
|
9
|
+
"verdict": "human",
|
|
10
|
+
"riskScore": 9,
|
|
11
|
+
"phase": "behavioral",
|
|
12
|
+
"provisional": false,
|
|
13
|
+
"manipulationScore": 0,
|
|
14
|
+
"manipulationVerdict": "none",
|
|
15
|
+
"evaluationDuration": 142,
|
|
16
|
+
"scoredAt": "2026-03-24T20:00:05.000Z",
|
|
17
|
+
"visitorId": "vis_example_one",
|
|
18
|
+
"metadata": {
|
|
19
|
+
"userAgent": "Mozilla/5.0",
|
|
20
|
+
"url": "https://example.com/signup",
|
|
21
|
+
"screenSize": "1440x900",
|
|
22
|
+
"touchDevice": false,
|
|
23
|
+
"clientIp": "203.0.113.9"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"ipIntel": null,
|
|
27
|
+
"fingerprint": {
|
|
28
|
+
"object": "fingerprint",
|
|
29
|
+
"id": "vis_example_one",
|
|
30
|
+
"confidence": 94,
|
|
31
|
+
"timestamp": "2026-03-24T20:00:05.000Z"
|
|
32
|
+
},
|
|
33
|
+
"resultHistory": [
|
|
34
|
+
{
|
|
35
|
+
"eventId": "evt_example_one",
|
|
36
|
+
"verdict": "human",
|
|
37
|
+
"riskScore": 9,
|
|
38
|
+
"phase": "behavioral",
|
|
39
|
+
"provisional": false,
|
|
40
|
+
"manipulationScore": 0,
|
|
41
|
+
"manipulationVerdict": "none",
|
|
42
|
+
"evaluationDuration": 142,
|
|
43
|
+
"scoredAt": "2026-03-24T20:00:05.000Z"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"object": "session",
|
|
5
|
+
"id": "sid_example_one",
|
|
6
|
+
"createdAt": "2026-03-24T20:00:00.000Z",
|
|
7
|
+
"latestEventId": "evt_example_one",
|
|
8
|
+
"latestResult": {
|
|
9
|
+
"eventId": "evt_example_one",
|
|
10
|
+
"verdict": "human",
|
|
11
|
+
"riskScore": 9,
|
|
12
|
+
"phase": "behavioral",
|
|
13
|
+
"provisional": false,
|
|
14
|
+
"manipulationScore": 0,
|
|
15
|
+
"manipulationVerdict": "none",
|
|
16
|
+
"evaluationDuration": 142,
|
|
17
|
+
"scoredAt": "2026-03-24T20:00:05.000Z"
|
|
18
|
+
},
|
|
19
|
+
"fingerprint": {
|
|
20
|
+
"object": "fingerprint",
|
|
21
|
+
"id": "vis_example_one",
|
|
22
|
+
"confidence": 94,
|
|
23
|
+
"timestamp": "2026-03-24T20:00:05.000Z"
|
|
24
|
+
},
|
|
25
|
+
"lastScoredAt": "2026-03-24T20:00:05.000Z"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"pagination": {
|
|
29
|
+
"limit": 50,
|
|
30
|
+
"hasMore": true,
|
|
31
|
+
"nextCursor": "cur_sessions_page_2"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"object": "api_key",
|
|
4
|
+
"id": "key_example",
|
|
5
|
+
"key": "pk_live_example",
|
|
6
|
+
"secretKey": "sk_live_example",
|
|
7
|
+
"name": "Production",
|
|
8
|
+
"isTest": false,
|
|
9
|
+
"allowedOrigins": [
|
|
10
|
+
"https://example.com"
|
|
11
|
+
],
|
|
12
|
+
"rateLimit": 600,
|
|
13
|
+
"status": "active",
|
|
14
|
+
"createdAt": "2026-03-24T19:00:00.000Z",
|
|
15
|
+
"rotatedAt": null,
|
|
16
|
+
"revokedAt": null
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"object": "api_key",
|
|
5
|
+
"id": "key_example",
|
|
6
|
+
"key": "pk_live_example",
|
|
7
|
+
"name": "Production",
|
|
8
|
+
"isTest": false,
|
|
9
|
+
"allowedOrigins": [
|
|
10
|
+
"https://example.com"
|
|
11
|
+
],
|
|
12
|
+
"rateLimit": 600,
|
|
13
|
+
"status": "active",
|
|
14
|
+
"createdAt": "2026-03-24T19:00:00.000Z",
|
|
15
|
+
"rotatedAt": null,
|
|
16
|
+
"revokedAt": null
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"pagination": {
|
|
20
|
+
"limit": 50,
|
|
21
|
+
"hasMore": false
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"object": "api_key",
|
|
4
|
+
"id": "key_rotated",
|
|
5
|
+
"key": "pk_live_rotated",
|
|
6
|
+
"secretKey": "sk_live_rotated",
|
|
7
|
+
"name": "Production",
|
|
8
|
+
"isTest": false,
|
|
9
|
+
"allowedOrigins": [
|
|
10
|
+
"https://example.com"
|
|
11
|
+
],
|
|
12
|
+
"rateLimit": 600,
|
|
13
|
+
"status": "active",
|
|
14
|
+
"createdAt": "2026-03-24T19:10:00.000Z",
|
|
15
|
+
"rotatedAt": null,
|
|
16
|
+
"revokedAt": null
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
{
|
|
2
|
+
"token": "Ae06cX3X+GJm5kIEpWCttcHCIVI9o3Y0HWX/clGdryb0XO2K0eIIsEkh3bdtCTKJMfykSJGkECwhajrvmYFjPSPMbs7gSfUeUnKYHX/4hV1SZNkGby8hHvrhPGiXuxOeqwBfTokfhpJrUIMVLhH3DArgNBi9su6VFrdYNoSf9ca8ttWY/mq2fDvQdHoNg8Kg8VNnCTEALVcOOf4TwtLqbp59GRto59rDPQpFtWFtGcCDNCvGsMoBqqdm3gcEsD38nGIiWhasFlr9/1h26qJhDl7Jy4ZYIjhSxLQRv8O/Xj+YBbQvM5NkhgqfrvTVdzQkpuvM3HZawOXw9PP5MowhzLLKWEEPwgJnWbLXqxVmB1IXU6yovT9jNPiYW9bNlAb0QzhNVHfJWsy247VGMVSXEO7FKu3L3JVhuU7HzoV+DNjQXjp3KzwNw7AbzGTEqJGrEgc8WgkbDSpWl86X+jJv6igFf308BT49QcP7GlpklYM+c9olYThBy1+LAAAA",
|
|
3
|
+
"reason": "authentication_failure"
|
|
4
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"secretKey": "sk_live_fixture_secret",
|
|
4
|
+
"secretHash": "c173e2c1467e446744e3b6aba8fc07e639008fdf3c4b82e32dceef9b41217dc3",
|
|
5
|
+
"token": "Ae06cX3X+GJm5kIEpWCttcHCIVI9o3Y0HWX/clGdryb0XO2K0eIIsEkh3bdtCTKJMfykSJGkECwhajrvmYFjPSPMbs7gSfUeUnKYHX/4hV1SZNkGby8hHvrhPGiXuxOeqwBfTokfhpJrUIMVLhH3DArgNBi9su6VFrdYNoSf9ca8ttWY/mq2fDvQdHoNg8Kg8VNnCTEALVcOOf4TwtLqbp59GRto59rDPQpFtWFtGcCDNCvGsMoBqqdm3gcEsD38nGIiWhasFlr9/1h26qJhDl7Jy4ZYIjhSxLQRv8O/Xj+YBbQvM5NkhgqfrvTVdzQkpuvM3HZawOXw9PP5MowhzLLKWEEPwgJnWbLXqxVmB1IXU6yovT9jNPiYW9bNlAb0QzhNVHfJWsy247VGMVSXEO7FKu3L3JVhuU7HzoV+DNjQXjp3KzwNw7AbzGTEqJGrEgc8WgkbDSpWl86X+jJv6igFf308BT49QcP7GlpklYM+c9olYThBy1+L8Mw=",
|
|
6
|
+
"payload": {
|
|
7
|
+
"eventId": "evt_fixture",
|
|
8
|
+
"sessionId": "sid_fixture",
|
|
9
|
+
"verdict": "human",
|
|
10
|
+
"score": 7,
|
|
11
|
+
"manipulationScore": 0,
|
|
12
|
+
"manipulationVerdict": "none",
|
|
13
|
+
"evaluationDuration": 123,
|
|
14
|
+
"scoredAt": 1711310400000,
|
|
15
|
+
"metadata": {
|
|
16
|
+
"userAgent": "Mozilla/5.0",
|
|
17
|
+
"url": "https://example.com/signup",
|
|
18
|
+
"screenSize": "1440x900",
|
|
19
|
+
"touchDevice": false,
|
|
20
|
+
"clientIp": "203.0.113.9"
|
|
21
|
+
},
|
|
22
|
+
"signals": [
|
|
23
|
+
{
|
|
24
|
+
"id": "E6",
|
|
25
|
+
"category": "environment",
|
|
26
|
+
"confidence": "low",
|
|
27
|
+
"score": 20
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"categoryScores": {
|
|
31
|
+
"behavioral": 9,
|
|
32
|
+
"environment": 20
|
|
33
|
+
},
|
|
34
|
+
"botAttribution": null,
|
|
35
|
+
"visitorId": "vis_fixture",
|
|
36
|
+
"visitorIdConfidence": 94,
|
|
37
|
+
"embedContext": null,
|
|
38
|
+
"phase": "behavioral",
|
|
39
|
+
"provisional": false
|
|
40
|
+
}
|
|
41
|
+
}
|