Commit Graph

35 Commits

Author SHA1 Message Date
Bryan Frimin
0f0f6643ad Rename backend services for portal
Point domain services, bootstrap, and related
packages at Compliance Portal types so callers
stop depending on the old Trust Center names.

Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-07-21 15:44:24 +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
cdd3af635b Hide unpublished and hidden docs in Slack alert
The trust center access-request Slack notification listed every document
referenced by a document access, including drafts with no published
version and documents whose trust center visibility is NONE. Skip those
so the message only surfaces documents a requester could actually be
granted.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
2026-07-06 18:41:51 +02:00
Sacha Al Himdani
f7e93cdec5 Migrate Slack sender to kit worker
Replace the custom polling loop in the Slack sender with the
go.gearno.de/kit/worker framework, matching the email sending worker.
Add a processing_started_at column to slack_messages so claims are safe
under the worker's claim/process model, with stale recovery for crashed
in-flight sends. Rename sender.go to worker.go to match the kit worker
file naming convention.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
2026-06-29 14:40:24 +02:00
Sacha Al Himdani
9ab8ea2085 Refacto load all functions
Unbounded LoadAll* loaders materialised an entire result set in one
query with no ceiling. A table that is small in development can grow
without bound in production, so these loaders were a latent memory
and query-time hazard.

Remove the LoadAll* methods from pkg/coredata and walk the cursor-
paginated LoadBy* siblings instead through a shared page.LoadAll
helper. The helper advances a MaxCursorSize forward cursor until the
result set is exhausted and concatenates the pages. It caps a single
call at MaxLoadAllPages (20) batches of 500 rows and errors past that
rather than materialising an unbounded set, so a runaway caller fails
loudly instead of exhausting memory.

Callers that genuinely need every row now express that explicitly,
and the coredata load-naming rule and docs are updated to discourage
new unbounded loaders.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
2026-06-16 14:35:16 +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
Ludovic Vielle
0e4d73bb0f Migrate audit reports to the files table
Signed-off-by: Ludovic Vielle <ludovic@probo.com>
2026-06-05 16:16:50 +02:00
Bryan Frimin
3e4a9be7c0 Remove tenant service pattern
Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-05-20 16:51:15 -07: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
Aurélien Sibiril
05781d1bbd Address code review feedback
- Return 400 instead of panicking on invalid organization_id
- Use generic error message for internal failures
- Drop duplicate validation from initiate handler (kept in tx)
- Make preserveConnectionFields mutate in place
- Remove as type assertions in GoogleWorkspaceConnector
- Use sort.Slice instead of sort.SliceStable
- Consistent error prefixes in Slack sender

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 19:24:46 +02:00
Aurélien Sibiril
816b9300ed fix(slack): select widest-scope connector in sender
sendMessage and updateMessage used LoadAllByOrganizationIDProtocol
AndProvider and then picked connectors[0], which is ordered by
created_at ASC. On an organization with multiple Slack installs
only the oldest install ever received messages — re-installing
Slack to switch channels silently broke because the sort kept
the old row winning.

Switch to LoadOneByOrganizationIDAndProvider, which picks the
widest-scope row with updated_at DESC as the tiebreak. For Slack
the scope sets are typically identical across installs, so the
effective behavior becomes "most recent install wins" — the
expected behavior.

While here, prefix the remaining error messages in this file with
"cannot" to match the project convention.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 19:24:46 +02:00
Aurélien Sibiril
56c042b7ed Add OAuth2 scope sources for access review, slack, googleworkspace
Each module that initiates an OAuth2 flow now declares its scopes
in its own package instead of duplicating them in the frontend or
in shared connector config:

- pkg/accessreview/drivers: per-provider scopes for the access
  review drivers
- pkg/slack: scopes for the compliance page integration
- pkg/iam/scim/bridge/provider/googleworkspace: scopes for the
  SCIM provisioning bridge

These constants are surfaced to the frontend via GraphQL fields
so the frontend never hardcodes scope strings.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-08 11:05:12 +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
Émile Ré
87415c0324 Remove useless encryption key injections
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-11 14:42:37 +04:00
Émile Ré
323cd602a1 Update business logic
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
Bryan Frimin
df56ae90e9 Fix noisy slack queue message error
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-10 09:37:10 +01:00
Bryan Frimin
ece54f1616 Fix golint errors
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-02 18:42:50 +01:00
Émile Ré
b8608fbec5 Fix slack compliance page access request fullname empty case
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-29 10:56:32 +04:00
Émile Ré
249d82f0fe Edit email links
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-28 21:53:52 +04:00
Sacha Al Himdani
504d31af6c Ignore no slack connector error during trust center access update
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-12-22 11:38:44 +01:00
Sacha Al Himdani
cf491a2096 Create slack message if necessary
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-12-22 11:09:51 +01:00
Émile Ré
c0b2a5702d Introduce pkg/mail.Addr
Signed-off-by: Émile Ré <nemile.re@gmail.com>
2025-12-15 18:24:00 +01:00
Émile Ré
ec13bd8108 Rework top level services injection of business level services
Signed-off-by: Émile Ré <nemile.re@gmail.com>
2025-12-11 18:42:26 +01:00
manish-singh-bisht
8eeab0a6d0 feat:pull the slack message service out to slack pkg
Signed-off-by: manish-singh-bisht <mthefool218@gmail.com>
2025-12-11 18:42:26 +01:00
Bryan Frimin
59aa332ab5 Move to vanity import url
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2025-10-31 17:01:52 +01:00
Bryan Frimin
6f2bd9c92f Fix failed to to cannot
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2025-10-30 16:38:08 +01:00
Sacha Al Himdani
789e047b4d Unmarshal body
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-10-23 15:10:56 +02:00
Sacha Al Himdani
0c29d6fa41 Fix join slack channel payload parsing
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-10-23 15:10:56 +02:00
Sacha Al Himdani
e44fc23671 Validate slack response url
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-10-23 15:10:55 +02:00
Sacha Al Himdani
b0f60d8de5 Refactor slack messages
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-10-23 15:10:55 +02:00
Sacha Al Himdani
0073846d3b Add interactif slack message
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-10-23 15:10:55 +02:00
Sacha Al Himdani
de004ce8d7 Add slack integration
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-10-23 15:10:54 +02:00