apihandlers

package
v0.0.0-...-08cdbde Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 35 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
	MAX_PHONE_NUMBER_VERIFICATION_REQUEST_PER_24H = 10
)
View Source
const (
	// MAX_PARTICIPANT_FILE_SIZE is the maximum allowed file size for participant file uploads (20 MB)
	MAX_PARTICIPANT_FILE_SIZE = 20 * 1024 * 1024 // 20 MB in bytes
)

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 MergeVirtualParticipantRequest

type MergeVirtualParticipantRequest struct {
	ProfileID            string `json:"profileID"`
	VirtualParticipantID string `json:"virtualParticipantID"`
	LinkingCodeKey       string `json:"linkingCodeKey"`
	LinkingCodeValue     string `json:"linkingCodeValue"`
}

requires profile id, virtual participant id, linking code key, linking code value

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"`
	WithAttributes    *struct {
		Type       string         `json:"type"`
		Attributes map[string]any `json:"attributes"`
	} `json:"withAttributes"`
}

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 UserAttributeReqPayload

type UserAttributeReqPayload struct {
	Type       string         `json:"type"`
	Attributes map[string]any `json:"attributes"`
}

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