Commit Graph

83 Commits (0435d08568baf6c502c623e8fc8075375d6ae151)

Author SHA1 Message Date
Your Name 0435d08568 RemoveAlwaysElseRector 5 days ago
Your Name a2e38e5ffe CompactToVariablesRector 5 days ago
Your Name 5949dc21c1 UseIdenticalOverEqualWithSameTypeRector 5 days ago
Your Name dc7cf910fa get_class to ::class 5 days ago
Your Name 277b8aa970 Use now() helper instead of Carbon::now() for current-time access
Aligns with the app's dominant convention (413 now()/today() call
sites vs 12 Carbon::now()). Carbon::parse() calls are untouched since
they parse arbitrary date strings, not current-time access.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 weeks ago
Daniel Supernault 1d96c94054
Refactor Auth, remove expensive middleware 2 weeks ago
Your Name 97f1a097ff Clear 2FA session state on forced logout after failed attempts 2 weeks ago
Your Name 8cebb24c04 Rate limit and audit-log 2FA checkpoint verification 2 weeks ago
Your Name c0cde2f682 refactor: move 52 legacy models from App\ to App\Models\
Move all Eloquent models from the app/ root directory to app/Models/
for consistency with modern Laravel conventions. The project already had
54 models in App\Models; this migrates the remaining 52 legacy models.

Changes:
- Move 52 model files from app/ to app/Models/
- Update namespace declarations in each model
- Update all ~1000 import references across the codebase
- Add Relation::morphMap() in AppServiceProvider for backward
  compatibility with existing polymorphic database records
- Add missing HasSnowflakePrimary imports for models that relied
  on same-namespace resolution
4 weeks ago
Your Name 54cfdf3c2b refactor: add return type declarations to controller methods
Adds explicit return type declarations to 498 controller methods
across 88 files. Types inferred from return statements:

- JsonResponse for response()->json() returns
- RedirectResponse for redirect()/back() returns
- View (contract) for view() returns
- Response for response() returns
- void for methods with no return value
- array for array returns
- string/int/bool for scalar returns

Also fixes 3 methods with incorrect bare returns:
- AvatarController::deleteAvatar - bare return → json response
- ImportPostController::checkPermissions - bare return → true
- RemoteAuthController::accountToId - bare return → empty array
4 weeks ago
Shlee 3c6280111e
Update AccountController.php 4 weeks ago
Your Name 8a2649b3ff feat: add critical path test suite and fix auth/config issues
Test Infrastructure:
- Modernize phpunit.xml (bootstrap, source block, Laravel 12 env vars)
- Configure tests/Pest.php with pest()->extend(TestCase::class)->in('Feature')
- Add docker-compose.test.yml (Redis for test suite)
- Add composer test/test:quick scripts
- Rename CACHE_DRIVER to CACHE_STORE across config (backwards compatible)
- Update .env.testing for in-memory SQLite + Docker Redis

Test Coverage (190 tests):
- CriticalRoutes: public routes, auth routes, API endpoints, middleware, schedule
- Auth/LoginTest: login, logout, rate limiting, redirect behavior
- Auth/RegisterTest: registration flow, validation, disabled registration
- Auth/PasswordResetTest: reset request, token validation, password update
- Auth/TwoFactorTest: 2FA checkpoint, setup behind password confirmation
- Auth/PasswordConfirmationTest: sudo mode flow via Laravel password.confirm
- Api/ScopeTest: scope enforcement, public endpoints, admin access

Bugs Fixed:
- Fix unauthenticated API returning 500 instead of 401 (AuthenticationException
  not handled in custom exception renderer in bootstrap/app.php)
- Replace custom DangerZone middleware with Laravel password.confirm
- Add HasFactory trait to Profile model for test factories

Bugs Documented (known-bugs group):
- Registration crashes with str_ends_with TypeError (RegisterController:82)
- OAuth routes use legacy array syntax causing ReflectionFunction TypeError
4 weeks ago
Your Name 1617734907 Revert "Merge pull request #6851 from pixelfed/fix/phpstan-auth-request-scope-2"
This reverts commit ce4baf6995, reversing
changes made to 9235cb979a.
4 weeks ago
Your Name 0939f495bb fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Your Name edb4368b08 refactor: replace deprecated laravel/helpers with native alternatives
Replace all deprecated helper function calls:
- str_slug() → Str::slug()
- starts_with() → str_starts_with()
- ends_with() → str_ends_with()
- array_first() → Arr::first()
- array_last() → Arr::last()
- array_flatten() → Arr::flatten()

Remove laravel/helpers package from composer.json as it is no longer
needed and will not be maintained for Laravel 13.
4 weeks ago
Shift 19880c2ffb
Convert string references to `::class`
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
4 weeks ago
Shlee fbe98ea4de
Update AccountController.php 1 month ago
Shlee 5a3d841e19
Update AccountController.php 11 months ago
Daniel Supernault 8082c004bc
Refactor following check 1 year ago
Daniel Supernault 6ce513f8c3
Update user_filters, use config_cache 3 years ago
Daniel Supernault 9873913921
Update ApiV1Controller, fix account blocks.Closes #4304 3 years ago
Daniel Supernault f17ca9d904
Update HttpSignature 3 years ago
daniel e68ec03cea
Merge pull request #3890 from vanlueckn/feat-fix-sudo-mode-url-scheme
Fix wrong url scheme in sudo mode when using reverse proxy
4 years ago
Daniel Supernault 5b879f0156
Update mute/block logic with admin defined limits and improved filtering to skip deleted accounts 4 years ago
Daniel Supernault aaed2bf66e
Dispatch follow accept/reject pipeline jobs to follow queue 4 years ago
Nils van Lück 593420d84d Fix wrong url scheme in sudo mode when using reverse proxy 4 years ago
Daniel Supernault a231b3c556
Update AccountController, fix 2FA backup code bug 4 years ago
Daniel Supernault e97900a060
Update follower counts on follow_request approval 4 years ago
Daniel Supernault 4470981af7
Improve follow request flow, federate rejections and delete rejections from database to properly handle future follow requests from same actor 4 years ago
Daniel Supernault aded149fae
Update AccountController, include account entities in follow_requests.json endpoint 4 years ago
Daniel Supernault 68300c426c
Update AccountController 4 years ago
Daniel Supernault 4dc9365acb
Update AccountController, dispatch Accept Follow activity if applicable 4 years ago
Daniel Supernault fe7687851c
Update AccountController, refresh relationship after handling follow request 5 years ago
Daniel Supernault 6f1b02456f
Update AccountController, refresh RelationshipService on mute/blocks 5 years ago
Daniel Supernault 0e892bb3fd
Update AccountController 5 years ago
Daniel Supernault 37abcf3898
Update public timeline api, use cached sorted set and client side block/mute filtering 5 years ago
Daniel Supernault af7face4da
Add Network Timeline 6 years ago
Daniel Supernault 1fb7e2b2c9
Update AccountController, add mutes and blocks endpoint to pixelfed api 6 years ago
Daniel Supernault 4a14e970f0
Update Profile model, improve counter caching 6 years ago
Daniel Supernault d63569c120
Add Direct Messages 6 years ago
Daniel Supernault 2c440b4882
Update AccountController, prevent blocking admins 6 years ago
Daniel Supernault 6074c56838
Update AccountController 6 years ago
Daniel Supernault 483548e217
Update AccountController, add followRequestJson method 7 years ago
Daniel Supernault 0c82c97069
Added trusted devices to sudo mode 7 years ago
Daniel Supernault 6a16559132
Update DangerZone/Sudo middleware 7 years ago
Daniel Supernault 829c41e16f
Update password reset ttl, now expires after 24 hours 7 years ago
Daniel Supernault c369882b48
Update Redis namespace 7 years ago
Daniel Supernault 1d45e5655d
Update AccountController 7 years ago
Daniel Supernault 213fba725e
Update AccountController 7 years ago