Commit Graph

682 Commits

Author SHA1 Message Date
Bryan Frimin
bb910b4314 Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-31 14:49:21 +02:00
Bryan Frimin
8095ac6233 Validate session transfer redirect with saferedirect
The session transfer handler was blindly redirecting to the continue URL
from the signed token. Use saferedirect with a trust center domain check
to prevent open redirects, and only trigger session transfer for known
trust center custom domains instead of any non-base-URL host.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-31 14:49:21 +02:00
Bryan Frimin
84a35c90e9 Add session transfer for SSO cookies on custom domains
After OIDC login, if the redirect targets a trust center custom
domain, the callback now redirects through a session-transfer
endpoint on that domain. The endpoint verifies an HMAC-signed,
time-limited token and sets the session cookie on the custom
domain before redirecting to the final URL.

The continue URL is bound into the signed token payload to
prevent open-redirect attacks via parameter tampering.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-31 14:49:20 +02:00
Sacha Al Himdani
5d6d0bdd7f Move document classification from document to document version
Classification now lives exclusively on DocumentVersion. The field is
removed from the Document model, all SQL queries, GraphQL Document
type, SignableDocument type, UpdateDocumentInput, and MCP Document
schema.

New documents still accept classification in CreateDocumentInput,
applied to the first version. New drafts inherit classification from
the previous version. PDF generation uses the version classification.

The drawer allows editing classification on draft versions via the
updateDocumentVersion mutation. Classification is read-only on
published versions.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-31 14:11:57 +02:00
Sacha Al Himdani
851e585b9b Add ISC license headers to Go, TypeScript, and SQL files
Add ISC license headers to all .go, .ts, .tsx, and .sql files
using each file's git history to determine the correct copyright
year or year range. Trademarked icons (brand logos, vendor logos,
compliance framework logos) are excluded.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-31 13:31:30 +02:00
Bryan Frimin
419c93fc7d Fix compliance page login redirect to custom domains
SafeRedirect previously matched against a single static host string,
so OIDC callbacks always fell back to the console instead of
redirecting back to compliance pages on custom domains. Refactor
AllowedHost into a dynamic AllowedHostFunc and wire a trust-service
lookup into the connect handler so custom domain hosts are accepted.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-31 10:51:34 +02:00
Sacha Al Himdani
68bc8cf59a Add major.minor document versioning
Introduce a two-part version scheme (major.minor) for documents.
Drafts start at 0.1 and increment minor on each new draft. Publishing
as minor keeps the current version, publishing as major bumps to the
next major.0. Both current_published_major and current_published_minor
are tracked on the document for exact version lookups.

Signatures and approval quorums aggregate across all versions sharing
the same major number using CTE joins. Approval page mutations spread
the decision fragment so Relay updates the version row state without
requiring a page refresh.

GraphQL, MCP, and service layer expose separate publishMajor and
publishMinor mutations instead of a single mutation with a type enum.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-30 18:54:28 +02:00
Sacha Al Himdani
0920690816 Add ability to disconnect Slack channel from compliance page
Users could connect a Slack channel to their compliance page but had no
way to remove or change the connection afterward. This adds a disconnect
button with a confirmation dialog next to connected Slack channels.

- GraphQL: deleteSlackConnection mutation with resolver
- Frontend: Disconnect button using useMutation with @deleteEdge

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-30 15:40:21 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
Bryan Frimin
d7c120c144 Rename NONCONFORMITY to MINOR_NONCONFORMITY and add MAJOR_NONCONFORMITY
Support distinguishing between minor and major non-conformities in findings. Rename the existing NONCONFORMITY enum value to MINOR_NONCONFORMITY and add a new MAJOR_NONCONFORMITY value across all API layers (GraphQL, MCP, CLI) and the database.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 10:02:28 +01:00
Bryan Frimin
82f241628c Refactor MeasuresPage to use Relay fragments
Replace the client-side grouped-by-category view (fetching 500 items)
with a flat table using server-side filtering and cursor-based
pagination. Colocate GraphQL queries, fragments, and mutations in the
component file per console CLAUDE.md conventions.

Backend changes add a category filter to the measure list endpoints
(GraphQL, MCP) and a new measureCategories field on Organization.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:54:33 +01:00
Bryan Frimin
32cc4a4f9c WIP
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:39 +01:00
Bryan Frimin
ea21f85887 Add http.CrossOriginProtection for CSRF defense using Sec-Fetch-Site headers
Implements native Go 1.26 cross-origin protection to block state-changing cross-origin browser requests. Registers configured AllowedOrigins as trusted origins and wraps the API router to check all incoming requests. Non-browser clients (MCP, Slack webhooks) are unaffected as they lack the browser-only Sec-Fetch-Site header.

Signed-off-by: gearnode <gearnode@probo.inc>
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:31:52 +01:00
Bryan Frimin
888838cfb0 Fix race condition in magic link token verification and typo in auth error message
- Hold SELECT FOR UPDATE lock within transaction by using tx directly instead of separate WithConn, ensuring mutual exclusion when multiple requests race to verify the same token
- Fix "resouce" → "resource" typo in authentication error messages

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:31:15 +01:00
Bryan Frimin
a5743729f7 Add file visibility (PRIVATE/PUBLIC) + public files API
Adds a visibility enum to files with PRIVATE (default) and PUBLIC states.
PUBLIC files are accessible via an unauthenticated /api/files/v1/{fileID}
endpoint that redirects to a presigned S3 URL. Introduces pkg/file service
to manage file operations. Logo uploads (trust centers, organizations,
frameworks, references) are marked PUBLIC; other files are PRIVATE.
Includes database migration and backfill for existing logos.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-18 19:19:04 +01:00
Bryan Frimin
7895dd32b0 Fix logging format string bugs and add missing contributor guides
Replace three instances of leftover %T format verbs in logger.ErrorCtx() calls with proper structured logging fields. Add alphabetically-sorted reference documentation for six new contrib/claude/ guides and reorder the existing list.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-18 15:09:31 +01:00
Sacha Al Himdani
73d5dbb5db Replace panic calls with proper error handling in resolvers
All panic(fmt.Errorf(...)) calls in the console and trust center
GraphQL resolvers are replaced with structured error logging via
r.logger.ErrorCtx and gqlutils.Internal(ctx) returns.

Mutation resolvers for Create, Update, Upload, Import, and Assess
operations now check for validator.ValidationErrors before returning
an internal error, surfacing field-level INVALID errors to clients
via gqlutils.InvalidValidationErrors.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-17 16:15:51 +01:00
Sacha Al Himdani
16b966b8fb Fix multiline function call style violations
Expand mixed inline/multiline function calls so each argument
is on its own line, matching the one-argument-per-line rule.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-17 15:59:26 +01:00
Bryan Frimin
91a06d1fb5 Use logger + gqlutils.Internal pattern instead of panic for NDA errors
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-17 15:19:23 +01:00
Bryan Frimin
6770fb7e1f Fix NDA file display on page reload
The Organization.TrustCenter and Node resolvers were not loading the NDA file from the database, causing ndaFileName to be null on page reload even though the file was uploaded. Now the resolvers fetch the file when NonDisclosureAgreementFileID is set.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-17 15:19:21 +01:00
Bryan Frimin
69ab9c60cd Add finding MCP API
Replace nonconformity and continual improvement MCP tools with
unified finding tools: list_findings, get_finding, create_finding,
update_finding, delete_finding, link_finding_to_audit, and
unlink_finding_from_audit.

Update specification and resolvers to use the new finding types.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-17 15:05:32 +01:00
Bryan Frimin
0ab88a9bbc Add finding console GraphQL API
Replace nonconformity and continual improvement GraphQL types with a
unified Finding type supporting kind, status, priority, and audit
associations. Update schema, resolver, and type mappings.

Add mutations for createFinding, updateFinding, deleteFinding,
linkFindingToAudit, and unlinkFindingFromAudit.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-17 15:05:32 +01:00
Sacha Al Himdani
cf1dadc0b5 Add implemented state and justification to controls
Introduce `implemented` enum (IMPLEMENTED/NOT_IMPLEMENTED) and
`not_implemented_justification` (nullable text) fields on the Control
entity across all API surfaces (GraphQL, MCP, CLI), database, frontend,
and SOA export.

The database stores implementation state as a PostgreSQL enum
`control_implementation_state`. Controls default to IMPLEMENTED during
migration. The SOA list and PDF export show implementation status
alongside applicability, with "-" for non-applicable controls.
Justification columns are renamed for clarity: "Justification for
non-applicability" and "Justification for non-implementation".

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-17 11:01:04 +01:00
Bryan Frimin
7ffb2d5e94 Add document viewer with proper 404 handling for trust center
Move document download/view to a dedicated viewer page with PDF preview,
access request flow, and a proper 404 error boundary when documents are
not found. The backend now returns NOT_FOUND instead of INTERNAL for
missing documents and reports.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-16 19:13:21 +01:00
Sacha Al Himdani
dc8e6d0817 Add validation to mailman service
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-16 17:46:32 +01:00
Bryan Frimin
807213d384 Stop tracking generated files
Run make generate in CI lint and test jobs since generated files are
now gitignored. Also include Relay codegen for frontend apps in the
generate target.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-16 16:19:47 +01:00
Sacha Al Himdani
0b7c0e0806 Add validation to mailman service
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-16 14:37:34 +01:00