-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: origin validation for web extensions #10107
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
Conversation
📝 WalkthroughWalkthroughThe changes add four new scheme constants to the Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used🧬 Code Graph Analysis (1)tests/unit/Network/Validators/OriginTest.php (2)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Appwrite/Network/Platform.php
(2 hunks)src/Appwrite/Network/Validator/Origin.php
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/Appwrite/Network/Validator/Origin.php (1)
src/Appwrite/Network/Platform.php (1)
Platform
(5-159)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Setup & Build Appwrite Image
- GitHub Check: Setup & Build Appwrite Image
- GitHub Check: Linter
- GitHub Check: scan
🔇 Additional comments (2)
src/Appwrite/Network/Platform.php (1)
52-55
: User-friendly names follow good naming conventions.The platform names are descriptive and consistent with the existing naming pattern in the
$names
array.src/Appwrite/Network/Validator/Origin.php (1)
45-53
: Excellent approach to centralize web platform scheme validation.The refactoring to use a
$webPlatforms
array is a good design choice that:
- Centralizes the list of schemes requiring hostname validation
- Makes the code more maintainable and readable
- Properly extends validation to browser extension schemes
- Fixes the core issue described in the PR objectives
This change should resolve the "Invalid Origin" error for web extensions by ensuring they go through the same hostname validation as HTTP/HTTPS origins.
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
✨ Benchmark results
⚡ Benchmark Comparison
|
ca52771
to
9dcb806
Compare
What does this PR do?
To fix the error:
Test Plan
Related PRs and Issues
Checklist