fix: route the Messagebird provider to Bird API for bk_ keys - #2684
Draft
cxbitz wants to merge 1 commit into
Draft
fix: route the Messagebird provider to Bird API for bk_ keys#2684cxbitz wants to merge 1 commit into
cxbitz wants to merge 1 commit into
Conversation
MessageBird is now Bird, and accounts created on the new platform are
issued bk_{region}_ keys for an API the provider does not speak: it posts
form-encoded to rest.messagebird.com with AccessKey auth, which those keys
are not valid for, so phone auth never sends for them (supabase#1830).
The access key now decides the API. A bk_{region}_ key is routed to
https://{region}.platform.bird.com/v1/sms/messages with bearer auth and a
JSON body; the region comes from the key, so no new configuration is
needed. Anything else keeps the legacy path byte for byte, so existing
accounts are untouched.
Bird requires a sender the workspace owns or has registered, which a new
workspace has neither of, so the originator becomes optional for a Bird
key: unset, the send uses Bird's stocked one-time-passcode template, which
selects a sender for the destination; set, it sends the configured
SMS_TEMPLATE text from that sender. Auth generates and verifies the code
in both cases, so this stays a plain sender and the OTP lifecycle is
unchanged.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1830
MessageBird is now Bird, and accounts created on the new platform are issued
bk_{region}_...keys. The provider posts form-encoded torest.messagebird.comwithAccessKeyauth, which those keys are not valid for, so the legacy API answers401and phone auth silently never sends. #1554 hit the same thing earlier.The fix routes on the key. A
bk_{region}_key goes to Bird's platform API, with the region read from the key itself; anything else keeps the legacy path unchanged, so existing accounts are untouched.