-
Notifications
You must be signed in to change notification settings - Fork 66
Feat: Customizable SMS mock #98
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
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant MockSMS
participant RequestHandler
Caller->>MockSMS: setEndpoint(newUrl)
Caller->>MockSMS: process(smsData)
MockSMS->>RequestHandler: request($url, smsData)
RequestHandler-->>MockSMS: response
MockSMS-->>Caller: result
Poem
✨ 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
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (1)
src/Utopia/Messaging/Adapter/SMS/Mock.php (1)
35-39: Consider adding URL validation for improved security and reliability.While the fluent interface implementation is good, the lack of URL validation could lead to runtime errors or security concerns.
Consider adding basic URL validation:
public function setEndpoint(string $url): self { + if (!filter_var($url, FILTER_VALIDATE_URL)) { + throw new \InvalidArgumentException('Invalid URL provided'); + } $this->url = $url; return $this; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Utopia/Messaging/Adapter/SMS/Mock.php(3 hunks)
🔇 Additional comments (3)
src/Utopia/Messaging/Adapter/SMS/Mock.php (3)
13-13: LGTM! Good encapsulation with backward compatibility.The protected property with a sensible default value maintains backward compatibility while enabling customization.
30-33: LGTM! Clean getter implementation.The method follows standard getter patterns with proper typing and clear naming.
59-59: Excellent! This change enables the core functionality.The modification correctly uses the configurable URL property, achieving the PR objective of making the SMS mock endpoint customizable.
What does this PR do?
adds methods to customize sms mock endpoint, to allow to point to different containers, for example splitting sms mock and webhooks mock
Test Plan
PR in Appwrite
Related PRs and Issues
appwrite/appwrite#10066
Have you read the Contributing Guidelines on issues?
Yes
Summary by CodeRabbit