Commit Graph

34 Commits

Author SHA1 Message Date
Sacha Al Himdani
944bcb7380 Add updated-from entity snapshot to updated webhooks
Update webhook events now carry a top-level "updatedFrom" field
alongside "data", containing a full snapshot of the entity as it was
before the update. This lets subscribers diff old vs new state (for
example the prior membership role on user:updated) without tracking
prior state themselves. It is a complete snapshot with the same shape as
"data", not a partial diff, so consumers select whatever fields they
need. The field is omitted for non-update events.

The webhook_data table gains a nullable updated_from JSONB column, and
webhook.InsertUpdateData enqueues both snapshots; InsertData delegates to
it with a nil updatedFrom so non-update callers are unaffected. Each
*:updated emission site snapshots the entity right after load, before
mutation: obligation, third-party, user (org and SCIM flows), document,
document-version, and document-version-approval-quorum. The document
emit helpers gained an optional updatedFrom argument threaded through to
the payload.

For document-version-approval-quorum:updated the snapshot requires an
extra query, so it is now gated behind the same subscription-existence
check the emitter uses: when no subscriber is configured the load is
skipped entirely rather than running (and potentially failing the
approval) for an event nobody receives.

Add integration tests (against a real Postgres, skipped when none is
reachable) covering the updated_from round-trip, the SQL NULL behavior
when no snapshot is provided, and the no-op when no subscription matches,
plus a unit test asserting updatedFrom is omitted from the payload when
absent.

Document the new field in the probod and n8n changelogs and the n8n
README.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
2026-07-15 13:59:41 +02:00
Sacha Al Himdani
4c57d201a4 Make license declarations consistently MIT
The source headers, LICENSE files, and license metadata had drifted
apart. Align the entire project to MIT:

- Convert every source-file header to the MIT text across all comment
  styles (Go, TS, TSX, JS, MJS, SQL, CSS, GraphQL, shell), including
  SPDX-License-Identifier tags
- Set the root and cookie-banner LICENSE files to the MIT text with a
  "MIT License" title line
- Switch the package.json license fields, Docker image label, and
  cookie-banner README to MIT
- Update docs and the genmodels header generator accordingly
- Normalize copyright lines to a single format
  (Copyright (c) <year(s)> Probo Inc <hello@probo.com>.): unify the
  hello@getprobo.com and hello@probo.inc emails to hello@probo.com and
  the comma-separated years to a hyphenated range

Genuine third-party references are intentionally left untouched: the
Lucide icon attributions (Lucide is ISC) and the trivy dependency
license allowlist.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
2026-07-13 16:21:14 +02:00
Sacha Al Himdani
1df4af4556 Add document webhook events
Add a resource-oriented set of webhook events for the document
lifecycle. Each event carries the document plus only the sub-resource
it concerns (version, signature or approval).

Events:
- document.created / updated / archived / unarchived / deleted
- document.version.created / updated / published / rejected / deleted
- document.version.signature.requested / signed / cancelled
- document.version.approval.requested / approved / rejected / voided

Wires the new types through the migration, Go enum, GraphQL schema,
CLI, n8n nodes and the console webhooks settings UI.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
2026-07-01 17:13:59 +02:00
Sacha Al Himdani
1948142e7a Run webhook sender on the kit worker framework
Convert the hand-rolled webhook Sender loop into a kit worker.Handler so
the sender gets the standard worker recovery, metrics and tracing
instead. Claim loads the next unprocessed webhook data and Process
performs the deliveries; behaviour is preserved with a single-concurrency
worker on the existing poll interval.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
2026-06-26 16:27:34 +02:00
Sacha Al Himdani
9ac71f948f Update contact email to hello@probo.com
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-06-09 16:45:23 +02:00
Émile Ré
f5703d390b Enforce Go style rules across codebase
Apply five style rules: convert iota string enums to typed
string constants, replace errors.As with errors.AsType,
merge three-group imports into two groups, fix multiline
parameter/argument formatting, and replace fmt.Sprintf URL
construction with net/url.

Signed-off-by: Émile Ré <emile@probo.com>
2026-05-20 11:46:39 +04:00
Émile Ré
9156d6a16a Add wsl linter and fix
Signed-off-by: Émile Ré <emile@probo.com>
2026-05-20 09:27:28 +04:00
Sacha Al Himdani
eecbe4c46c Rename vendors to third parties
Renames the user-facing 'vendor' concept to 'third party' across the
entire codebase. The shared common_third_parties reference table is
unchanged.

Migration. Renames the vendor_category enum, the vendors and
vendor_<entity> tables (contacts, services, compliance_reports,
business_associate_agreements, data_privacy_agreements,
risk_assessments) and their vendor_id columns, the asset_vendors /
data_vendors / processing_activity_vendors junction tables,
generated_documents.vendors_document_id, the webhook_event_type
'vendor:<verb>' values, and the snapshots_type 'VENDORS' value.

Backend. Renames coredata models and SQL queries, probo services,
GraphQL / MCP API surface, console / trust / webhook resolvers and
types, the CLI (prb vendor* -> prb third-party*; pkg/cmd/vendormgmt
-> pkg/cmd/thirdpartymgmt), the document generator, vetting agent
prompts, and the common-third-parties-import command.

Frontend, packages, n8n, e2e. Renames apps/console pages, components,
hooks, routes, dialogs, and tabs; the shared @probo/vendors package
(now @probo/third-parties); the @probo/ui Vendors atoms (now
ThirdParties, VendorLogo -> ThirdPartyLogo); the n8n community node
actions/vendor folder (now actions/thirdParty); and the e2e Go test
suite (console and MCP). Filesystem and URL paths use kebab-case
(third-parties), GraphQL fields and TypeScript identifiers use
camelCase (thirdParty / thirdParties), Go types use PascalCase
(ThirdParty), and human-facing text uses 'third party' with a space.

Co-authored-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-05-13 21:21:39 +02:00
Sacha Al Himdani
6c5c1fa818 Remove meeting feature
Drop meetings and meeting_attendees tables, remove all meeting-related
code across GraphQL, MCP, CLI, N8N, webhooks, frontend, and e2e tests.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-20 15:37:39 +02:00
Bryan Frimin
472ca703b5 Mitiate SSRF attack
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-20 12:11:17 +02:00
Sacha Al Himdani
06c0972551 Add membership and host to user webhook payload
Nest membership ID, role, and state into a membership sub-object
in the user webhook payload. Also emit user:updated webhook when
the membership role is changed. Add X-Probo-Webhook-Host header
to webhook HTTP calls. Skip delete webhook when membership is
not found in SCIM user deletion.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-13 17:14:01 +02:00
Bryan Frimin
f17fb7bf49 Upgrade to kit v0.3.0
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-03 11:56:06 +02:00
Sacha Al Himdani
8c02c53315 Update copyright headers across all Go files
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-25 17:38:32 +01:00
Sacha Al Himdani
d5c62a9383 Run go fmt/fix
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-13 14:48:13 +01:00
Bryan Frimin
e393411333 Move kind to string
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:02 +01:00
Émile Ré
909beeb606 Migrate some trust_center_access columns to profiles
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-05 10:36:08 +04:00
Sacha Al Himdani
21ed4113c3 Go format
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-03 11:17:05 +01:00
Sacha Al Himdani
6a83b53b47 Add obligation webhooks
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-27 17:14:26 +01:00
Sacha Al Himdani
6905472fba Add user webhooks
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-27 10:14:53 +01:00
Sacha Al Himdani
d99b90fb8c Fix style
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:54:50 +01:00
Sacha Al Himdani
754bc6d222 Change insert event name
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:28 +01:00
Sacha Al Himdani
60538ef2bb Change webhook configuration to subscription
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:28 +01:00
Sacha Al Himdani
6de906d0a9 Remove status on webhook data
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:28 +01:00
Sacha Al Himdani
2d2546ee1b Remove endpoint on webhook events
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:27 +01:00
Sacha Al Himdani
4536b5578e Add organization in header
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:27 +01:00
Sacha Al Himdani
c81205aaa1 Allow only https
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:27 +01:00
Sacha Al Himdani
c163ca9bf0 Add cache ttl
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:27 +01:00
Sacha Al Himdani
ae6e6b665b Add failed status to webhook data
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:27 +01:00
Sacha Al Himdani
3b9a1edf68 Fix small issues
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:26 +01:00
Sacha Al Himdani
5c33f20d82 Wrap errors
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:26 +01:00
Sacha Al Himdani
9cc6f2afc2 Add cache validation
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:26 +01:00
Sacha Al Himdani
a1e726ec49 Change webhook table names
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:26 +01:00
Sacha Al Himdani
5a8c60a5aa Add webhooks type
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:25 +01:00
Sacha Al Himdani
f9de9c4834 Add webhooks
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-13 18:28:25 +01:00