Commit Graph

1720 Commits

Author SHA1 Message Date
Sacha Al Himdani
03d77c3bab Fix duplicate organization name returning internal error
When creating an organization with a name that produces a duplicate trust
center slug, the API now returns a Conflict response instead of a
generic Internal error.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-27 20:26:13 +01:00
Sacha Al Himdani
999171a626 Add document approval workflow
Introduce a complete approval system for document publishing. Document
versions can now require approval from selected reviewers before being
published, with automatic publishing once all approvers have approved.

- Add approval quorum and decision tables with backfill migration
- Implement request approval, approve, and reject flows with electronic
  signature support for approve decisions
- Add employee approvals page with dedicated tab and pending approvals view
- Add changelog field to publish and request approval flows
- Pre-select previous version's approvers in the publish dialog
- Show quorum approvers in document list with 100 approver hard limit
- Expose approval workflow through GraphQL, MCP, and CLI
- Remove legacy default approvers feature entirely
- Add comprehensive e2e test coverage for approval workflows

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-27 19:43:20 +01:00
Sacha Al Himdani
257cbcf826 Add task priority field
Introduce a rank-style priority on tasks, scoped by
(organization_id, state). New tasks auto-assign the next
priority. Reordering uses the same CTE-based algorithm as
trust center references and compliance external URLs.
Exposed through GraphQL, MCP, and the PRIORITY order field.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-27 15:47:12 +01:00
Bryan Frimin
8f59eb6b8a Distinguish expired magic links from invalid tokens
When a magic link token expires, the user now sees a specific
error message ("This magic link has expired. Please request a
new one.") instead of the generic "Failed to connect" error.

This adds ErrExpiredToken to the IAM error types, checks for
statelesstoken.ErrExpiredToken in both GetMagicLinkEmail and
OpenSessionWithMagicLink, and handles it in the trust resolver
and frontend.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-27 09:15:41 +01:00
Bryan Frimin
095b36d6e4 Mark failed evidence descriptions instead of retrying
Previously the worker reset failed descriptions back to PENDING,
causing infinite retry loops for permanently broken evidence.
Add a FAILED status so these items stop cycling and can be
investigated.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-26 21:37:53 +01:00
Bryan Frimin
84b71af54c Use file model MIME type instead of S3 content type
GetFileBase64 read the MIME type from the S3 response header,
which can be application/octet-stream for files uploaded without
an explicit content type. Use file.GetMimeType() from the
database instead, which stores the correct MIME type captured
at upload time. This fixes evidence description failures when
calling the OpenAI API with PDF files.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-26 17:34:04 +01:00
Bryan Frimin
619ec7b882 Add AI-powered evidence description generation
Introduce a background worker that automatically generates
compliance-focused descriptions for uploaded evidence files
using configurable LLM providers. Descriptions are surfaced
across all interfaces: GraphQL API, MCP API, CLI, and the
console UI.

Key changes:
- Multi-provider LLM config with per-agent settings (pointer
  types for Temperature/MaxTokens to preserve zero values)
- Evidence description worker with bounded concurrency
- EvidenceDescriptionStatus typed enum with PostgreSQL enum type
- New `prb evidence` CLI commands (list, view, delete)
- Evidence description displayed in console table and preview
- Migration only marks evidences without files as completed

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-26 14:32:41 +01:00
Bryan Frimin
d1e4f31d07 Fix empty search_engine_indexing on trust centers
Trust centers were created without setting SearchEngineIndexing,
defaulting to an empty string in the database. This caused scan
errors when loading trust centers.

Add a migration to fix corrupted rows, set a DEFAULT on the
column, and add a CHECK constraint. Also set the field explicitly
when creating new trust centers.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-26 10:13:00 +01: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
Bryan Frimin
e74c0a11c6 Update copyright headers to 2025-2026 for modified files
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 15:19:47 +01:00
Bryan Frimin
7625096d00 Fix copyright year to 2026 for new dataloader file
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 15:19:47 +01:00
Bryan Frimin
812de537f9 Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 15:19:47 +01:00
Bryan Frimin
d24712344e Add GraphQL dataloaders for batched record lookups
Introduce dataloadgen-based dataloaders to batch individual
record-by-ID fetches in GraphQL resolvers into single SQL
queries. Each entity type (organization, framework, control,
vendor, document, risk, measure, task, file, report, profile)
gets a LoadByIDs method in coredata and a GetByIDs service
method with variadic arguments and dedicated collection return
types. Resolvers now use dataloader.FromContext instead of
direct service calls for single-record lookups.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 15:19:46 +01:00
Bryan Frimin
2004bf6050 Fix CAA issuer matching to handle parameters
CAA issue records may contain parameters after a semicolon per
RFC 8659 (e.g. "letsencrypt.org; accounturi=..."). Split on ";"
and compare only the issuer domain so these records are accepted.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 12:23:32 +01:00
Bryan Frimin
9b66d05c3c Check CAA records before ACME certificate issuance
Before requesting a certificate from the ACME provider, verify
that CAA DNS records for the domain permit issuance by the
configured CA. This avoids wasting ACME attempts on domains
whose CAA policy would reject the request.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 12:23:30 +01:00
Bryan Frimin
63965261db Fix Microsoft OIDC token exchange auth style
Without an explicit AuthStyle, the oauth2 library uses
auto-detection which tries Basic auth first. Microsoft
rejects this, and since PKCE codes are single-use, the
retry with the correct style fails.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 09:43:33 +01:00
Bryan Frimin
728804b559 Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 09:40:44 +01:00
Bryan Frimin
dcf81c4575 Fix SCIM bridge updating all users on every sync
The SCIM client User struct had json:"-" tags on most fields
(GivenName, FamilyName, ExternalID, Department, etc.), so
ListUsers never populated them from the JSON response. The
bridge comparison always saw empty strings on the SCIM side
vs actual values from the provider, making needsUpdate true
for every user on every sync cycle.

Add custom UnmarshalJSON on User to properly parse nested
SCIM JSON (name object, enterprise extension) into the flat
struct, so the existing diff logic correctly skips unchanged
users.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 09:40:44 +01:00
Bryan Frimin
f0d43fd8e5 Fix ACME challenge retry to create fresh orders
When CompleteHTTPChallenge fails, the challenge is already marked
invalid by Let's Encrypt. Retrying Accept on the same challenge
always fails with "authorization must be pending". Reset the
domain to pending with cleared challenge data so each retry
creates a new ACME order.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-25 09:30:40 +01:00
Bryan Frimin
784c88895a Allow editing non-SCIM fields on SCIM-managed profiles
Contract start and end dates are never synced by SCIM, so they
should remain editable even when a profile is SCIM-managed.
The backend now skips overwriting SCIM-synced fields (fullName,
kind, position, additionalEmailAddresses) for SCIM profiles,
and the frontend disables only those fields instead of the
entire form.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-24 16:44:53 +01:00
Bryan Frimin
359f85f5da Add SEO controls and sitemap for compliance pages
Add search engine indexing toggle, robots.txt, and sitemap.xml
generation for compliance pages. Replace checkboxes with toggle
components in the compliance page UI and add an "Open" button
in the page header to quickly access the live compliance page.
The search engine indexing toggle is disabled when the compliance
page is inactive.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-24 15:55:31 +01:00
Bryan Frimin
f8e086a00b Address PR review feedback for OIDC sign-in pages
- Remove inline password form from SignInPage (use PasswordSignInPage)
- Extract Divider and OIDCButtons to _components folder
- Move OIDC providers into page queries instead of lazy-loaded queries
- Create useSafeContinueUrl hook for trust app using getPathPrefix
- Use safeContinueUrl.toString() for continue URL parameter
- Fix wg.Go style in IAM service Run method

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-23 14:17:44 +01:00
Bryan Frimin
1d3cc1c65e Use single OIDC session auth method instead of per-provider values
The OIDC provider is already tracked in iam_oidc_states.provider, so
there is no need for provider-specific session auth methods (GOOGLE,
MICROSOFT). Replace them with a single OIDC auth method.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-23 14:17:44 +01:00
Bryan Frimin
7e757bfa06 Sort OIDC providers for deterministic API response order
EnabledProviders() iterated a map, producing nondeterministic order.
Sort the slice before returning to ensure stable UI and test behavior.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-23 14:17:44 +01:00
Bryan Frimin
3e4a7d3638 Add OIDC login support to compliance page
Add Google and Microsoft sign-in buttons to the trust center connect
page, matching the console sign-in experience. The backend OIDC flow
already supports flexible continue URLs, so only the GraphQL schema
and frontend needed changes.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-23 14:17:44 +01:00
Bryan Frimin
95803e4bca Fix wg.Go call style in OIDC service Run method
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-23 14:17:44 +01:00
Bryan Frimin
29b41208f3 Address PR review feedback for OIDC login
- Remove sensitive nonce values from error messages to prevent logging leaks
- Guard ticker intervals against non-positive durations in SAML domain
  verifier and garbage collector to prevent panics
- Require both client ID and client secret for Google/Microsoft OIDC
  providers to be marked as enabled
- Replace http.DefaultClient with kit/httpclient for JWKS fetching to
  ensure proper timeouts
- Fix eslint indentation in SignInPage OIDC button click handler

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-23 14:17:43 +01:00
Bryan Frimin
83468db034 Refactor sign-in page and IAM service lifecycle
Redesign the sign-in page to show email/password form inline
with OIDC provider buttons (with vendor icons) instead of
separate pages. Extract OIDCProvider type to its own file.

Replace errgroup with sync.WaitGroup + WithCancelCause for
graceful shutdown in IAM services. Refactor garbage collectors
to use functional options and time.Ticker instead of
time.After to avoid repeated allocations.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-23 14:17:43 +01:00
Bryan Frimin
23084a72a2 Add OIDC login support for Google and Microsoft providers
Implements OpenID Connect authentication flow with PKCE, JWT verification, and enterprise-only account restrictions. Adds OIDC service with JWKS caching and state management, HTTP handlers for login/callback flows, GraphQL query for available providers, and sign-in UI integration.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-23 14:17:43 +01:00
Bryan Frimin
2f8edfb6be Add per-email sender name for compliance page emails
When an email has a sender name set (the organization name), the
mailer composes the From header as "OrgName via Probo" instead of
the default global sender name. This gives compliance page
recipients clearer context about which organization is contacting
them.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-22 10:56:51 +01:00
Bryan Frimin
3bb27fe8f1 Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-21 19:16:21 +01:00
Bryan Frimin
7b320916af Add audit log feature for recording all actions
Adds audit logging that records all authorized actions performed by
users and API keys. The audit log is automatically populated whenever
the authorizer approves an action, and is queryable via GraphQL, MCP,
and CLI interfaces. Permission checks are excluded via a dry-run flag
to avoid phantom entries on page loads.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-21 19:16:19 +01:00
Bryan Frimin
190baeebed Use actual MIME type for trust center file exports
The export endpoint was hardcoding application/pdf for all trust center
files. Now the real MIME type from the stored file metadata is threaded
through the service layer and returned as a data URI, so non-PDF files
are handled correctly on the frontend. Watermarking is only applied when
the file is actually a PDF.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-20 18:01:00 +01:00
Bryan Frimin
c2e13b7968 Add MCP audit report metadata and getAuditReportUrl tool
Adds has_report, report_filename, and report_mime_type fields to Audit type to expose report attachment status. Introduces new getAuditReportUrl tool to generate presigned download URLs for audit reports. Updates NewAudit type converter to accept optional report object for enriching metadata.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-20 15:58:27 +01:00
Bryan Frimin
ae6e5c8ff1 Fix compliance page to include private documents and audits
Private items should still be listed on the compliance page — only
items with visibility "NONE" should be excluded. Also add missing
trailing newline in the template file.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-20 10:14:03 +01:00
Bryan Frimin
63cf69fcef Propagate errors from compliance page fetch helpers
The fetch helpers silently swallowed pagination/list errors by breaking
out of the loop, which could return a successful response with
incomplete compliance data. Return errors instead.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-20 10:14:03 +01:00
Bryan Frimin
1879a1f77c Escape Markdown table cell values in compliance page template
Pipe characters and newlines in dynamic values break Markdown table
structure. Add a cell template function that escapes these characters.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-20 10:14:02 +01:00
Bryan Frimin
f11eae6b82 Add /llms.txt endpoint to trust center compliance page
Renders compliance data (frameworks, documents, audits, subprocessors, references, and external links) as a plain-text Markdown document. The endpoint supports all required visibility filters and pagination.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-20 10:14:01 +01:00
Bryan Frimin
c5589793da Allow skipping confirmation email when adding mailing list subscribers
When creating a new subscriber, operators can now check "Skip confirmation email" if they already have the recipient's consent. This creates the subscriber in confirmed status and skips sending the notification email.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-20 09:54:25 +01:00
Bryan Frimin
bedfd61168 Rename Vendor to Subprocessor in trust API surface
Rename Vendor → Subprocessor, VendorConnection → SubprocessorConnection, and VendorEdge → SubprocessorEdge across the GraphQL schema, Go resolvers, and React frontend components. Internal coredata types remain unchanged. User-facing labels in console app updated to reflect terminology change.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-20 09:52:37 +01:00
Bryan Frimin
a7319e54a1 Paginate measures 500 by 500 instead of 100 by 100
Increase MaxCursorSize from 100 to 500 to allow larger page sizes, and set the measures list frontend query to fetch 500 items per page by default.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 23:55:50 +01:00
Bryan Frimin
8fbc8a90e0 Simplify UpdateContext to always persist
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 19:02:52 +01:00
Bryan Frimin
e90986f0af Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 19:02:51 +01:00
Bryan Frimin
a9ebeef0fa Transform meetings page into context page with tabs
Add structured organization context with 5 markdown sections (Product, Architecture, Team, Processes, Customers) editable inline. Meetings are now a tab within the context page. Moved all GraphQL queries from hooks/graph/MeetingGraph.ts into colocated components following new best practices. Updated database schema, backend services, GraphQL resolvers, and MCP API to support the new context fields and structure.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 19:02:50 +01:00
Sacha Al Himdani
8ed6f1824f Fix unvalidated URL redirection in HTTP redirects
Use baseurl.Parse to construct the HTTPS redirect URL in the
trust center HTTP handler, breaking the taint chain from raw
request headers. Apply path.Clean to the slug-based redirect
in stripTrustPrefix to normalize path traversal sequences.

Addresses CodeQL go/unvalidated-url-redirection (CWE-601).

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-19 17:27:51 +01:00
Sacha Al Himdani
8b66a61990 Run go fix and go fmt
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-19 16:37:51 +01:00
Bryan Frimin
40df76d8b4 Fix SAML ACS endpoint CORS rejection
The SAML Assertion Consumer Service endpoint receives cross-origin POSTs from external identity providers by design. Bypass CSRF protection for this specific endpoint since the endpoint validates SAML response signatures itself.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 16:07:53 +01:00
Sacha Al Himdani
1db8e7133e Add document archiving
Documents can be archived and unarchived. Archived documents are
read-only, excluded from the trust center, and moved to a dedicated
Archived tab in the document list.

- Add archived_at timestamp and status (ACTIVE/ARCHIVED) PG enum column
- Rename DocumentStatus → DocumentVersionStatus, introduce DocumentStatus
- Archive/unarchive mutations in GraphQL, MCP, and CLI
- Bulk archive/unarchive mutations with Active/Archived tabs in the list
- ABAC policies: write actions denied on archived docs, unarchive denied
  on active docs
- Remove control/risk mappings and reset trust center visibility on archive
- Exclude archived documents from mapping dialogs and trust center tab

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-19 14:15:54 +01:00
Bryan Frimin
2e12c11c0c Fix flaky finding e2e tests: move advisory lock outside CTE
The pg_advisory_xact_lock inside the WITH clause caused race conditions
in READ COMMITTED mode. When a transaction blocked on the lock and resumed
after acquiring it, it used a stale snapshot and computed the same reference
ID as the previous transaction, violating the unique constraint. Moving the
lock to a separate statement before the INSERT ensures the snapshot includes
all previously committed data.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 13:30:07 +01:00
Bryan Frimin
4f54241382 Add document types filtering and rename ISMS to GOVERNANCE
Adds 5 new document types (PLAN, REGISTER, RECORD, REPORT, TEMPLATE), renames ISMS to GOVERNANCE, and implements type-based filtering across GraphQL, MCP, and frontend. Includes migration, enum updates, filter implementation with SQL array support, and frontend dropdown UI with Relay refetch pattern.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 12:31:39 +01:00