Commit Graph

56 Commits

Author SHA1 Message Date
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
Bryan Frimin
11770b4058 Add OAuth2/OpenID Connect authorization server
Implement a full OAuth2 2.0 and OpenID Connect 1.0 authorization
server with support for authorization code flow (with PKCE),
refresh token rotation, device authorization grant, dynamic
client registration, token introspection, and token revocation.

Includes database schema, coredata layer, service logic, HTTP
handlers, OIDC discovery endpoint, and JWKS publishing.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-19 12:00:53 +02:00
Sacha Al Himdani
06c0972551 Add membership and host to user webhook payload
Nest membership ID, role, and state into a membership sub-object
in the user webhook payload. Also emit user:updated webhook when
the membership role is changed. Add X-Probo-Webhook-Host header
to webhook HTTP calls. Skip delete webhook when membership is
not found in SCIM user deletion.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-13 17:14:01 +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
7bee5f27d2 Fix SCIM sync
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-03 17:21:08 +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
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
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
76f781ead1 Clear conflicting external_id when enrolling manual profile into SCIM
When a SCIM provider sends CreateUser for a user whose email matches an
existing manual profile, but another profile already holds that
external_id (e.g. created by a prior CreateUser with a different email),
clear the conflicting external_id before enrolling the manual profile.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-14 12:40:26 +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
Bryan Frimin
f99b2f7828 Rename nickname
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:03 +01:00
Bryan Frimin
3354bbd16b Fix mapping google workspace
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:03 +01:00
Bryan Frimin
e393411333 Move kind to string
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:02 +01:00
Bryan Frimin
764f61bfa7 Remove debug logs
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:01 +01:00
Bryan Frimin
f674426dfa Update Google SCIM bridge
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:01 +01:00
Bryan Frimin
dd3885ac54 Fix MS365 attributes handling
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:01 +01:00
Bryan Frimin
c6c6e29d73 Fix delete does not completly remove the record
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:01 +01:00
Bryan Frimin
346205f05a Returns 409 when user already exist
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:00 +01:00
Bryan Frimin
85663d3a34 Fix delete user membership instead of profile
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:00 +01:00
Bryan Frimin
c8250f6794 Add userName and externalID support
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:00 +01:00
Émile Ré
17c9f2eded Fix profiles default filter
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-10 18:19:16 +04:00
Sacha Al Himdani
6905472fba Add user webhooks
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-27 10:14:53 +01:00
Émile Ré
c3a65c123a Sync title in SCIM and Gbridge
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-19 16:13:05 +04:00
Émile Ré
c74e7e23f6 Inline if block
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-19 16:13:04 +04:00
Émile Ré
ae0119e2c5 Expire invitations when user is deactivated or switches to SAML source
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-19 16:13:00 +04:00
Émile Ré
47aba96b69 Reimplement invitations
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-19 16:12:58 +04:00
Émile Ré
7794563e94 Remove duplicate membership method
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-19 16:12:56 +04:00
Émile Ré
56ec0ab3c3 Move source and state from membership to profile
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-19 16:12:55 +04:00
Émile Ré
108e9cb85d Remove coredata.MembershipProfile MemerhipID field
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-19 16:12:52 +04:00
Émile Ré
a3b49db43e Add organization_id on profiles and implement ListProfiles
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 16:21:11 +04:00
Émile Ré
6328952c6f Load identity email_address on coredata.MembershipProfile
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 16:21:09 +04:00
Bryan Frimin
055a606747 Fix active state not used at creation
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-11 16:03:44 +01:00
Sacha Al Himdani
1494707cb5 Exclude users from google workspace bridge
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-10 12:42:24 +01:00
Bryan Frimin
1bc5ebce2c Fix SCIM disable all non SCIM managed members
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-03 16:01:03 +01: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
e42e6407df Fix AI review
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-02 09:14:39 +01:00
Bryan Frimin
3d4b215b8f Add bridge backend for sync
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-02 09:14:39 +01:00
Émile Ré
bbdea575d1 Expire invitations on SAML sign up and invitation accept
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-17 12:34:03 -08:00
Émile Ré
b790ca312a Expire invitations on SCIM delete
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-17 12:34:03 -08:00
Émile Ré
b961069e1d Accept/Expire invitations on SAML & SCIM operations
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-17 12:34:02 -08:00
Bryan Frimin
89439da20d Use employee as default role
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 12:30:30 -08:00
Bryan Frimin
c4285cdc42 Fix re-activitating membership does not reset the role
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 12:30:30 -08:00
Bryan Frimin
64610b388a Fix SCIM filter test
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 12:30:29 -08:00
Bryan Frimin
7030d06aed Add membership state
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 12:22:47 -08:00
Bryan Frimin
da8a670a68 Improve scim event UI/UX
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 12:22:46 -08:00
Bryan Frimin
d72024be1e Remove useless User struct
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 12:22:46 -08:00
Bryan Frimin
07f2885371 Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-01-17 12:22:46 -08:00