-
Notifications
You must be signed in to change notification settings - Fork 0
π Password Reset Feature (Production Test Phase 1) #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2ea1363
feat: implement password reset with TDD and security best practices
kevalyq c07a81a
refactor: convert password reset tests to Pest syntax
kevalyq fa2c87a
fix: address Copilot review comments
kevalyq dd95b61
refactor: extract validation into Form Request classes
kevalyq 6921320
docs: add comprehensive self-review checklist
kevalyq a23f098
fix: markdownlint issues in self-review checklist
kevalyq 1273373
fix: add PHPStan type annotation for Form Request validated data
kevalyq 612a177
refactor: address Copilot nitpick comments
kevalyq 939fa97
fix: remove whitespace in blank lines (Pint)
kevalyq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <?php | ||
|
|
||
| // SPDX-FileCopyrightText: 2025 SecPal Contributors | ||
| // SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
|
||
| namespace App\Http\Requests; | ||
|
|
||
| use Illuminate\Foundation\Http\FormRequest; | ||
|
|
||
| class PasswordResetRequest extends FormRequest | ||
| { | ||
| /** | ||
| * Determine if the user is authorized to make this request. | ||
| */ | ||
| public function authorize(): bool | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| /** | ||
| * Get the validation rules that apply to the request. | ||
| * | ||
| * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | ||
| */ | ||
| public function rules(): array | ||
| { | ||
| return [ | ||
| 'token' => ['required', 'string'], | ||
| 'email' => ['required', 'email'], | ||
| 'password' => ['required', 'string', 'min:8', 'confirmed'], | ||
kevalyq marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ]; | ||
| } | ||
|
|
||
| /** | ||
| * Get custom validation error messages. | ||
| * | ||
| * @return array<string, string> | ||
| */ | ||
| public function messages(): array | ||
| { | ||
| return [ | ||
| 'token.required' => 'Reset token is required.', | ||
| 'email.required' => 'Email address is required.', | ||
| 'email.email' => 'Please provide a valid email address.', | ||
| 'password.required' => 'Password is required.', | ||
| 'password.min' => 'Password must be at least 8 characters.', | ||
| 'password.confirmed' => 'Password confirmation does not match.', | ||
| ]; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <?php | ||
|
|
||
| // SPDX-FileCopyrightText: 2025 SecPal Contributors | ||
| // SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
|
||
| namespace App\Http\Requests; | ||
|
|
||
| use Illuminate\Foundation\Http\FormRequest; | ||
|
|
||
| class PasswordResetRequestRequest extends FormRequest | ||
| { | ||
| /** | ||
| * Determine if the user is authorized to make this request. | ||
| */ | ||
| public function authorize(): bool | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| /** | ||
| * Get the validation rules that apply to the request. | ||
| * | ||
| * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | ||
| */ | ||
| public function rules(): array | ||
| { | ||
| return [ | ||
| 'email' => ['required', 'email'], | ||
kevalyq marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ]; | ||
| } | ||
|
|
||
| /** | ||
| * Get custom validation error messages. | ||
| * | ||
| * @return array<string, string> | ||
| */ | ||
| public function messages(): array | ||
| { | ||
| return [ | ||
| 'email.required' => 'Email address is required.', | ||
| 'email.email' => 'Please provide a valid email address.', | ||
| ]; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,5 @@ | ||
| { | ||
| "agents": ["copilot"], | ||
| "editors": ["vscode"], | ||
| "guidelines": [ | ||
| { | ||
| "title": "SecPal Project Guidelines", | ||
| "rules": [ | ||
| "This is the SecPal API - a security-focused personal data management system", | ||
| "All PRs must be < 400 lines for effective review (see DEVELOPMENT.md)", | ||
| "Use incremental development: Foundation β Business Logic β API β Security", | ||
| "Always run ddev exec php artisan boost:update after major changes", | ||
| "Security is paramount - all PII must be encrypted at rest", | ||
| "Follow REUSE SPDX license compliance for all files", | ||
| "Use conventional commits format for all commit messages", | ||
| "English only for code, comments, and GitHub communication", | ||
| "All database operations must go through DDEV (PostgreSQL 15+)", | ||
| "PHPStan level max with baseline - no new errors allowed", | ||
| "Use Laravel Pint for code formatting (automatic via pre-commit)", | ||
| "Prefer feature tests over unit tests unless testing isolated logic", | ||
| "Use PEST test framework, not PHPUnit directly" | ||
| ] | ||
| }, | ||
| { | ||
| "title": "Architecture Decisions", | ||
| "rules": [ | ||
| "Repository pattern for all database access", | ||
| "API-only application (no Blade views)", | ||
| "RESTful API design with Laravel Sanctum authentication", | ||
| "Use Spatie Laravel Permission for role-based access control", | ||
| "Tenant isolation enforced via middleware", | ||
| "Use UUIDs for all public-facing identifiers", | ||
| "All migrations must be idempotent and reversible" | ||
| ] | ||
| }, | ||
| { | ||
| "title": "Development Workflow", | ||
| "rules": [ | ||
| "Always create feature branches from main", | ||
| "Run tests before pushing: ddev exec ./vendor/bin/pest", | ||
| "Pre-commit hooks run automatically (Pint, PHPStan, REUSE)", | ||
| "Update Boost after structural changes", | ||
| "Keep PRs focused - one feature/fix per PR", | ||
| "Request review before merging to main", | ||
| "If overwhelmed, reset and start fresh rather than accumulating complexity" | ||
| ] | ||
| } | ||
| ] | ||
| "agents": ["copilot"], | ||
| "editors": ["vscode"], | ||
| "guidelines": [] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.