Commit Graph

3913 Commits

Author SHA1 Message Date
Sacha Al Himdani
eacfcf8558 Release v0.180.0
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-05-04 14:46:01 +02:00
Sacha Al Himdani
385df9ee6a Use natural sort for SOA document export rows
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-05-04 14:34:33 +02:00
Sacha Al Himdani
553901e4ad Add risk publish to document system
Replace the old snapshot-based system for risks with the publish
document system, mirroring the prior vendor / processing activity / DPIA
/ TIA migration. Includes the GraphQL mutation, MCP tool, CLI command,
n8n operation, frontend publish dialog, e2e tests, and a prosemirror
register template covering name, description, category, treatment,
owner, inherent and residual scoring, and notes.

The risk register lives as a generated DocumentTypeRegister document on
the organization, reused across publishes (the major version bumps on
every republish). Approvers can be passed in to create a draft pending
approval; otherwise the version is published immediately. The frontend
Risks page exposes a Publish button and a Document link button when the
document exists, and pre-fills the previous default approvers.

Risks was the last remaining snapshot type, so this commit also removes
the entire snapshot system: drop snapshotId from the Risk GraphQL type
and RiskFilter; remove RiskSnapshotter, Risks.Snapshot,
InsertRiskSnapshots, and the SnapshotID/SourceID fields on Risk; delete
Snapshot, ControlSnapshot, SnapshotsType, SnapshotOrderField,
Snapshottable, the SnapshotService, the Snapshot console resolvers and
GraphQL schema, the Snapshot MCP types and operations
(list/get/take/listControlSnapshots), the snapshot CLI (prb snapshot),
the snapshot frontend pages, routes, banner, LinkedSnapshotsCard,
SnapshotGraph, snapshot helpers, and the snapshot n8n resource and
control link/unlink snapshot operations. The snapshot_id columns remain
in the database but are now filtered out with snapshot_id IS NULL.

Add Get/Upsert/Clear GeneratedDocumentID methods on Risk backed by a new
risks_document_id column on generated_documents, matching the
ProcessingActivity/Finding/Vendor pattern. The migration command
migrate-risk-snapshots-to-documents uses raw SQL queries instead of the
Go snapshot types, since those are gone.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-05-04 14:13:42 +02:00
Émile Ré
01bc3ac696 Release v0.179.1 2026-05-02 22:18:18 +04:00
Émile Ré
2ceb8f4126 Fix n8n cookieConsentRecord getAll operation
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 22:13:32 +04:00
Émile Ré
2212cb82e3 Release v0.179.0 2026-05-02 21:45:17 +04:00
Émile Ré
25ca990147 Fix lint
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 21:27:56 +04:00
Émile Ré
3e8cd8444a Bump @probo/cookie-banner to 0.2.0
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 21:24:39 +04:00
Émile Ré
8fcae896de Fix detected-cookies e2e test URL missing /api prefix
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 21:04:10 +04:00
Émile Ré
931ce4642d Move equal helpers into pkg/cookiebanner as unexported functions
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 19:57:56 +04:00
Émile Ré
60d6c366c3 Fix detected cookies test trying to activate an already-active banner
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 19:51:16 +04:00
Émile Ré
a92690cdc3 Remove unused pkg/equal package
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 19:48:30 +04:00
Émile Ré
a83d313dfa Clear pending queue before stopping on 404
When flush receives a 404, stop() would re-flush remaining
pending cookies to a dead endpoint. Clear the queue first to
avoid the wasted request.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 19:42:29 +04:00
Émile Ré
f439100411 Format file
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 19:34:37 +04:00
Émile Ré
9dedeeaa42 Skip draft version for uncategorised-only merges
Pattern merges and adoptions that stay entirely within the
uncategorised category never change the visitor-facing snapshot.
Only trigger ensureDraftVersionForBanner when a merge group
belongs to a consent category.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 19:31:53 +04:00
Émile Ré
9d4af4d73e Validate cookie policy link in banner description
Translations are no longer part of the version snapshot, so the
banner_description text must be validated at write time to ensure
the {{cookie_policy_link}} placeholder is present. Without it
the cookie policy URL silently disappears from the rendered banner.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 19:09:16 +04:00
Émile Ré
33940d63ca Run cookie detection regardless of banner state
Decouple detection from the banner's active state so admins
can discover cookies before making the banner visible. The
client now starts the detector even when the config endpoint
returns 404, and the detector stops itself if the report
endpoint returns 404 (wrong or deleted banner ID).

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 19:01:13 +04:00
Émile Ré
478ccf6785 Exclude uncategorised category from consent contract
The uncategorised category is an admin-side inbox for detected
cookies and should not be part of the visitor-facing consent
contract. Filter it out of snapshots so changes to uncategorised
patterns no longer trigger version bumps.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 18:33:07 +04:00
Émile Ré
887453fee2 Exclude translations from cookie banner version snapshots
Translation changes are cosmetic, not consent-contract changes,
so they should not trigger a version bump. Translations are now
loaded live from the database at serve time instead of being
frozen in the snapshot.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 18:10:18 +04:00
Émile Ré
685ff91d74 Extract snapshot functions into snapshot.go
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 17:49:19 +04:00
Émile Ré
e21388fa0c Stop bumping cookie banner version on no-op updates
A central snapshot-equality guard in ensureDraftVersion now returns
the latest version unchanged when the candidate snapshot matches it,
so no-op admin saves no longer force visitors to re-consent. Per-
operation short-circuits in UpdateCookieBanner, UpdateCookieCategory,
UpdateCookiePattern, DeleteCookiePattern, MoveCookiePatternToCategory,
ReorderCookieCategory, and UpsertCookieBannerTranslation skip the row
update and version bump when nothing visitor-facing changes (excluded
patterns, identical values, identical translation JSON).

Rank is now treated as admin-only metadata: buildSnapshot sorts
categories by (Kind weight, ID byte order) instead of relying on the
implicit rank-driven slice order, and ReorderCookieCategory no longer
calls ensureDraftVersionForBanner. Default banners keep their
visitor-facing order (insertion order matches Kind+ID); banners with
admin-customised ranks see a one-time order shift to insertion order
on the next snapshot rebuild.

Reusable equality helpers (Ptr generic + JSON canonicalisation) move
to a new pkg/equal package; snapshotsEqual stays in service.go as the
documented chokepoint for visitor-identical snapshot comparison.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 17:42:06 +04:00
Émile Ré
71cad5f15e Allow clearing optional fields in n8n cookie updates
The previous fix prevented unintentional clearing of
`privacyPolicyUrl` and `maxAgeSeconds` by skipping the field
when its value was falsy, but this also removed the user's
ability to explicitly clear an existing value.

Move both fields into an `Additional Fields` collection so we
can distinguish between "not provided" (skip) and "provided
empty" (clear), matching the existing pattern in
`vendor/update.operation.ts`.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-02 15:35:20 +04:00
Émile Ré
1650b26fa9 Fix destructive update behavior in n8n cookie operations
Avoid clearing existing values when optional fields are left at their
defaults: only send privacyPolicyUrl/maxAgeSeconds when truthy, filter
empty entries from gcmConsentTypes, and constrain consentExpiryDays to
positive integers on create.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 20:11:37 +04:00
Émile Ré
1996545125 Add excluded field to cookie pattern operations
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 17:59:11 +04:00
Émile Ré
6f849b36a1 Add cookie banner operations to n8n node
Adds four new resources (cookieBanner, cookieCategory,
cookiePattern, cookieConsentRecord) covering all mutations
and queries from the cookie banner GraphQL resolvers.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 17:56:23 +04:00
Émile Ré
1d08760d3b Display cookie pattern source badge in category table
Show the origin of each cookie pattern (Script vs Pre-existing)
as a badge with a tooltip in the cookies configuration table.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 17:41:50 +04:00
Émile Ré
bb7bc7c716 Add e2e tests for cookie pattern excluded field
Test that excluded defaults to false on create, can be set
to true via update, and can be toggled back to false.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 16:49:46 +04:00
Émile Ré
dd1d0ebffb Sync excluded field to MCP and CLI
Add excluded boolean to the MCP CookiePattern schema and
UpdateCookiePatternInput. Expose it in CLI cookie-pattern
view, list, and update commands.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 16:48:55 +04:00
Émile Ré
3ed61c6084 Add excluded field to cookie pattern GraphQL schema
Expose excluded on the CookiePattern type and accept it as
an optional input on UpdateCookiePatternInput so the console
can toggle pattern exclusion inline.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 16:39:33 +04:00
Émile Ré
bfc0ded464 Exclude excluded patterns from merge and adoption
Filter excluded and non-exact patterns in SQL when loading
patterns for the pattern analysis worker. Both merge group
building and uncategorised adoption only see non-excluded
exact patterns, so excluded patterns are preserved as
punch-out overrides.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 16:39:33 +04:00
Émile Ré
dc3c2701ac Skip excluded patterns in detection and snapshots
In ReportDetectedCookies, silently skip cookies that match an
excluded pattern instead of recording them. Filter excluded
patterns in SQL when building version snapshots so they never
appear in the published banner config. Add Excluded field to
UpdateCookiePatternRequest.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 16:39:33 +04:00
Émile Ré
2192c854a0 Add excluded flag to cookie pattern model
Adds an `excluded` boolean column to the cookie_patterns table
so operators can mark patterns to be omitted from the consent
banner without deleting them. Includes the migration, struct
field, updated SQL queries, and filter support.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 16:39:32 +04:00
Émile Ré
8e5c586c95 Release v0.178.0 2026-05-01 16:34:57 +04:00
Émile Ré
e7c2118b7b Run gofmt on cookie-banner CLI commands
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 16:07:22 +04:00
Émile Ré
6d22d68acf Fix maxAgeSeconds type handling in cookie pattern factory
The inline int type assertion silently dropped int64 and float64
values already supported by Attrs.getInt.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 15:59:56 +04:00
Émile Ré
d133d5ba1d Fix PR review comments and rename versions to latest-version
- Validate __typename in all list command pagination callbacks
- Serialize PostHogConsent=false as explicit false (not nil)
- Fix maxAgeSeconds factory to only include when value is an int
- Rename cookie-banner versions to latest-version subcommand

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 15:38:43 +04:00
Émile Ré
08aaab1393 Add CLI commands for cookie banner, category, pattern, and consent records
Expose prb cookie-banner (10 subcommands), prb cookie-category (6),
prb cookie-pattern (6), and prb consent-record (2) with full CRUD,
lifecycle operations, pagination, and interactive prompts.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 15:19:21 +04:00
Émile Ré
7bc8343c18 Add MCP tools for cookie banner, category, pattern, version, and consent
Wire cookiebanner.Service into the MCP resolver and expose 24 tools
covering full CRUD, activation, versioning, translations, and consent
record queries with pagination and filtering support.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 15:19:21 +04:00
Émile Ré
c43f61d109 Fix e2e test assertions: uppercase state enums, non-default slug
The version state field returns uppercase enum values (DRAFT, PUBLISHED)
and "analytics" is a default category slug created with every banner.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 15:19:21 +04:00
Émile Ré
6532f16efc Add e2e tests for cookie banner console GraphQL API
Cover CRUD, activation, versioning, translations, categories, patterns,
RBAC, and tenant isolation with factory helpers for test data creation.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-05-01 15:19:21 +04:00
Cursor Agent
8c74a7bc93 Fix auditor processing activity access
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Émile Ré <nemile.re@gmail.com>
2026-05-01 15:18:23 +04:00
Cursor Agent
17b75f2017 Fix contract end date calendar cut off in dialog
The Add Person dialog wrapped its form content in a plain <div>
instead of DialogContent. When the form is tall enough, the
dialog extends beyond the viewport with no way to scroll,
cutting off the contract end date field.

Replace the raw <div> with DialogContent which provides
overflow-y-auto and a maxHeight constraint, matching the
pattern used by all other dialogs in the codebase.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Émile Ré <nemile.re@gmail.com>
2026-05-01 10:50:55 +00:00
Émile Ré
7648edd770 Release v0.177.1 2026-04-30 17:31:04 +04:00
Bryan Frimin
febf4a930e Treat OIDC and magic link sessions as password-equivalent when assuming an org
Users authenticated via Google/Microsoft OIDC or magic link previously
relied on a fall-through in the password-only org check. Make the rule
explicit so SSO-only users can access password-only organizations
without being bounced to the password login form they cannot satisfy.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-30 17:24:04 +04:00
Émile Ré
5f087b47b8 Reveal cookie banner in sidebar
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-30 17:21:37 +04:00
Émile Ré
54494fc9b1 Bump version to 0.1.1
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-30 17:11:39 +04:00
Émile Ré
42a6a2f8bd Show placeholders when no prior consent exists
The activate() method was only called when consent existed (from
cookie or API). When there was no prior consent, observeAndActivate()
never ran, so visual elements with data-cookie-consent were left
without placeholders. Build default consent data from the config's
consent_mode and always call activate() at the end of load().

Also consolidate activateElements/addPlaceholders into
observeAndActivate to avoid duplicate DOM traversals.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-30 17:10:35 +04:00
Émile Ré
15ff6131e1 Fix placeholder sizing for cookie-consent elements
Expand the dimensional property allowlist with padding, box-sizing,
and positioning properties (position, top, right, bottom, left,
inset) so placeholders match the size of absolutely or sticky
positioned elements. Fall back to getComputedStyle for height when
no explicit value is found from inline styles or HTML attributes.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-30 16:59:13 +04:00
Émile Ré
bd6abccb2d Upgrade esbuild to remove vulnerability
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-30 15:52:43 +04:00
Émile Ré
f0e6538943 Release v0.177.0
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-30 15:24:17 +04:00