apihandlers

package
v0.0.0-...-45ce995 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PASSWWORD_RESET_MAX_ATTEMPTS = 5

	PASSWORD_RESET_TOKEN_TTL = 24 * time.Hour
)
View Source
const (
	MAX_PROFILES_ALLOWED = 6
)

Variables

This section is empty.

Functions

func HealthCheckHandle

func HealthCheckHandle(c *gin.Context)

Types

type HttpEndpoints

type HttpEndpoints struct {
	// contains filtered or unexported fields
}

func NewHTTPHandler

func NewHTTPHandler(
	tokenSignKey string,
	studyDBConn *studyDB.StudyDBService,
	userDBConn *userDB.ParticipantUserDBService,
	globalInfosDBConn *globalinfosDB.GlobalInfosDBService,
	messagingDBConn *messagingDB.MessagingDBService,
	allowedInstanceIDs []string,
	globalStudySecret string,
	filestorePath string,
	maxNewUsersPer5Minute int,
	ttls TTLs,
) *HttpEndpoints

func (*HttpEndpoints) AddParticipantAuthAPI

func (h *HttpEndpoints) AddParticipantAuthAPI(rg *gin.RouterGroup)

func (*HttpEndpoints) AddPasswordResetAPI

func (h *HttpEndpoints) AddPasswordResetAPI(rg *gin.RouterGroup)

func (*HttpEndpoints) AddStudyServiceAPI

func (h *HttpEndpoints) AddStudyServiceAPI(rg *gin.RouterGroup)

func (*HttpEndpoints) AddUserManagementAPI

func (h *HttpEndpoints) AddUserManagementAPI(rg *gin.RouterGroup)

type LoginWithEmailReq

type LoginWithEmailReq struct {
	Email      string `json:"email"`
	Password   string `json:"password"`
	InstanceID string `json:"instanceId"`
}

type RefreshTokenReq

type RefreshTokenReq struct {
	RefreshToken string `json:"refreshToken"`
}

type SignupWithEmailReq

type SignupWithEmailReq struct {
	Email             string `json:"email"`
	Password          string `json:"password"`
	InstanceID        string `json:"instanceId"`
	InfoCheck         string `json:"infoCheck"`
	PreferredLanguage string `json:"preferredLanguage"`
}

type StudyInfo

type StudyInfo struct {
	Key        string                `json:"key"`
	Status     string                `json:"status"`
	Props      studyTypes.StudyProps `json:"props"`
	Stats      studyTypes.StudyStats `json:"stats"`
	ProfileIds []string              `json:"profileIds"`
}

type TTLs

type TTLs struct {
	AccessToken                   time.Duration
	EmailContactVerificationToken time.Duration
}

type VerifyOTPReq

type VerifyOTPReq struct {
	Code string `json:"code"`
}

Jump to

Keyboard shortcuts

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