feat: add bird_verify SMS OTP provider - #2685
Draft
cxbitz wants to merge 1 commit into
Draft
Conversation
Bird Verify is a managed OTP service: it generates the passcode, delivers
it, and checks it, so Auth delegates verification instead of storing a
token. The provider follows twilio_verify, which works the same way. Both
the sms and whatsapp channels are supported, and the requested channel is
pinned per request so a request for SMS is not delivered over WhatsApp by
the workspace's configured channel order.
The verification endpoints were reached through concrete
*TwilioVerifyProvider type assertions, so verify.go and reauthenticate.go
now call VerifyOTP through the SmsProvider interface, and the
twilio_verify checks become IsVerifyServiceProvider.
Error responses carry a remediation string and a request id alongside the
code, so the error type surfaces them when present rather than mapping
codes locally, and implements error so callers can inspect it.
Configure with GOTRUE_SMS_PROVIDER=bird_verify and
GOTRUE_SMS_BIRD_VERIFY_API_KEY. The API host is derived from the key's
bk_{region}_ prefix; GOTRUE_SMS_BIRD_VERIFY_REGION and
GOTRUE_SMS_BIRD_VERIFY_API_URL override it.
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.
Adds
bird_verify, which delivers phone OTPs through Bird Verify. Verify generates the passcode, delivers it, and checks it, so this is a verify-service provider liketwilio_verifyrather than a raw sender. It sends from Bird's managed sender pool, so it works on a brand-new account with nothing provisioned, and it covers both SMS and WhatsApp with the channel Auth asks for passed through per request.It is separate from the existing
messagebirdprovider because the models are incompatible: a plain sender delivers the code Auth generated and stored, while Verify generates its own, so one cannot be expressed as the other. That needs one additive change outside the new file. The verification paths reached the provider through a concrete*TwilioVerifyProvidertype assertion, which no second verify-service provider can satisfy, soverify.goandreauthenticate.gonow callVerifyOTPthrough theSmsProviderinterface and the config checks becomeIsVerifyServiceProvider.IsTwilioVerifyProvideris left in place.