Commit Graph

85 Commits

Author SHA1 Message Date
Andras Bacsai a511bd9b67 fix(api): validate token team context 2026-06-01 15:17:55 +02:00
Andras Bacsai 9b996b4dc9 chore: inspect commit message guidance 2026-05-27 07:14:54 +02:00
Andras Bacsai 081bd6ef8c fix(seeding): ensure root user joins root team
Create the root team before production seeding depends on it, reuse the
existing root team when creating root users, and cover the production seeder
flow with a feature test.
2026-05-26 17:05:54 +02:00
Andras Bacsai 49b5472961 refactor(auth): upgrade email verification hash to sha256
Move the email-verification URL hash from sha1 to sha256 and verify it
directly in the controller using hash_equals, instead of going through
Laravel's EmailVerificationRequest (which only compares against sha1).
The signed URL still carries the authoritative HMAC; the hash upgrade
keeps the identity binding aligned with modern hashing guidance.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 12:09:48 +02:00
Andras Bacsai a77e1f47d1 fix(models): replace forceCreate with forceFill+save pattern
Replaces Model::forceCreate([...]) calls with (new Model)->forceFill([...])->save()
across SettingsBackup, Server, and User models to avoid bypassing Eloquent
model event lifecycle during record creation.
2026-03-31 13:50:37 +02:00
Andras Bacsai 1a603a10ed fix(models): replace forceFill/forceCreate with fill/create and add fillable guards
Replace all uses of `forceFill`, `forceCreate`, and `forceFill` with their
non-force equivalents across models, actions, controllers, and Livewire
components. Add explicit `$fillable` arrays to all affected Eloquent models
to enforce mass assignment protection.

Add ModelFillableCreationTest and ModelFillableRegressionTest to verify that
model creation respects fillable constraints and prevent regressions.
2026-03-31 13:45:31 +02:00
Andras Bacsai f267a28cb2 fix: harden GetLogs Livewire component properties (#9229) 2026-03-29 21:29:23 +02:00
Andras Bacsai b3256d4df1 fix(security): harden model assignment and sensitive data handling
Restrict mass-assignable attributes across user/team/redis models and
switch privileged root/team creation paths to forceFill/forceCreate.

Encrypt legacy ClickHouse admin passwords via migration and cast the
correct ClickHouse password field as encrypted.

Tighten API and runtime exposure by removing sensitive team fields from
responses and sanitizing Git/compose error messages.

Expand security-focused feature coverage for command-injection and mass
assignment protections.
2026-03-29 20:56:04 +02:00
Andras Bacsai 67a4fcc2ab fix: add mass assignment protection to models
Replace $guarded = [] with explicit $fillable whitelists across all
models. Update controllers to use request->only($allowedFields) when
assigning request data. Switch Livewire components to forceFill() for
explicit mass assignment. Add integration tests for mass assignment
protection.
2026-03-28 12:32:57 +01:00
Andras Bacsai f493b96be3 refactor: use random_int() for email change verification codes
Replace mt_rand/rand with random_int for stronger randomness guarantees
in verification code generation and Blade component keying.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 12:25:54 +01:00
Andras Bacsai b33962bf82 chore: remove unused $server property and add missing import
- Remove unused $server property and Server import from Advanced.php
- Add proper import for UpdateStripeCustomerEmailJob in User.php

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 15:42:21 +01:00
Andras Bacsai 8d212bc110 fix(team): improve team retrieval and session handling for users 2025-12-28 14:50:59 +01:00
Andras Bacsai ddd78658e8 fix(user): improve cache key and remove redundant route check
- Include sessionTeamId in currentTeam() cache key to prevent stale
  team data when users switch teams
- Update refreshSession() to use new cache key format
- Remove redundant routeIs('settings.index') check since settings.*
  already matches it

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 14:02:41 +01:00
Andras Bacsai 2743229cc4 fix(user): complete User model fixes for non-web contexts
- Fix currentTeam() to return null instead of crashing when no session
- Fix role() to use $this->currentTeam() instead of global helper
- Add roleInTeam() method for explicit team context
- Remove unused otherTeams() method
- Fix InviteLink authorization bypass when role() returns null
- Fix confirmEmailChange() null safety for currentTeam()
- Fix ActivityMonitor to handle null currentTeam with fallback chain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 13:55:55 +01:00
Andras Bacsai 2cf915aed8 fix(user): use $this instead of Auth::user() in User model methods
Fix isInstanceAdmin(), currentTeam(), otherTeams(), and role() methods
to operate on the actual User instance instead of always using the
authenticated user. This ensures correct behavior when these methods
are called on non-authenticated user instances (e.g., in ActivityMonitor).

Also fix settings route check to use routeIs() instead of path matching.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 13:55:55 +01:00
Andras Bacsai acff543e09 fix(settings): fix 404 on /settings for root user on cloud instance
- Make Server property nullable in Settings components (Index, Advanced, Updates)
- Add conditional server loading: only load when not on cloud
- Add null checks before using server for DNS validation and proxy configuration
- Fix isInstanceAdmin() to check root team's pivot role directly instead of current team
- Make root team (id=0) bypass subscription check on cloud
- Remove isInstanceAdmin() from main middleware bypass: only settings/admin routes are exempted
- Update isSubscribed() to only check isSubscriptionActive() for navbar consistency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-28 13:55:55 +01:00
Andras Bacsai b0d50669b1 fix: skip password confirmation for OAuth users
OAuth users don't have passwords set, so they should not be prompted for password confirmation when performing destructive actions. This fix:
- Detects OAuth users via the hasPassword() method
- Skips password confirmation in modal for OAuth users
- Keeps text name confirmation as the final step
- Centralizes logic in helper functions for maintainability
- Changes button text to "Confirm" when password step is skipped

Fixes #4457

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-12 14:12:02 +01:00
Andras Bacsai f7427fdea0 Changes auto-committed by Conductor 2025-10-17 23:04:24 +02:00
Andras Bacsai 9c3345318a fix(user): ensure email attributes are stored in lowercase for consistency and prevent case-related issues 2025-09-05 17:44:34 +02:00
Andras Bacsai ee502b9f76 feat(email): implement email change request and verification process
- Added functionality for users to request an email change, including generating a verification code and setting an expiration time.
- Implemented methods in the User model to handle email change requests, code validation, and confirmation.
- Created a new job to update the user's email in Stripe after confirmation.
- Introduced rate limiting for email change requests and verification attempts to prevent abuse.
- Added a new notification for email change verification.
- Updated the profile component to manage email change requests and verification UI.
2025-08-18 14:54:08 +02:00
Andras Bacsai 0e7cc988a6 feat(user): add changelog read tracking and unread count method 2025-08-12 10:06:19 +02:00
Andras Bacsai 24b6b32025 fix(models): improve user deletion logic in User model to handle team member roles and prevent deletion if user is alone in root team 2025-06-26 09:10:48 +02:00
Andras Bacsai be73d5cd76 fix(models): refine comment wording in User model for clarity on user deletion criteria 2025-06-26 09:07:55 +02:00
Andras Bacsai e746e212cb refactor(user): streamline user deletion process and enhance team management logic 2025-06-25 12:14:35 +02:00
Andras Bacsai e7f32a1c44 refactor(notifications): standardize getRecipients method signatures 2025-03-24 17:55:10 +01:00
Andras Bacsai d7d80e926e feat(user): implement session deletion on password reset 2025-03-21 15:45:29 +01:00
Andras Bacsai 1fe4dd722b Revert "rector: arrrrr"
This reverts commit 16c0cd10d8.
2025-01-07 15:31:43 +01:00
Andras Bacsai 16c0cd10d8 rector: arrrrr 2025-01-07 14:52:08 +01:00
peaklabs-dev 4428b95a65 chore: fix typo 2024-12-09 12:36:33 +01:00
Andras Bacsai 7fb1a1fc75 fix: use Auth(), add new db proxy stop event refactor clickhouse view 2024-11-04 14:18:16 +01:00
Andras Bacsai 281c6e39a5 fix: members of root team should not see instance admin stuff 2024-07-26 14:54:24 +02:00
andrasbacsai 613830e6a6 Fix styling 2024-07-24 19:11:12 +00:00
Andras Bacsai 33b965d9db chore: more details 2024-07-09 13:59:54 +02:00
Andras Bacsai 2d3a6a4528 openapi work work 2024-07-09 10:45:10 +02:00
Thijmen d86274cc37 Fix styling 2024-06-10 20:43:34 +00:00
Andras Bacsai 1d9d6c899d Refactor User model role() method to use data_get() for better readability 2024-05-15 11:41:11 +02:00
Andras Bacsai 36c31dcd67 Add role-based authorization for updating teams 2024-04-05 16:48:06 +02:00
Andras Bacsai 8b74e50c50 Add two-factor authentication fields to hidden array in User model 2024-03-07 13:05:04 +01:00
Andras Bacsai 9c1d585c43 Fix condition to return current team if user has teams 2024-03-05 09:22:38 +01:00
Andras Bacsai 2ffc3f497b fix: should note delete personal teams 2024-03-05 09:19:15 +01:00
Andras Bacsai f78fd212bb fix: subscription / plan switch, etc 2024-02-23 12:59:14 +01:00
Andras Bacsai f931ebece8 feat: make user owner
fix: ownership check
2024-02-23 12:34:36 +01:00
Andras Bacsai 2dc175be63 fix: null notify 2023-12-13 12:01:27 +01:00
Andras Bacsai b66c9835b7 Fix server status check and add new job 2023-11-17 14:22:05 +01:00
Andras Bacsai 2c40e93d3b wip: PAT by team 2023-10-18 18:02:09 +02:00
Andras Bacsai 62adf2c5dc fix: boarding + verification 2023-10-11 14:24:19 +02:00
Andras Bacsai 1067f37e4d fix: deleted team and it is the current one 2023-10-11 12:03:59 +02:00
Andras Bacsai 165f0a3d4a feat: add email verification for cloud 2023-10-09 14:20:55 +02:00
Andras Bacsai b07cc500e7 fix: invitation 2023-09-15 11:19:36 +02:00
Andras Bacsai 9f2fbc661a fix: registration
fix: user deletion
2023-09-14 18:22:08 +02:00