Commit Graph

12763 Commits (ea2d054a405d6d6f09c383394e940a5c48c85973)
 

Author SHA1 Message Date
Your Name ea2d054a40 Revert "fix: remove dead publicApi/homeApi methods from TimelineController"
This reverts commit 8cf5321566.
1 month ago
Your Name 8cf5321566 fix: remove dead publicApi/homeApi methods from TimelineController
- publicApi referenced non-existent StatusTimelineTransformer class
- Neither method is routed anywhere
- Removes unused imports (Fractal, Cache, Status, Profile, UserFilter)
1 month ago
Your Name 7042ea5367 fix: remove dead RemoteFollowPipeline (references uninstalled HttpSignatures package)
- Delete app/Jobs/RemoteFollowPipeline/RemoteFollowPipeline.php
- Delete app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php
- Neither job is dispatched anywhere in the codebase
- Remote follow is handled by ActivityPub Inbox and FollowPipeline
1 month ago
Shlee eb8806f37d
Merge pull request #6867 from pixelfed/fix/passport-v13-cleanup
fix: remove deprecated Passport::personalAccessClientId()
1 month ago
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
1 month ago
Shlee 190e7da6e1
Merge pull request #6866 from pixelfed/tests/critical-path-smoke-tests
Tests/critical path smoke tests
1 month 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
1 month ago
Shlee 6dd0604133
Merge pull request #6865 from pixelfed/shleeable-patch-1
Update AccountController.php
1 month ago
Shlee 3c6280111e
Update AccountController.php 1 month ago
Shlee 8778273c7c
Merge pull request #6854 from pixelfed/fix/phpstan-auth-request-scope-3
Larascan: Replace Auth::user() with $request->user()
1 month 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.
1 month ago
Shlee 827a56be00
Merge pull request #6861 from pixelfed/tests/critical-path-smoke-tests-clean
Tests/critical path smoke tests clean
1 month ago
Your Name 47d98bfb55 revert: restore original GitHub Actions workflow names 1 month 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
1 month 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.
1 month ago
Shlee 71c755a807
Merge pull request #6860 from pixelfed/tests/critical-path-smoke-tests
Tests/critical path smoke tests
1 month 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
1 month 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.
1 month ago
Shlee bed4efa77e
Merge pull request #6859 from pixelfed/fix/passport-scope-middleware
fix: replace removed Passport scope middleware with current classes
1 month 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.
1 month 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.
1 month ago
Shlee 8078255c2e
Merge pull request #6858 from pixelfed/tests/critical-path-smoke-tests
Tests/critical path smoke tests
1 month 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.
1 month 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
1 month 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
1 month 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
1 month ago
Shlee 5ea0a1fc13
Merge pull request #6857 from pixelfed/shleeable-patch-1
Update CHANGELOG.md
1 month ago
Shlee df99433689
Revise CHANGELOG.md for recent updates
Updated changelog to reflect recent changes and fixes.
1 month ago
Shlee f6a3df88d1
Update CHANGELOG.md
Updated changelog to reflect recent refactors and testing improvements.
1 month ago
Shlee 25256af551
Merge pull request #6856 from pixelfed/tests/critical-path-smoke-tests
MAJOR TESTING REFACTORING - 250+ Passing Tests
1 month ago
Shlee 0f6ed0d918
Rename workflow to PHP - Pint 1 month ago
Shlee 2adbb65079
Update php-laravel-tests.yml 1 month ago
Shlee b2af987888
Update php-larastan.yml 1 month ago
Your Name 0ed3e6192a ci: fix action versions (checkout@v7, cache@v6) and add unstable branch 1 month 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)
1 month ago
Your Name 18c288f88f chore: add TODO to replace custom FrameGuard with Laravel built-in security headers 1 month 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)
1 month ago
Your Name ec8a393020 test: expect oauth endpoints to return 200 (will pass after route syntax fix merge) 1 month 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.
1 month 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
1 month ago
Shlee 0aa0b920fe
Merge pull request #6855 from pixelfed/fix/oauth-route-syntax
fix: convert OAuth routes from legacy array syntax to modern
1 month 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')
1 month ago
Shlee 146af22c52
Merge pull request #6853 from pixelfed/fix/phpstan-auth-request-scope-4
fix: use request() helper for methods without Request parameter
1 month 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.
1 month 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.
1 month ago
Shlee f7126ae5ba
Merge pull request #6852 from pixelfed/revert/phpstan-auth-scope
Revert
1 month 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.
1 month 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
1 month 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.
1 month ago
Shlee 9235cb979a
Merge pull request #6850 from pixelfed/fix/phpstan-model-relations
fix: add return type declarations to Eloquent relation methods
1 month ago