30 Commits
Author SHA1 Message Date
Andras Bacsai 16a8c7999d feat(audit): log account, resource, and instance settings changes
Add audit events for account actions, server and application settings,
services, destinations, storage, backup schedules, and scheduled tasks.
Track changed fields and skip unchanged saves without logging file content.

Add regression coverage for audit events and changed-field detection.
2026-10-04 17:32:50 +02:00
Andras Bacsai c0d81d4c9c fix(auth): accept Entra ID xms_edov claim as verified OIDC email
Microsoft Entra ID never sends email_verified, so existing accounts could
not be linked through OIDC. Treat a boolean true xms_edov claim (email
domain owner verified) as equivalent, via a shared
OidcUser::claimsVerifyEmail() helper used for both ID token and userinfo
claims.

Document the Entra ID issuer URL and required optional claims in the
OIDC settings helper text, and add tests covering xms_edov handling.
2026-10-02 18:51:16 +02:00
Andras Bacsai 5fd7191d4a fix(auth): allow OAuth sign-up with an unverified provider email
The provider email verification check now runs only when an account with
that email already exists. A new account follows the registration
settings, the same way password registration does, which also doesn't
verify the email. Linking to an existing account still needs a verified
email, except for password-less users created before OAuth identities.

Add tests for new-user registration from Authentik, Discord and GitLab
when the provider email is unverified. Also test that the "Registration
is disabled" error is shown when registration is turned off.
2026-10-02 17:07:54 +02:00
Andras Bacsai 5b1fcd6e13 feat(auth): show OAuth-only registration notice on login page
Move the user creation check from OauthLoginService into
OauthSetting::allowsUserCreation(), so the login view can use it.
The login view now gets a can_register_with_oauth flag. The flag is
true when an enabled OAuth provider allows creating new users. The
view uses it to show the new auth.register_with_oauth message.
Add translations for the message in all locales, plus test coverage.
2026-10-02 16:45:33 +02:00
Andras Bacsai b1ddde2b64 fix(auth): enforce Google hosted domain and block password-user linking
Treat the Google "Hosted domain" setting as an enforced Workspace
restriction: compare it to the hd claim case-insensitively with spaces
trimmed, and accept "*" for any Workspace account while still rejecting
personal Google accounts.

Exempt pre-upgrade OAuth users from the email verification check only
when they have no password. A flagged user with a password no longer gets
an unverified provider email linked to their account.

Update the hosted domain helper text and add tests for both cases.
2026-10-02 16:11:21 +02:00
Andras Bacsai 8521f973dd fix(auth): show specific error messages for denied OAuth logins
Add OauthLoginException, which carries a translation key for the message
shown on the login page. The exception message only goes to the log.
OauthLoginService now throws it for an unverified email, an account that
is already linked to another identity, and disabled registration.
OauthController shows the matching message for each case. Other
HttpExceptions fall back to a generic OAuth failure message.

The email verification check now runs before the linked-identity check,
so an unverified email cannot reveal that an account is already linked.

Add translations for the new auth.failed.oauth* keys in all locales and
cover the new error messages with feature tests.
2026-10-02 16:07:48 +02:00
Andras Bacsai 3c23e2d30f refactor(auth): remove OAuth re-authentication for destructive actions
Drop the OAuth confirm/callback flow that let users confirm destructive
actions by re-authenticating through a linked provider. This removes the
confirm route and session handling in OauthController, the middleware
bypass for those routes, OauthSetting::providerName(),
User::oauthConfirmationProviders(),
OauthLoginService::identityBelongsToUser() and the
socialite_reauthentication_parameters() helper.

Users with a linked OAuth identity no longer need a password step and
only use the dialog's typed confirmation. Password confirmation is now
required only for users who have a password and no SSO identity. The
confirmation modal and tests are updated to match.
2026-09-30 21:37:02 +02:00
Andras Bacsai b8bc197b17 fix(oauth): key non-OIDC identities by provider instance
GitLab, Authentik, Zitadel, Clerk and Azure identities were keyed by the
provider name only, so a user with the same subject on another instance
could sign in as the linked user after the base URL or tenant changed.
The issuer column now stores the normalized instance, existing rows are
backfilled from the current settings, and oauth:rekey handles host renames.
2026-09-30 18:10:10 +02:00
Andras Bacsai 9e7cb60b0d feat: add import restore options, OAuth confirmation, and fixes
- database import: add keep_owners (restore PostgreSQL owners and
  privileges) and sqlite_database (pick the target SQLite file) to the
  API, OpenAPI spec, and import form
- oauth: require password confirmation and support team selection on
  OAuth login
- remote process: send team broadcast events to the team of the server
  that ran the process instead of the causer's user id
- servers API: handle the legacy build server setting
- compose: support parent bind paths and volume driver options
- dns: improve record hints and provider management
- notifications: fix throttling and missing backup notifications
- ui: rework the confirmation modal
- add feature and unit tests for the new behavior
2026-09-30 13:35:22 +02:00
Andras Bacsai f9e5a00312 fix(oauth): let pre-existing users link first identity without verification
Before OAuth identities existed, OAuth sign-in matched users by email
only. Add a created_before_oauth_identities flag, set for every user at
upgrade time, so their first OAuth identity links without a provider
email verification claim. The flag is cleared once an identity links.

Also trust Microsoft Entra ID user principal names and GitLab confirmed
primary emails as verified, and pass the email to hasVerifiedEmail.
Add tests using real provider payloads.
2026-09-29 22:11:06 +02:00
Andras BacsaiandClaude Opus 5.5 df9f1555b3 fix(auth): keep the current team only in the session
Login, registration and OAuth set a currentTeam attribute on the user model
that is not a database column, so a save of the user in the same request
would fail. Keep the team in the session and read it with currentTeam().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:02:19 +02:00
Andras BacsaiandClaude Opus 5.5 a6a3b1d26b revert: undo the app changes from the test clean-up
Revert the app code changes of d666a0a95, 69eeb2f62, 1e66c9f9b and
a32082b03, so login, registration, OAuth, team danger zone, service
templates, and the other touched files are back to their earlier state.
Keep the removal of unused components and markup-only tests (d666a0a95
also contained those deletions by mistake).

StartupExecutionCleanupTest now fakes the template CDN with the current
file content, so app:init in the test no longer empties
templates/service-templates-latest.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 08:06:34 +02:00
Andras BacsaiandClaude Opus 5.5 d666a0a956 fix(auth): stop storing the current team as a user attribute
Login, registration and OAuth set a fake currentTeam attribute on the user.
When refreshSession() saved the user in the same request, the query wrote
a currentTeam column that does not exist. Keep the team only in the session
and read it through currentTeam().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 00:18:09 +02:00
Andras Bacsai df692e6278 fix(auth): honor instance registration for non-OIDC OAuth providers 2026-09-25 09:11:55 +02:00
Andras Bacsai c8dea4badc chore: align account lifecycle 2026-09-24 16:56:38 +02:00
Andras Bacsai 87685d1e09 chore: align control-plane behavior 2026-09-24 15:46:04 +02:00
Andras Bacsai 865ebe0bdd fix(auth): improve OAuth sign-in handling 2026-09-21 14:00:14 +02:00
Andras Bacsai 1c408fb408 feat(audit): expand event tracking and remove scheduled job monitoring
Add audit levels and record user, OAuth, DNS, notification, and settings changes while removing the obsolete scheduled job monitoring UI and services.
2026-09-21 12:23:42 +02:00
Andras Bacsai ca5fcce39b Reapply "Merge branch 'next' into main"
This reverts commit 7bbd91175f.
2026-08-21 12:15:46 +02:00
Andras Bacsai 7bbd91175f Revert "Merge branch 'next' into main"
This reverts commit 2598f3e4c8, reversing
changes made to 83f1a2e503.
2026-08-21 12:12:56 +02:00
Andras Bacsai 81227670e6 Reapply "Merge origin/next into main"
This reverts commit 15359833d3.
2026-08-19 12:39:55 +02:00
Andras Bacsai 15359833d3 Revert "Merge origin/next into main"
This reverts commit 541d743907, reversing
changes made to bb1d3f13f2.
2026-08-19 12:33:16 +02:00
Andras Bacsai 3b08be1429 fix(auth): handle concurrent OAuth identity creation safely
Recover existing OAuth and OIDC identities after unique constraint races and reject boolean or floating-point provider IDs.
2026-08-18 15:43:46 +02:00
Andras Bacsai d29139f4a3 fix(auth): reject OAuth logins without valid provider IDs
Add validation for missing, blank, and non-scalar provider user IDs and cover the rejection cases with feature tests.
2026-08-18 15:34:37 +02:00
Andras Bacsai f9f26c547c fix(auth): preserve OAuth identity across email changes
Link OAuth logins by provider user ID before matching email, refresh identity
claims on login, and skip password confirmation for SSO-linked users.
2026-08-18 15:27:27 +02:00
Andras Bacsai fc32bc6b6c feat(auth): auto-join OAuth users to root team
Add an OAuth setting that provisions newly registered users as Root
team members without creating a personal team.
2026-07-02 15:13:39 +02:00
Andras Bacsai c656892738 fix(auth): store OIDC raw claims as arrays
Handle missing provider payloads by persisting an empty array and add
coverage for multi-audience OIDC azp validation.
2026-06-15 13:33:23 +02:00
Andras Bacsai 8d92059dd6 fix(auth): refresh OIDC JWKS and block unverified account linking 2026-06-15 12:49:51 +02:00
Andras Bacsai 21333f02f9 fix(settings): harden OIDC, email, and log drain flows 2026-06-15 12:35:05 +02:00
Andras Bacsai e354840e5a feat(auth): add OIDC SSO and registration controls
Add OIDC discovery, JWKS validation, Socialite integration, OAuth identity linking, and configurable registration policy for password and SSO signups. Update related settings/profile UI and tests.
2026-06-04 13:59:08 +02:00