47 Commits

Author SHA1 Message Date
Ludovic Vielle
238c19d509 Add pre-assume enrolled device status query
The /enroll wait UI polled device state via node(), which
requires an assumed org session, so confirmation never
succeeded for unassumed viewers. Expose viewer.enrolledDevice
behind itam:employee-device:get (own-device, skip assumption)
and point the poller at it.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
2026-07-24 15:08:34 +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
Bryan Frimin
bf255b198c Bound GraphQL request cost to prevent alias-flooding DoS
The GraphQL endpoint built its gqlgen server with bare handler.New and
no limits, so a single request with thousands of aliased resolver calls
was parsed, validated, executed, and marshalled in full. Under load this
let an unauthenticated client drive excessive CPU and memory use against
POST /api/connect/v1/graphql and the console and trust endpoints, which
share the same constructor (GHSA-prh2-g8pv-m7p9).

Add configurable guards in the shared gqlutils.NewHandler: a parser
token limit rejects oversized queries at lex time before any execution,
a fixed complexity limit caps field-selection count, an LRU query cache
avoids repeated parsing, and field suggestions are disabled. The limits
flow from a new APIConfig.GraphQL section through server and api config
into all three GraphQL handlers, with PROBOD_API_GRAPHQL_* env vars and
Helm values exposed for per-environment tuning.

Defaults are sized with generous headroom over real traffic: the parser
token limit (15000) and complexity limit (2000) sit far above the
largest legitimate frontend query yet well below the proof-of-concept
flood, so normal usage is unaffected while floods are rejected cheaply.

Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-06-30 14:10:41 +02:00
Ludovic Vielle
c93932f026 Introduce oauth2scope registry with freeze lifecycle
Replace pkg/iam/scopeset with pkg/iam/oauth2scope.Registry, a shared
OAuth2 scope→action registry used by the authorizer, OAuth2 service,
and Connect API. Registration stays open until probod calls Freeze();
read paths (RegisteredScopes, Allows, ValidateScopes) panic before
that.

Drop the leaky APIScopes surface and AllowedAPIScopes on manual
access-token creation in favor of registry.ValidateScopes. Metadata,
protected-resource metadata, and CIMD scope lists are built from
RegisteredScopes() via helpers in pkg/iam/oauth2/scopes.go. Expose
oauth2ScopesSupported as an OAuth2Scope GraphQL scalar.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
2026-06-22 11:22:19 +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
Bryan Frimin
d43526bff4 Add error for already used token
Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-06-05 17:54:51 +02:00
Bryan Frimin
1d36123ead Add dedicated expired magic link page
Instead of a toast, expired magic link tokens now return a TOKEN_EXPIRED
GraphQL error code and redirect users to a dedicated /magic-link-expired
page with a clear CTA to request a new link.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-06-05 14:33:11 +02:00
Bryan Frimin
383ea5a2d4 Retrict some query and mutation to only session
Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-06-02 17:43:21 -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
509d0c88b1 Add vendor assessment agent
Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-24 08:43:14 +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
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
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
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
Bryan Frimin
6a77d42dd6 Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-16 00:28:47 +01:00
Bryan Frimin
ef76a8d2e1 Remove deadcode
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 17:18:02 +01:00
Sacha Al Himdani
d5c62a9383 Run go fmt/fix
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-13 14:48:13 +01:00
Émile Ré
af17afeffb Catch account already activated error and redirect
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-11 17:08:43 +04:00
Bryan Frimin
d4b3025463 Use go 1.26 syntax
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-06 15:00:42 +01:00
Émile Ré
97e957f394 Implement guard on empty full name before NDA is signed
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-05 17:07:58 +04:00
Émile Ré
9da8cc2e3d Add nda signature middleware
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-03 22:07:01 +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
Émile Ré
583148eb5f Rename error
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 09:37:04 +04:00
Émile Ré
ce69899909 Catch assumption needed errors
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 09:37:03 +04:00
Bryan Frimin
b016f44525 Fix missing trace and span id on graphql resolver
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-05 14:41:36 +01:00
Émile Ré
a388aa4999 Redirect when already authenticated
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-05 11:49:33 +04:00
Bryan Frimin
ece54f1616 Fix golint errors
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-02 18:42:50 +01:00
Bryan Frimin
7a3e289677 Fix otel utf8 error
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-21 09:28:45 -08:00
Émile Ré
8b3bda56e6 Add magic link login for trust center
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-17 12:34:24 -08:00
Bryan Frimin
10eed9a6a3 Extract session directive in a dedicated package
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 12:34:24 -08:00
Émile Ré
e220c259b3 Use trust center from context
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-17 12:34:23 -08:00
Émile Ré
7322201dab Plug trust center part 1
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-17 12:34:23 -08:00
Émile Ré
1257347df9 Extract authn & authz utils
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-17 12:34:03 -08:00
Émile Ré
c6094ff572 Implement organization assumption check in authorization layer
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-17 12:34:01 -08:00
Bryan Frimin
dccac5c088 Move UnwrapOmittable in a dedicated helper
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 10:14:56 -08:00
Bryan Frimin
48183906f8 Add shortcut totalCount
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 10:14:55 -08:00
Bryan Frimin
c435d16ba6 Add shortcut for only id selection
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 10:14:55 -08:00
Bryan Frimin
f72851df4d Fix no internal error on node
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 10:10:24 -08:00
Bryan Frimin
74fc3b8cd1 Rewrite identity and access management
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 10:07:34 -08: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é
9d81fed22b Fix recover log stack attr format
Signed-off-by: Émile Ré <nemile.re@gmail.com>
2025-12-15 09:47:06 +01:00
Sacha Al Himdani
21c4b7cd9d Add role management
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-11-13 17:11:22 +01:00
Bryan Frimin
f9216d30b2 Add validator lib
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2025-11-06 13:13:17 +01:00
Sacha Al Himdani
5212d0c18f Add api keys
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-11-04 13:37:31 +01:00