Package com.irurueta.authserver.authorization.infrastructure.sms
package com.irurueta.authserver.authorization.infrastructure.sms
SMS adapter of the authorization server: the logging default sender with its bounded outbox, the Twilio and Amazon
SNS gateways (each enabled by its own profile) and the libphonenumber normaliser.
-
ClassDescription
PhoneCountryResolverover libphonenumber: the region of an E.164 number.PhoneNormalizerbacked by Google libphonenumber: accepts only valid numbers and never throws.Stops the startup when no SMS gateway is configured: none of the profiles that provide anSmsSender(twilio,sns, ordev/testfor the logging one) is active.A text message recorded by theSmsOutbox.Wires the phone normaliser and the loggingSmsSenderof development and tests.Bounded, thread-safe, in-memory record of the messages theLoggingSmsSender"sent", so the development inbox can show them, which reads it through the domain portSmsInbox.Settings of theSmsOutbox.Wires the Amazon SNS sender when thesnsprofile is active.SmsSenderthat publishes directly to a phone number through Amazon SNS.Wires the Twilio sender when thetwilioprofile is active (and SNS is not, so that never twoSmsSenderbeans exist).Thin wrapper over the Twilio SDK, so the sender can be unit-tested with a mock.Twilio credentials and sender, bound from the environment variablesAUTHSERVER_SMS_TWILIO_*only; no value is ever written in a file of this repository.SmsSenderthat sends through Twilio.