Documentation ¶
Index ¶
Constants ¶
View Source
const ( ApiGetPublicKeysUrl = "https://verifiedsms.googleapis.com/v1/enabledUserKeys:batchGet" ApiSubmitHashesUrl = "https://verifiedsms.googleapis.com/v1/messages:batchCreate" ContentTypeHeader = "application/json" UserAgentHeader = "monzo/verifiedsms" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { // The ID of the Verified SMS agent to use ID string // The private key of the Verified SMS agent to use PrivateKey *ecdsa.PrivateKey }
type Partner ¶
type Partner struct { // The JSON keys for a service account that will make requests to create messages and enable user keys as the // Verified SMS partner ServiceAccountJSONFile string }
func (Partner) GetPhoneNumberPublicKeys ¶
func (partner Partner) GetPhoneNumberPublicKeys(ctx context.Context, phoneNumber string) ([]string, error)
GetPhoneNumberPublicKeys gets the public keys for a given phone number from the Verified SMS service and returns them as a slice of strings
func (Partner) MarkSMSAsVerified ¶
func (partner Partner) MarkSMSAsVerified(ctx context.Context, phoneNumber string, agent *Agent, smsMessage string) (bool, error)
MarkSMSAsVerified marks a given SMS as verified for a given end users phone number agent is a VerifiedSMSAgent that the message will appear to be sent from smsMessage is the content of the message to be verified Returns a boolean to indicate whether the SMS was verified, this will be false if there were no errors but the users' device just doesn't support Verified SMS An error will be returned if we couldn't mark the SMS as Verified and we aren't sure whether the user is on Verified SMS
Click to show internal directories.
Click to hide internal directories.