tripwire-server 0.1.1 → 0.3.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -13
  3. data/lib/tripwire/server/client.rb +171 -16
  4. data/lib/tripwire/server/crypto_support.rb +49 -0
  5. data/lib/tripwire/server/gate_delivery.rb +298 -0
  6. data/lib/tripwire/server/sealed_token.rb +2 -0
  7. data/lib/tripwire/server/version.rb +1 -1
  8. data/lib/tripwire/server.rb +12 -0
  9. data/spec/README.md +37 -6
  10. data/spec/fixtures/api/fingerprints/detail.json +70 -0
  11. data/spec/fixtures/api/fingerprints/list.json +37 -0
  12. data/spec/fixtures/api/gate/agent-token-verify.json +12 -0
  13. data/spec/fixtures/api/gate/login-session-consume.json +10 -0
  14. data/spec/fixtures/api/gate/login-session-create.json +12 -0
  15. data/spec/fixtures/api/gate/registry-detail.json +45 -0
  16. data/spec/fixtures/api/gate/registry-list.json +47 -0
  17. data/spec/fixtures/api/gate/service-create.json +49 -0
  18. data/spec/fixtures/api/gate/service-detail.json +49 -0
  19. data/spec/fixtures/api/gate/service-disable.json +49 -0
  20. data/spec/fixtures/api/gate/service-update.json +49 -0
  21. data/spec/fixtures/api/gate/services-list.json +51 -0
  22. data/spec/fixtures/api/gate/session-ack.json +10 -0
  23. data/spec/fixtures/api/gate/session-create.json +13 -0
  24. data/spec/fixtures/api/gate/session-poll.json +36 -0
  25. data/spec/fixtures/api/sessions/detail.json +405 -0
  26. data/spec/fixtures/api/sessions/list.json +36 -0
  27. data/spec/fixtures/api/teams/api-key-create.json +21 -0
  28. data/spec/fixtures/api/teams/api-key-list.json +26 -0
  29. data/spec/fixtures/api/teams/api-key-revoke.json +20 -0
  30. data/spec/fixtures/api/teams/api-key-rotate.json +21 -0
  31. data/spec/fixtures/api/teams/team-create.json +14 -0
  32. data/spec/fixtures/api/teams/team-update.json +14 -0
  33. data/spec/fixtures/api/teams/team.json +14 -0
  34. data/spec/fixtures/errors/invalid-api-key.json +3 -3
  35. data/spec/fixtures/errors/missing-api-key.json +2 -2
  36. data/spec/fixtures/errors/not-found.json +4 -4
  37. data/spec/fixtures/errors/validation-error.json +6 -7
  38. data/spec/fixtures/gate-delivery/approved-webhook-payload.valid.json +20 -0
  39. data/spec/fixtures/gate-delivery/delivery-request.json +9 -0
  40. data/spec/fixtures/gate-delivery/env-policy.json +40 -0
  41. data/spec/fixtures/gate-delivery/vector.v1.json +28 -0
  42. data/spec/fixtures/gate-delivery/webhook-signature.json +9 -0
  43. data/spec/fixtures/manifest.json +179 -0
  44. data/spec/fixtures/sealed-token/vector.v1.json +37 -24
  45. data/spec/openapi.json +4905 -779
  46. data/spec/sealed-token.md +36 -17
  47. metadata +36 -14
  48. data/spec/fixtures/public-api/fingerprints/detail.json +0 -40
  49. data/spec/fixtures/public-api/fingerprints/list.json +0 -31
  50. data/spec/fixtures/public-api/sessions/detail.json +0 -47
  51. data/spec/fixtures/public-api/sessions/list.json +0 -33
  52. data/spec/fixtures/public-api/teams/api-key-create.json +0 -18
  53. data/spec/fixtures/public-api/teams/api-key-list.json +0 -23
  54. data/spec/fixtures/public-api/teams/api-key-rotate.json +0 -18
  55. data/spec/fixtures/public-api/teams/team-create.json +0 -11
  56. data/spec/fixtures/public-api/teams/team-update.json +0 -11
  57. data/spec/fixtures/public-api/teams/team.json +0 -11
  58. /data/spec/fixtures/{public-api/teams/api-key-revoke.json → api/gate/agent-token-revoke.json} +0 -0
@@ -0,0 +1,49 @@
1
+ {
2
+ "data": {
3
+ "object": "gate_service",
4
+ "id": "acme_prod",
5
+ "status": "active",
6
+ "discoverable": false,
7
+ "name": "Acme Production",
8
+ "description": "Acme production signup flow",
9
+ "website": "https://acme.example.com",
10
+ "dashboard_login_url": "https://dashboard.acme.example.com/auth/gate",
11
+ "webhook_url": "https://api.acme.example.com/v1/gate/webhook",
12
+ "env_vars": [
13
+ {
14
+ "name": "Publishable key",
15
+ "key": "ACME_PUBLISHABLE_KEY",
16
+ "secret": false
17
+ },
18
+ {
19
+ "name": "Secret key",
20
+ "key": "ACME_SECRET_KEY",
21
+ "secret": true
22
+ }
23
+ ],
24
+ "docs_url": "https://docs.acme.example.com/signup",
25
+ "sdks": [
26
+ {
27
+ "label": "Node",
28
+ "install": "npm install @acme/sdk",
29
+ "url": "https://www.npmjs.com/package/@acme/sdk"
30
+ }
31
+ ],
32
+ "branding": {
33
+ "logo_url": "https://acme.example.com/logo.png",
34
+ "primary_color": "#117BE7",
35
+ "secondary_color": "#0B5CAD",
36
+ "ascii_art": "ACME",
37
+ "verified": false
38
+ },
39
+ "consent": {
40
+ "terms_url": "https://acme.example.com/terms",
41
+ "privacy_url": "https://acme.example.com/privacy"
42
+ },
43
+ "created_at": "2026-04-03T20:00:00.000Z",
44
+ "updated_at": "2026-04-03T20:00:00.000Z"
45
+ },
46
+ "meta": {
47
+ "request_id": "req_0123456789abcdef0123456789abcdef"
48
+ }
49
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "data": {
3
+ "object": "gate_service",
4
+ "id": "acme_prod",
5
+ "status": "active",
6
+ "discoverable": false,
7
+ "name": "Acme Production",
8
+ "description": "Acme production signup flow",
9
+ "website": "https://acme.example.com",
10
+ "dashboard_login_url": "https://dashboard.acme.example.com/auth/gate",
11
+ "webhook_url": "https://api.acme.example.com/v1/gate/webhook",
12
+ "env_vars": [
13
+ {
14
+ "name": "Publishable key",
15
+ "key": "ACME_PUBLISHABLE_KEY",
16
+ "secret": false
17
+ },
18
+ {
19
+ "name": "Secret key",
20
+ "key": "ACME_SECRET_KEY",
21
+ "secret": true
22
+ }
23
+ ],
24
+ "docs_url": "https://docs.acme.example.com/signup",
25
+ "sdks": [
26
+ {
27
+ "label": "Node",
28
+ "install": "npm install @acme/sdk",
29
+ "url": "https://www.npmjs.com/package/@acme/sdk"
30
+ }
31
+ ],
32
+ "branding": {
33
+ "logo_url": "https://acme.example.com/logo.png",
34
+ "primary_color": "#117BE7",
35
+ "secondary_color": "#0B5CAD",
36
+ "ascii_art": "ACME",
37
+ "verified": false
38
+ },
39
+ "consent": {
40
+ "terms_url": "https://acme.example.com/terms",
41
+ "privacy_url": "https://acme.example.com/privacy"
42
+ },
43
+ "created_at": "2026-04-03T20:00:00.000Z",
44
+ "updated_at": "2026-04-03T20:05:00.000Z"
45
+ },
46
+ "meta": {
47
+ "request_id": "req_0123456789abcdef0123456789abcdef"
48
+ }
49
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "data": {
3
+ "object": "gate_service",
4
+ "id": "acme_prod",
5
+ "status": "disabled",
6
+ "discoverable": false,
7
+ "name": "Acme Production",
8
+ "description": "Acme production signup flow",
9
+ "website": "https://acme.example.com",
10
+ "dashboard_login_url": "https://dashboard.acme.example.com/auth/gate",
11
+ "webhook_url": "https://api.acme.example.com/v1/gate/webhook",
12
+ "env_vars": [
13
+ {
14
+ "name": "Publishable key",
15
+ "key": "ACME_PUBLISHABLE_KEY",
16
+ "secret": false
17
+ },
18
+ {
19
+ "name": "Secret key",
20
+ "key": "ACME_SECRET_KEY",
21
+ "secret": true
22
+ }
23
+ ],
24
+ "docs_url": "https://docs.acme.example.com/signup",
25
+ "sdks": [
26
+ {
27
+ "label": "Node",
28
+ "install": "npm install @acme/sdk",
29
+ "url": "https://www.npmjs.com/package/@acme/sdk"
30
+ }
31
+ ],
32
+ "branding": {
33
+ "logo_url": "https://acme.example.com/logo.png",
34
+ "primary_color": "#117BE7",
35
+ "secondary_color": "#0B5CAD",
36
+ "ascii_art": "ACME",
37
+ "verified": false
38
+ },
39
+ "consent": {
40
+ "terms_url": "https://acme.example.com/terms",
41
+ "privacy_url": "https://acme.example.com/privacy"
42
+ },
43
+ "created_at": "2026-04-03T20:00:00.000Z",
44
+ "updated_at": "2026-04-03T20:15:00.000Z"
45
+ },
46
+ "meta": {
47
+ "request_id": "req_0123456789abcdef0123456789abcdef"
48
+ }
49
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "data": {
3
+ "object": "gate_service",
4
+ "id": "acme_prod",
5
+ "status": "active",
6
+ "discoverable": true,
7
+ "name": "Acme Production",
8
+ "description": "Acme production signup flow",
9
+ "website": "https://acme.example.com",
10
+ "dashboard_login_url": "https://dashboard.acme.example.com/auth/gate",
11
+ "webhook_url": "https://api.acme.example.com/v1/gate/webhook",
12
+ "env_vars": [
13
+ {
14
+ "name": "Publishable key",
15
+ "key": "ACME_PUBLISHABLE_KEY",
16
+ "secret": false
17
+ },
18
+ {
19
+ "name": "Secret key",
20
+ "key": "ACME_SECRET_KEY",
21
+ "secret": true
22
+ }
23
+ ],
24
+ "docs_url": "https://docs.acme.example.com/signup",
25
+ "sdks": [
26
+ {
27
+ "label": "Node",
28
+ "install": "npm install @acme/sdk",
29
+ "url": "https://www.npmjs.com/package/@acme/sdk"
30
+ }
31
+ ],
32
+ "branding": {
33
+ "logo_url": "https://acme.example.com/logo.png",
34
+ "primary_color": "#117BE7",
35
+ "secondary_color": "#0B5CAD",
36
+ "ascii_art": "ACME",
37
+ "verified": false
38
+ },
39
+ "consent": {
40
+ "terms_url": "https://acme.example.com/terms",
41
+ "privacy_url": "https://acme.example.com/privacy"
42
+ },
43
+ "created_at": "2026-04-03T20:00:00.000Z",
44
+ "updated_at": "2026-04-03T20:10:00.000Z"
45
+ },
46
+ "meta": {
47
+ "request_id": "req_0123456789abcdef0123456789abcdef"
48
+ }
49
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "object": "gate_service",
5
+ "id": "acme_prod",
6
+ "status": "active",
7
+ "discoverable": false,
8
+ "name": "Acme Production",
9
+ "description": "Acme production signup flow",
10
+ "website": "https://acme.example.com",
11
+ "dashboard_login_url": "https://dashboard.acme.example.com/auth/gate",
12
+ "webhook_url": "https://api.acme.example.com/v1/gate/webhook",
13
+ "env_vars": [
14
+ {
15
+ "name": "Publishable key",
16
+ "key": "ACME_PUBLISHABLE_KEY",
17
+ "secret": false
18
+ },
19
+ {
20
+ "name": "Secret key",
21
+ "key": "ACME_SECRET_KEY",
22
+ "secret": true
23
+ }
24
+ ],
25
+ "docs_url": "https://docs.acme.example.com/signup",
26
+ "sdks": [
27
+ {
28
+ "label": "Node",
29
+ "install": "npm install @acme/sdk",
30
+ "url": "https://www.npmjs.com/package/@acme/sdk"
31
+ }
32
+ ],
33
+ "branding": {
34
+ "logo_url": "https://acme.example.com/logo.png",
35
+ "primary_color": "#117BE7",
36
+ "secondary_color": "#0B5CAD",
37
+ "ascii_art": "ACME",
38
+ "verified": false
39
+ },
40
+ "consent": {
41
+ "terms_url": "https://acme.example.com/terms",
42
+ "privacy_url": "https://acme.example.com/privacy"
43
+ },
44
+ "created_at": "2026-04-03T20:00:00.000Z",
45
+ "updated_at": "2026-04-03T20:05:00.000Z"
46
+ }
47
+ ],
48
+ "meta": {
49
+ "request_id": "req_0123456789abcdef0123456789abcdef"
50
+ }
51
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "data": {
3
+ "object": "gate_session_delivery",
4
+ "gate_session_id": "gate_0123456789abcdefghjkmnpqrs",
5
+ "status": "acknowledged"
6
+ },
7
+ "meta": {
8
+ "request_id": "req_0123456789abcdef0123456789abcdef"
9
+ }
10
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "data": {
3
+ "object": "gate_session",
4
+ "id": "gate_0123456789abcdefghjkmnpqrs",
5
+ "status": "pending",
6
+ "poll_token": "gtpoll_0123456789abcdefghjkmnpqrs",
7
+ "consent_url": "https://tripwirejs.com/gate?session=gate_0123456789abcdefghjkmnpqrs",
8
+ "expires_at": "2026-04-04T20:15:00.000Z"
9
+ },
10
+ "meta": {
11
+ "request_id": "req_0123456789abcdef0123456789abcdef"
12
+ }
13
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "data": {
3
+ "object": "gate_session",
4
+ "id": "gate_0123456789abcdefghjkmnpqrs",
5
+ "status": "approved",
6
+ "expires_at": "2026-04-04T20:15:00.000Z",
7
+ "gate_account_id": "gacct_0123456789abcdefghjkmnpqrs",
8
+ "account_name": "my-project",
9
+ "delivery_bundle": {
10
+ "integrator": {
11
+ "version": 1,
12
+ "algorithm": "x25519-hkdf-sha256/aes-256-gcm",
13
+ "key_id": "kid_integrator_0123456789abcdefgh",
14
+ "ephemeral_public_key": "ephemeral_public_key_integrator",
15
+ "salt": "salt_integrator",
16
+ "iv": "iv_integrator",
17
+ "ciphertext": "ciphertext_integrator",
18
+ "tag": "tag_integrator"
19
+ },
20
+ "gate": {
21
+ "version": 1,
22
+ "algorithm": "x25519-hkdf-sha256/aes-256-gcm",
23
+ "key_id": "kid_gate_0123456789abcdefghjkm",
24
+ "ephemeral_public_key": "ephemeral_public_key_gate",
25
+ "salt": "salt_gate",
26
+ "iv": "iv_gate",
27
+ "ciphertext": "ciphertext_gate",
28
+ "tag": "tag_gate"
29
+ }
30
+ },
31
+ "docs_url": "https://tripwirejs.com/docs/gate"
32
+ },
33
+ "meta": {
34
+ "request_id": "req_0123456789abcdef0123456789abcdef"
35
+ }
36
+ }