Commit Graph

12759 Commits (5a364be58b9a72cd1da694b076ac511f495b25e4)
 

Author SHA1 Message Date
Your Name 5a364be58b fix: remove deprecated Passport::personalAccessClientId() and enableImplicitGrant()
- Remove Passport::personalAccessClientId() (removed in Passport v13, auto-discovers now)
- Remove Passport::enableImplicitGrant() (legacy grant, no clients use it)
- Flatten config instance.oauth.pat to pat_enabled (remove dead pat.id key)
- Add OAUTH_PAT_ENABLED=false to .env.example and .env.docker.example
- Show swal alert when PATs disabled instead of hidden API error
- Improve store() error handling to surface 403 messages in the UI
- Remove OAUTH_PAT_ID row from admin diagnostics blade
4 weeks ago
Shlee 190e7da6e1
Merge pull request #6866 from pixelfed/tests/critical-path-smoke-tests
Tests/critical path smoke tests
4 weeks ago
Your Name 6a34458c3a Merge branch 'staging' into tests/critical-path-smoke-tests
# Conflicts:
#	app/Http/Controllers/Settings/ExportSettings.php
#	app/Http/Controllers/Settings/HomeSettings.php
#	app/Http/Controllers/Settings/PrivacySettings.php
#	app/Http/Controllers/Settings/SecuritySettings.php
#	app/Http/Controllers/SettingsController.php
4 weeks ago
Shlee 6dd0604133
Merge pull request #6865 from pixelfed/shleeable-patch-1
Update AccountController.php
4 weeks ago
Shlee 3c6280111e
Update AccountController.php 4 weeks ago
Shlee 8778273c7c
Merge pull request #6854 from pixelfed/fix/phpstan-auth-request-scope-3
Larascan: Replace Auth::user() with $request->user()
4 weeks ago
Your Name ffcef3eb2d 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
Shlee 827a56be00
Merge pull request #6861 from pixelfed/tests/critical-path-smoke-tests-clean
Tests/critical path smoke tests clean
4 weeks ago
Your Name 47d98bfb55 revert: restore original GitHub Actions workflow names 4 weeks ago
Your Name a486f509a5 test: add auth scope migration tests and update CI action versions
AuthScope/RequestUserTest: 22 tests verifying all controllers and
middleware that were migrated from Auth::user() to $request->user().
CI: update to checkout@v7, cache@v6
4 weeks ago
Your Name 918e49136a test: add auth scope migration verification tests (390 total, all green)
AuthScope/RequestUserTest: exercises every controller and middleware
that was refactored from Auth::user()/Auth::check() to $request->user().
Covers web routes (follow requests, compose, collections, discover,
profile, status, timeline, newsroom), API routes (verify_credentials,
timelines, notifications, blocks, mutes, favourites, bookmarks), and
middleware (admin, password.confirm, account interstitial).

All 390 tests pass with the auth-scope-3 and passport middleware fixes
applied together.
4 weeks ago
Shlee 71c755a807
Merge pull request #6860 from pixelfed/tests/critical-path-smoke-tests
Tests/critical path smoke tests
4 weeks ago
Your Name b4e9a20af0 Merge remote-tracking branch 'origin/fix/phpstan-auth-request-scope-3' into tests/critical-path-smoke-tests
# Conflicts:
#	app/Http/Controllers/AccountController.php
4 weeks ago
Your Name 9f81a5b425 test: un-skip Passport scope tests now that middleware is fixed
All v1 admin route security tests now pass with proper assertions
after the CheckForAnyScope → CheckTokenForAnyScope fix.
4 weeks ago
Shlee bed4efa77e
Merge pull request #6859 from pixelfed/fix/passport-scope-middleware
fix: replace removed Passport scope middleware with current classes
4 weeks ago
Your Name 0eae871e40 fix: replace removed Passport scope middleware with current classes
Laravel Passport 13 renamed:
- CheckScopes → CheckToken (verifies ALL listed scopes)
- CheckForAnyScope → CheckTokenForAnyScope (verifies ANY listed scope)

The old class names no longer exist, causing BindingResolutionException
on all /api/v1/admin/* routes that use the 'scope' or 'scopes' middleware
aliases.
4 weeks ago
Your Name 7a96cd2e91 fix: replace removed Passport scope middleware with current classes
Laravel Passport 13 renamed:
- CheckScopes → CheckToken (verifies ALL listed scopes)
- CheckForAnyScope → CheckTokenForAnyScope (verifies ANY listed scope)

The old class names no longer exist, causing BindingResolutionException
on all /api/v1/admin/* routes that use the 'scope' or 'scopes' middleware
aliases.
4 weeks ago
Shlee 8078255c2e
Merge pull request #6858 from pixelfed/tests/critical-path-smoke-tests
Tests/critical path smoke tests
4 weeks ago
Your Name 579a581de8 test: add admin access and API scope security tests (360 total)
Security/AdminAccessTest: verifies non-admin users are blocked from
  all admin web routes (dashboard, users, reports, settings, instances,
  curated onboarding) and admin API endpoints.

Security/ApiScopeSecurityTest: verifies read-only tokens cannot write
  (follow, favourite, delete, mute, block), write tokens can read+write,
  cross-user access is denied, and private statuses are protected.

BUG FOUND: CheckForAnyScope middleware (referenced in v1/admin routes)
  was removed in Passport 13. All /api/v1/admin/* routes throw
  BindingResolutionException. 6 tests skipped pending fix.
4 weeks ago
Your Name 0f3820e7bf test: add notification, search, compose, report, and collection tests (332 total)
Api/NotificationTest: notification isolation, correct user filtering
Api/SearchTest: v2 search auth, structure, account lookup
Api/CollectionTest: self/user collections, auth requirement
Compose/ComposeTest: page access, settings, media validation, autocomplete
Account/ReportTest: report creation, type validation, auth requirement
4 weeks ago
Your Name e1f883a41b test: add status, timeline, federation, and privacy tests (309 total)
Api/StatusTest: get/delete statuses, favourite/unfavourite, bookmark,
  status creation validation, ownership checks
Api/TimelineTest: public/home/hashtag timelines, private exclusion,
  pagination support
Federation/NodeInfoTest: nodeinfo, webfinger, host-meta endpoints
Account/PrivacyTest: private profile visibility, blocked user access,
  privacy settings toggle
4 weeks ago
Your Name 891e282808 test: add settings, mute/block, and follow tests (278 total)
Settings/ProfileUpdateTest: profile name, bio, website validation,
  password change flow with Mail::fake assertion
Account/MuteBlockTest: mute/unmute, block/unblock, self-protection,
  admin block protection, validation
Account/FollowTest: follow/unfollow via API, self-follow rejection,
  followers/following list endpoints
4 weeks ago
Shlee 5ea0a1fc13
Merge pull request #6857 from pixelfed/shleeable-patch-1
Update CHANGELOG.md
4 weeks ago
Shlee df99433689
Revise CHANGELOG.md for recent updates
Updated changelog to reflect recent changes and fixes.
4 weeks ago
Shlee f6a3df88d1
Update CHANGELOG.md
Updated changelog to reflect recent refactors and testing improvements.
4 weeks ago
Shlee 25256af551
Merge pull request #6856 from pixelfed/tests/critical-path-smoke-tests
MAJOR TESTING REFACTORING - 250+ Passing Tests
4 weeks ago
Shlee 0f6ed0d918
Rename workflow to PHP - Pint 4 weeks ago
Shlee 2adbb65079
Update php-laravel-tests.yml 4 weeks ago
Shlee b2af987888
Update php-larastan.yml 4 weeks ago
Your Name 0ed3e6192a ci: fix action versions (checkout@v7, cache@v6) and add unstable branch 4 weeks ago
Your Name c7473cd1a8 ci: refactor GitHub Actions with Redis service and best practices
- Tests workflow: add Redis service, cache composer deps, test PHP 8.4+8.5,
  generate Passport keys, use vendor/bin/pest directly
- Larastan workflow: cache deps, consistent checkout@v4, memory limit
- Pint workflow: use project's installed Pint (not global), cache deps
- Standardize Redis port to 6379 across CI and local docker-compose
- Remove 'unstable' branch from triggers (unused)
- Remove 'main' branch from static analysis (doesn't exist)
4 weeks ago
Your Name 18c288f88f chore: add TODO to replace custom FrameGuard with Laravel built-in security headers 4 weeks ago
Your Name 4ce28d9144 feat: add framework integration tests for Laravel 12→13 upgrade readiness
Framework tests verify core Laravel integration points:
- ServiceProviderTest: app boot, guard resolution, route loading, config_cache
- RoutingTest: named routes, duplicates, api/oauth prefixes, middleware groups
- EloquentTest: User/Profile/Status factories, relationships, casts, soft deletes
- QueueTest: job dispatch, serialization, middleware, unique IDs
- ConfigTest: config loading, env overrides, auth/cache/queue settings
- MiddlewarePipelineTest: CSRF, auth, throttle, password confirm, 2FA, admin

Also:
- Add HasFactory trait to Status model
- Fix StatusFactory: remove non-existent 'place' column, add 'rendered' field
- Add Api/AccountTest for account endpoint coverage (254 total tests)
4 weeks ago
Your Name ec8a393020 test: expect oauth endpoints to return 200 (will pass after route syntax fix merge) 4 weeks ago
Your Name 97929f0876 fix: resolve str_ends_with TypeError in RegisterController
PHP's str_ends_with() only accepts a string needle, not an array.
The username validation was passing an array of extensions which
caused a TypeError on every registration attempt.

Replace with a loop over a configurable array of disallowed extensions,
making it easy to add new entries.

Also updates RegisterTest to properly test the registration flow
including the RT anti-bot token and age verification fields.
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
Shlee 0aa0b920fe
Merge pull request #6855 from pixelfed/fix/oauth-route-syntax
fix: convert OAuth routes from legacy array syntax to modern
4 weeks ago
Your Name 76d187edd8 fix: convert OAuth routes from legacy array syntax to modern fluent syntax
The old 'uses' => [Controller::class, 'method'] array format causes a
ReflectionFunction TypeError in Laravel 12 when Livewire's
SupportPageComponents tries to resolve route bindings. The framework's
RouteSignatureParameters::fromAction() expects a Closure or string,
not an array.

Convert all OAuth/Passport routes to the modern fluent syntax:
Route::post('/path', [Controller::class, 'method'])->name('name')
4 weeks ago
Shlee 146af22c52
Merge pull request #6853 from pixelfed/fix/phpstan-auth-request-scope-4
fix: use request() helper for methods without Request parameter
4 weeks ago
Your Name 88e0d92ac2 fix: use request() helper for methods without Request parameter
Methods that are registered as route actions without a Request type-hint
(settings views, export actions) cannot accept Request $request without
breaking Laravel's route signature reflection. Use the request() helper
instead to avoid ReflectionFunction TypeError.
4 weeks ago
Your Name 458150e06b 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
Shlee f7126ae5ba
Merge pull request #6852 from pixelfed/revert/phpstan-auth-scope
Revert
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
Shlee ce4baf6995
Merge pull request #6851 from pixelfed/fix/phpstan-auth-request-scope-2
fix: replace Auth facade with $request->user() in request-scoped classes
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
Shlee 9235cb979a
Merge pull request #6850 from pixelfed/fix/phpstan-model-relations
fix: add return type declarations to Eloquent relation methods
4 weeks ago
Your Name f2159197e8 fix: add return type declarations to Eloquent relation methods
Larastan 3.x requires explicit return types on relation methods to
verify relation existence when using with(), has(), etc. This adds
the appropriate return type declarations to all relation methods
flagged by the larastan.relationExistence rule.

Models fixed:
- Profile (avatar, statuses)
- User (profile)
- Status (profile, media, hashtags)
- DirectMessage (status, author, recipient)
- Report (reporter, status, reportedUser)
- Like (actor, status)
- Media (status)
- Notification (item)
- HashtagFollow (hashtag)
- OauthClient (user)
- Story (profile)
- StatusHashtag (status, hashtag, profile, media)
- AccountInterstitial (user)
- Hashtag (posts)
- CustomFilter (keywords)
- CustomFilterKeyword (customFilter)
- AdminShadowFilter (profile)
- ImportPost (status)
4 weeks ago
Shlee baa7774378
Merge pull request #6849 from pixelfed/fix/groups-post-undefined-status
fix: resolve undefined $status variable in GroupsPostController
4 weeks ago
Your Name e7ef58969c fix: resolve undefined $status variable in GroupsPostController::deletePost
Replace all references to non-existent $status with $gp (the GroupPost
instance already in scope). This was a bug where the closure variable
name was changed but references inside the method body were not updated.
4 weeks ago
Shlee fe9eae770e
Merge pull request #6848 from pixelfed/larascan
fix: replace backslash-prefixed facade calls with imported references
4 weeks ago