validation

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2018 License: BSD-3-Clause Imports: 10 Imported by: 3

README

Validation services

This package contains validation services implemented by itsyou.online itself.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrInvalidCode denotes that the supplied code is invalid
	ErrInvalidCode = errors.New("Invalid code")
	//ErrInvalidOrExpiredKey denotes that the key is not found, it can be invalid or expired
	ErrInvalidOrExpiredKey = errors.New("Invalid key")
)

Functions

This section is empty.

Types

type EmailService

type EmailService interface {
	Send(recipients []string, subject string, message string) (err error)
}

EmailService is the interface for an email communication channel, should be used by the IYOEmailAddressValidationService

type EmailWithButtonTemplateParams

type EmailWithButtonTemplateParams struct {
	UrlCaption string
	Url        string
	Username   string
	Title      string
	Text       string
	ButtonText string
	Reason     string
	LogoUrl    string
}

type IYOEmailAddressValidationService

type IYOEmailAddressValidationService struct {
	EmailService EmailService
}

IYOEmailAddressValidationService is the itsyou.online implementation of a EmailAddressValidationService

func (*IYOEmailAddressValidationService) ConfirmRegistrationValidation added in v1.0.0

func (service *IYOEmailAddressValidationService) ConfirmRegistrationValidation(r *http.Request, key, secret string) (err error)

ConfirmRegistrationValidation checks if the supplied code matches the username and key. It does not add an entry in the validated email addresses collection

func (*IYOEmailAddressValidationService) ConfirmValidation

func (service *IYOEmailAddressValidationService) ConfirmValidation(request *http.Request, key, secret string) (err error)

ConfirmValidation checks if the supplied code matches the username and key

func (*IYOEmailAddressValidationService) ExpireValidation

func (service *IYOEmailAddressValidationService) ExpireValidation(request *http.Request, key string) (err error)

ExpireValidation removes a pending validation

func (*IYOEmailAddressValidationService) IsConfirmed

func (service *IYOEmailAddressValidationService) IsConfirmed(request *http.Request, key string) (confirmed bool, err error)

IsConfirmed checks wether a validation request is already confirmed

func (*IYOEmailAddressValidationService) RequestPasswordReset

func (service *IYOEmailAddressValidationService) RequestPasswordReset(request *http.Request, username string, emails []string, langKey string) (key string, err error)

RequestPasswordReset Request a password reset

func (*IYOEmailAddressValidationService) RequestValidation

func (service *IYOEmailAddressValidationService) RequestValidation(request *http.Request, username string, email string, confirmationurl string, langKey string) (key string, err error)

RequestValidation validates the email address by sending an email

func (*IYOEmailAddressValidationService) SendOrganizationInviteEmail

func (service *IYOEmailAddressValidationService) SendOrganizationInviteEmail(request *http.Request, invite *invitations.JoinOrganizationInvitation) (err error)

SendOrganizationInviteEmail Sends an organization invite email

type IYOPhonenumberValidationService

type IYOPhonenumberValidationService struct {
	SMSService SMSService
}

IYOPhonenumberValidationService is the itsyou.online implementation of a PhonenumberValidationService

func (*IYOPhonenumberValidationService) ConfirmRegistrationValidation added in v1.0.0

func (service *IYOPhonenumberValidationService) ConfirmRegistrationValidation(r *http.Request, key, code string) (err error)

ConfirmRegistrationValidation confirms a validation in the registartion flow. It does not add an entry in the validated phone numbers collection

func (*IYOPhonenumberValidationService) ConfirmValidation

func (service *IYOPhonenumberValidationService) ConfirmValidation(request *http.Request, key, code string) (err error)

ConfirmValidation checks if the supplied code matches the username and key

func (*IYOPhonenumberValidationService) ExpireValidation

func (service *IYOPhonenumberValidationService) ExpireValidation(request *http.Request, key string) (err error)

ExpireValidation removes a pending validation

func (*IYOPhonenumberValidationService) IsConfirmed

func (service *IYOPhonenumberValidationService) IsConfirmed(request *http.Request, key string) (confirmed bool, err error)

IsConfirmed checks wether a validation request is already confirmed

func (*IYOPhonenumberValidationService) RequestValidation

func (service *IYOPhonenumberValidationService) RequestValidation(request *http.Request, username string, phonenumber user.Phonenumber, confirmationurl string, langKey string) (key string, err error)

RequestValidation validates the phonenumber by sending an SMS

func (*IYOPhonenumberValidationService) SendOrganizationInviteSms

func (service *IYOPhonenumberValidationService) SendOrganizationInviteSms(request *http.Request, invite *invitations.JoinOrganizationInvitation) (err error)

SendOrganizationInviteSms Sends an organization invite SMS

type SMSService

type SMSService interface {
	Send(phonenumber string, message string) (err error)
}

SMSService is the interface an sms communication channel should have to be used by the IYOPhonenumberValidationService

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL