Commit Graph

3738 Commits

Author SHA1 Message Date
Émile Ré
c8e3d139e1 Remove proboctl internal admin CLI
The set-branding functionality it provided is no longer needed.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 15:22:03 +04:00
Émile Ré
d71915abd4 Fix PR review comments on cookie banner branding
- Add scope parameter to UpdateShowBranding to prevent cross-tenant updates
- Use cmd.Context() instead of context.Background() in proboctl CLI
- Drop SQL column default after backfill in migration
- Add bounds check for int-to-int32 conversion in PG_POOL_SIZE
- Update branding link to getprobo.com homepage

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 15:22:03 +04:00
Émile Ré
b1607d76c5 Expose showBranding as read-only GraphQL field and reflect it in theme preview
Uses the Loader + Page + Fragment pattern so the snippet page fetches
its own data instead of relying on Outlet context.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 15:22:02 +04:00
Émile Ré
df698b5b21 Change branding copy from "Powered by" to "Privacy by"
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 15:22:02 +04:00
Émile Ré
55bb2a7953 Add proboctl internal admin CLI with cookie-banner set-branding command
New staff-only CLI that connects directly to PostgreSQL (via PG_*
env vars) to manage parameters not exposed through the public API.
First command: proboctl cookie-banner set-branding <id> <true|false>

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 15:22:02 +04:00
Émile Ré
2911d98276 Add branding to cookie banner theme preview
Also fix branding spacing with proper padding-top.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 15:22:02 +04:00
Émile Ré
7102c17b19 Add "Powered by Probo" branding to cookie banner SDK
Renders a subtle branded link at the bottom of both the banner
and preference panel, conditionally hidden via show_branding
config flag. Extracts all icon and HTML template constants into
a shared html.ts module.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 15:22:02 +04:00
Émile Ré
3994ab1d8b Add show_branding column to cookie banners
Internal-only flag (defaults to true) that controls whether
"Powered by Probo" branding appears on the cookie banner.
Read directly from the live row (not the version snapshot)
since branding is cosmetic, not consent-relevant.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 15:22:01 +04:00
Sacha Al Himdani
135bdf298e Skip Docker Hub login when token is unavailable
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-22 12:04:48 +02:00
Aurélien Sibiril
a6379bb9f4 Always send Bearer auth for OAuth2 connectors
Provider token_type values are not reliably valid HTTP auth schemes
(Slack returns "bot" / "user", some providers send an empty string),
which produces a malformed Authorization header on subsequent
requests. Every OAuth2 connector in this codebase actually uses a
bearer token, so we always send "Bearer".

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-22 11:15:48 +02:00
Aurélien Sibiril
f464bac29d Preserve reviewer decisions on access-entry upsert
Subsequent fetches of the same source re-upsert every access entry.
Without a guard, a reviewer's (or an agent's) decision, its note, and
the flags that drove it would be silently replaced on every poll.

The ON CONFLICT DO UPDATE SET clause now refreshes only the columns
that track live source state (email, full_name, role, is_admin, MFA,
etc.) and deliberately omits the verdict bundle -- flags, flag_reasons,
decision, decision_note, decided_by, decided_at -- so the audit trail
stays consistent with whatever the reviewer or agent last recorded.

Tighten the signature from pg.Querier to pg.Tx to match the rest of
the coredata package -- every caller already runs inside WithTx.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-22 11:15:48 +02:00
Aurélien Sibiril
da80ce3eb1 Include all accounts in access-review fetch
Drivers whose source API surfaces an account-status signal return every
account (including inactive / suspended / deleted) and populate Active
accordingly; drivers without such a signal no longer fabricate it.

The fetch pipeline records every account with decision PENDING and no
flags. Producing flags or a non-PENDING decision is reserved to human
reviewers or a purpose-built agent run against the campaign -- the engine
must not form an implicit verdict.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-22 11:15:48 +02:00
Émile Ré
9510d91c61 Align theme preview with real themed banner styles
Fix button layout in ThemePreview to match the actual themed-banner:
wrap buttons in spans to mimic custom element wrappers (preventing
flex: 1 from stretching them), use correct padding/background/max-width,
and set explicit line-height: normal. Also clean up dead flex properties
in themed-banner styles.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:51 +04:00
Émile Ré
ae68196d76 Shrink cookie-banner README and link to docs site
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:51 +04:00
Émile Ré
4a88cc5902 Rework cookie-banner exports: themed banner as default, headless as subpath
Make the themed banner the default "." export and move the headless
components to "./headless". Remove unused VERSION export.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:50 +04:00
Émile Ré
0cb48a4f33 Add accept/reject all buttons to preference panel
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:50 +04:00
Émile Ré
c942aaa7bb Make consent API calls fire-and-forget to avoid blocking UI
The server-side consent record is for audit purposes and does not need
to complete before the UI responds. Local state (cookie, script
activation) is applied synchronously, and the API call runs in the
background with queue fallback on failure.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:50 +04:00
Émile Ré
140e614e4f Fix placeholder style copying and root domain calculation
Only copy dimensional style properties (width, height, margin, etc.)
to placeholders instead of blindly copying all cssText, which could
override layout properties like display: flex.

Handle multi-part TLDs (e.g. .co.uk, .com.au) when computing the root
domain for cookie deletion.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:50 +04:00
Émile Ré
2b59a10c14 Add ARIA attributes and focus management to cookie banner
Improve accessibility across the cookie banner components: add
aria-modal/aria-labelledby/aria-describedby on dialog cards, aria-label
on icon-only buttons and category toggles, aria-expanded on cookie
detail disclosure, aria-hidden on decorative SVGs, and auto-focus into
dialogs when they become visible.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:50 +04:00
Émile Ré
9a92ebd51a Add placeholder overlays for blocked cookie-consent elements
When visual elements (iframe, img, video, etc.) are blocked due to
missing cookie consent, display a styled placeholder that explains
which cookie category must be accepted and offers a link to open
the preference panel.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:50 +04:00
Émile Ré
1fb0464948 Add element deactivation with cookie removal on consent withdrawal
When a user changes their consent preferences, elements for rejected
categories are now deactivated: data attributes are restored, resources
are unloaded, and associated cookies are removed.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:49 +04:00
Émile Ré
fbdff595fe Fix CORS and CSRF for cookie banner POST /consents endpoint
The cookie banner's cross-origin POST was blocked by two layered issues:

1. The global cors.Handler (with OptionsPassthrough: false) intercepted
   OPTIONS preflights before the cookie banner's own CORS middleware
   could run. Customer website origins aren't in AllowedOrigins, so the
   preflight response had no CORS headers. Move the cookie banner mount
   outside the global CORS group since it handles CORS per-banner.

2. The CSRF bypass patterns used literal "*" instead of ServeMux wildcard
   syntax "{rest...}", so they never matched real request paths like
   POST /cookie-banner/v1/{bannerID}/consents. Also remove redundant
   GET/OPTIONS bypass patterns since safe methods are always allowed.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:49 +04:00
Émile Ré
0e3c79b0e8 Forward data-reopen-widget from script tag in IIFE entry point
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:49 +04:00
Émile Ré
68fffbf2f3 Add reopen-widget attribute and probo-settings-link element
Allow customers to replace the built-in floating settings button with
their own re-open trigger (e.g. a footer link) by either placing a
<probo-settings-link> element anywhere on the page or manually setting
reopen-widget="custom" on the root. The settings-link auto-hides the
floating button on connect via a reopen-widget attribute change event.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:49 +04:00
Émile Ré
6391d276d9 Clean up settings button CSS custom properties
Remove undocumented --probo-settings-bottom variable and use the
shared --probo-z-index variable instead of --probo-settings-z-index.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:48 +04:00
Émile Ré
55d81e21eb Fix preference panel close returning to banner when consent exists
When a visitor with existing consent opened the preference panel via
the floating settings button and closed it, the state was always set
to "banner" instead of "hidden". Now check hasConsent so closing the
panel returns to the floating button when preferences are already saved.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:48 +04:00
Émile Ré
9ec6922fde Hide empty categories in cookie banner preference panel
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:48 +04:00
Émile Ré
fab95413df Improve UI of themed banner
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-22 11:34:48 +04:00
Sacha Al Himdani
b603d04d8d Assets as document: replace snapshot with publish workflow
Remove assets from the snapshot system and replace with a publish-based
document workflow that generates versioned ProseMirror documents.

- Remove snapshot_id/source_id from asset and asset_vendor models
- Delete AssetFilter (no longer needed without snapshot filtering)
- Add PublishAssetList service, GraphQL mutation, MCP tool, CLI command,
  and n8n operation
- Add asset_list_document_id column to generated_documents table
- Generate ProseMirror documents with asset inventory tables
  (name, type, amount, data types stored, owner, vendors)
- Add AssetListDocument resolver on Organization type
- Update frontend to remove snapshot routes/params and add publish dialog
- Add e2e tests for asset publish (immediate, with approvers, reuse, RBAC)
- Add migration script for converting legacy asset snapshots to documents
- Exclude ASSETS from snapshot type lists and e2e snapshot tests
- Move generated_documents SQL to coredata methods on Datum and Asset
- Clear generated document and SOA references on soft delete and archive

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-21 19:36:17 +02:00
Sacha Al Himdani
565b71526c Pass ACME root CA to dev config generation
The dev-config Make target was missing the ACME_ROOT_CA env var,
causing probod to fail with an untrusted certificate error when
connecting to the local Pebble ACME server.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-21 19:28:56 +02:00
Bryan Frimin
fbc10a8591 Move dev env file to repo root
Use the conventional .env / .env.example location at the repo
root instead of cfg/dev.env / cfg/dev.env.example. .env is what
contributors expect, keeps cfg/ a pure generated-config directory,
and shares the same file if we ever add another dev target that
needs the same overrides.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-21 18:51:34 +02:00
Bryan Frimin
b87611d99a Tighten dev-config ergonomics
Apply the review feedback on the dev-config target:

- Treat cfg/dev.env as a prerequisite via $(wildcard ...) so edits
  to it re-trigger cfg/dev.yaml without the dev having to delete
  the output first; update the help string accordingly.
- Drop the @ silence prefix on the recipe body so failures are
  debuggable; the values are all known dev placeholders, no leak.
- Call out in cfg/dev.env.example that the file is sourced as a
  POSIX shell snippet (not Docker-compose .env semantics), and
  list the previously-missing overrides: observability addrs,
  PG_DEBUG, SMTP auth/TLS, AUTH_COOKIE_DURATION, and the
  per-worker LLM knobs (probo-agent, evidence-describer).

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-21 18:28:36 +02:00
Bryan Frimin
ab0e59ad71 Generate cfg/dev.yaml via a Make target
Committing a fully-materialised cfg/dev.yaml hid the dev
configuration surface and blocked the OAuth2 signing-key inlining
change: the new config requires a per-dev private key that must
not be committed. Replace the checked-in file with a dev-config
Make target that shells out to probod-bootstrap with dev-safe
defaults and a stable RSA signing key stashed under
cfg/.dev-oauth2-signing-key.pem on first run.

The recipe sources cfg/dev.env when present so devs can override
any setting without editing the Makefile; cfg/dev.env.example
ships the full list of overridable knobs. cfg/dev.yaml,
cfg/dev.env, and the signing key are all gitignored.

Update README, CONTRIBUTING, and contrib/claude/config.md to
describe the new workflow.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-21 18:20:07 +02:00
Bryan Frimin
c4e81ed092 Inline OAuth2 signing key in config
The OAuth2/OIDC server accepted its signing key via a file path
(key-file), while every other PEM key in the probod config (SAML
private key, ACME account key) is embedded inline. Switch the
field to a private-key string so the convention is uniform.

The signing key is operator-supplied material that must outlive
any process restart, so the bootstrap builder now treats
OAUTH2_SERVER_SIGNING_KEY as required and refuses to start
without one; silently minting a fresh key per boot would break
token validation across rollouts. The OAUTH2_SERVER_* env vars
otherwise flow through builder.Build like the existing SAML
block so the new OAuth2Server section is populated end-to-end.

Rework the e2e harness to render its config via bootstrap at
test setup, which removes the static
e2e/console/testdata/config.yaml and the previously generated
test-only PEM file. A per-run RSA key is minted via
bootstrap.GenerateOAuth2SigningKey (kept public for test
tooling) and injected through the builder env map. CI now
passes ACME_ROOT_CA inline instead of mutating a YAML on disk.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-21 17:56:00 +02:00
Sacha Al Himdani
a622c610d7 Fix SCIM bridge PUT loop and pagination
Two bugs caused SCIM sync failures:

1. buildUserPayload conditionally omitted empty fields. When a field was
   cleared in the identity provider, the PUT payload didn't include it,
   so the SCIM handler never cleared the stored value. The bridge kept
   detecting a mismatch every sync cycle, causing a perpetual PUT loop.
   Fix: always include all fields unconditionally.

2. ListUsers ignored the startIndex parameter — the cursor always started
   from nil, so every page returned the same first N users. Organizations
   with more than 100 SCIM-managed users never got a full listing; users
   beyond the first page appeared missing, causing CreateUser calls that
   failed with 409 (uniqueness conflict) and eventually disabled the
   bridge. Fix: replace cursor-based pagination with OFFSET/LIMIT to
   honor SCIM's 1-based startIndex.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-21 16:54:20 +02:00
Émile Ré
82748f870f Fix missing RowsAffected checks in cookie update methods
Address PR review comments: capture Exec result and check
RowsAffected() == 0 to return ErrResourceNotFound in
Cookie.Update, CookieCategory.Update, and CookieCategory.UpdateRank.
Also update coredata and relay contributor docs accordingly.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 15:24:54 +04:00
Émile Ré
8dfed9fff2 Fix move-cookie connection lookup with filters: []
ConnectionHandler.getConnection could not find the cookies
connection because orderBy was implicitly treated as a filter.
Add filters: [] to the @connection directive and document the
filters rule in contrib/claude/relay.md.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 14:18:33 +04:00
Émile Ré
8e420da5bc Fix cookie mutations to update Relay store
The create, delete, and move cookie mutations were not updating
the Relay store connections, so the UI only reflected changes
after a page reload. Add @connection and @appendEdge/@deleteEdge
directives, and a store updater for the move mutation.

Also document mutation store update rules in contrib/claude/relay.md.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 14:18:33 +04:00
Émile Ré
29c0d55e75 Create a db table for cookies for easiest management
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 14:18:32 +04:00
Bryan Frimin
f743c743c1 Only guard owner demotion for active profiles
Move profile load before the owner-demotion guard and add
an active-state check, matching the RemoveUser pattern.
Without this, demoting an inactive owner would be
incorrectly blocked.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-21 11:28:43 +02:00
Bryan Frimin
dd8c3b5491 Prevent last owner from demoting themselves
The UpdateMembership path allowed the sole owner of an
organization to change their role to a non-owner role,
causing permanent lockout. Add the same active-owner count
guard already used in RemoveUser.

Closes #1071

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-21 11:28:42 +02:00
Sacha Al Himdani
8ce429507b Bump langsmith to 0.5.20 and override @langchain/classic to fix CVE
langsmith <=0.5.18 leaks streamed LLM output past redaction controls
(GHSA-rr7j-v2q5-chgv). The transitive pin via @n8n/ai-utilities held
@langchain/classic at 1.0.5 which required langsmith ^0.3.64, blocking
the upgrade. Add npm overrides for @langchain/classic (^1.0.27) and
langsmith (^0.5.19) to resolve all three langsmith advisories.

The lockfile refresh bumps eslint-plugin-react-hooks from 7.0.1 to
7.1.0 which enables the react-hooks/refs and set-state-in-effect
rules. Fix the resulting lint errors:

- PDFPreview (console + trust): read currentPage through a ref synced
  via useEffect, keeping the setState updater pure and ref access
  outside of render
- MeasuresPage: remove redundant categoryFilter state that mirrored
  urlCategory, use a ref to detect URL changes and trigger refetch
  as the single source of category refetches
- WebhooksSettingsPage: defer loadEvents via requestAnimationFrame
  to avoid synchronous setState within the effect body

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-21 11:16:53 +02:00
Sacha Al Himdani
e1148f812e Replace implemented column with CMMI maturity level
Drop the boolean implemented/not-implemented state in favor of a
mandatory CMMI maturity level enum (NONE, INITIAL, MANAGED, DEFINED,
QUANTITATIVELY_MANAGED, OPTIMIZING) stored as a Postgres enum type.

The migration backfills existing rows (NOT_IMPLEMENTED → NONE,
IMPLEMENTED → INITIAL), makes the column NOT NULL, and drops the old
implemented column and its enum type.

- maturityLevel is required on CreateControlInput and non-nullable (!)
  in the GraphQL schema
- CLI displays human-readable CMMI labels instead of raw enum tokens
- SOA table and published document use a single Maturity column in
  place of the old Implemented + Maturity columns
- Remove ControlImplementationState type and all implemented references
  across backend, frontend, CLI, MCP, n8n, and E2E tests

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-21 11:06:36 +02:00
Alejandro Juan
da91afc2a7 Add CMMI maturity level to compliance controls
Adds an optional CMMI 0-5 maturity level field to Control to support
ISO 27001 clause 9.1 effectiveness measurement and HITRUST CSF maturity
requirements. The field is nullable, framework-agnostic, and exposed
across all four API surfaces (GraphQL, MCP, CLI, n8n) plus the
generated SoA document.

Signed-off-by: Alejandro Juan <alejandrojuan@alejandrojuan.com>
2026-04-21 11:06:36 +02:00
Émile Ré
98487953b9 Fix review
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 11:40:23 +04:00
Émile Ré
937a0079fc Fix some lint error + change error handling
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 11:40:23 +04:00
Émile Ré
d3333fd137 Remove unused destructured variable and document the convention
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 11:40:22 +04:00
Émile Ré
b29f51c303 Extract inline forms from CategorySection into separate components
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 11:40:22 +04:00
Émile Ré
653b43fc81 Add moveCookieToCategory mutation
Moving a cookie between categories previously required two sequential
updateCookieCategory mutations, which was not atomic and could leave
data in an inconsistent state if the second call failed. This adds a
dedicated moveCookieToCategory mutation that performs both updates in
a single transaction.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 11:40:22 +04:00
Émile Ré
1574600c72 Use fragment and add confirm
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-21 11:40:22 +04:00