-
Notifications
You must be signed in to change notification settings - Fork 312
[engage-messaging-twilio] Validate twilioHostname against Twilio domain (SECOPS-25241) #3907
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
| /* eslint-disable @typescript-eslint/no-unsafe-call */ | ||
| import { TwilioMessageSender } from '../utils' | ||
| import { TwilioMessageSender, validateTwilioHostname } from '../utils' | ||
| import { ExtId, track } from '@segment/actions-shared' | ||
| import type { Payload as PushPayload } from './generated-types' | ||
| import { ContentTemplateTypes } from '../utils/types' | ||
|
|
@@ -31,7 +31,9 @@ export class PushSender extends TwilioMessageSender<PushPayload> { | |
| private DEFAULT_HOSTNAME = 'push.ashburn.us1.twilio.com' | ||
|
|
||
| get twilioHostname() { | ||
| return this.settings.twilioHostname?.length ? this.settings.twilioHostname : this.DEFAULT_HOSTNAME | ||
| return validateTwilioHostname( | ||
| this.settings.twilioHostname?.length ? this.settings.twilioHostname : this.DEFAULT_HOSTNAME | ||
| ) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note 🔵 LOW: Empty-string twilioHostname handled inconsistently across the three sites [Found by 2/3 passes] PushSender uses Suggestion: If normalizing later: resolve the host uniformly across all three sites, e.g. |
||
| } | ||
| get twilioToken() { | ||
| //TODO cache this (lazy load) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.