apihandlers

package
v0.0.0-...-ef6e83c Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_STUDY_SECRET_KEY_LENGTH = 5
)

Variables

This section is empty.

Functions

func HealthCheckHandle

func HealthCheckHandle(c *gin.Context)

Types

type AddStudyCodeListEntriesRequest

type AddStudyCodeListEntriesRequest struct {
	ListKey string   `json:"listKey"`
	Codes   []string `json:"codes"`
}

type AddStudyVariableRequest

type AddStudyVariableRequest struct {
	VariableDef studyTypes.StudyVariables `json:"variableDef"`
}

type AppRoleTemplateProps

type AppRoleTemplateProps struct {
	AppName             string               `json:"appName"`
	Role                string               `json:"role"`
	RequiredPermissions []mUserDB.Permission `json:"requiredPermissions"`
}

type ConfidentialResponsesExportQuery

type ConfidentialResponsesExportQuery struct {
	ParticipantIDs []string `json:"participantIDs"`
	KeyFilter      string   `json:"keyFilter"`
}

type ExtendSessionRequest

type ExtendSessionRequest struct {
	RenewToken string `json:"renewToken"`
}

ExtendSessionRequest is the request body for the extend-session endpoint

type FileUploadRuleUpdateReq

type FileUploadRuleUpdateReq struct {
	SimplifiedAllow bool                   `json:"simplifiedAllowedUpload"`
	Expression      *studyTypes.Expression `json:"expression,omitempty"`
}

type HttpEndpoints

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

func NewHTTPHandler

func NewHTTPHandler(
	tokenSignKey string,
	tokenExpiresIn time.Duration,
	muDBConn *muDB.ManagementUserDBService,
	messagingDBConn *messagingDB.MessagingDBService,
	studyDBConn *studyDB.StudyDBService,
	participantUserDB *userDB.ParticipantUserDBService,
	globalInfosDBConn *globalinfosDB.GlobalInfosDBService,
	allowedInstanceIDs []string,
	globalStudySecret string,
	filestorePath string,
	dailyFileExportPath string,
) *HttpEndpoints

func (*HttpEndpoints) AddManagementAuthAPI

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

func (*HttpEndpoints) AddMessagingServiceAPI

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

func (*HttpEndpoints) AddStudyManagementAPI

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

func (*HttpEndpoints) AddUserManagementAPI

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

func (*HttpEndpoints) SaveScheduledEmail

func (h *HttpEndpoints) SaveScheduledEmail(c *gin.Context)

type MergeParticipantsRequest

type MergeParticipantsRequest struct {
	TargetParticipantID string `json:"targetParticipantID"`
	WithParticipantID   string `json:"withParticipantID"`
}

type NewStudyReq

type NewStudyReq struct {
	StudyKey             string `json:"studyKey"`
	SecretKey            string `json:"secretKey"`
	IsSystemDefaultStudy bool   `json:"isSystemDefaultStudy"`
}

type NotificationSubscriptionsUpdateReq

type NotificationSubscriptionsUpdateReq struct {
	Subscriptions []studyTypes.NotificationSubscription `json:"subscriptions"`
}

type ParticipantEventRequest

type ParticipantEventRequest struct {
	EventKey string         `json:"eventKey"`
	Payload  map[string]any `json:"payload"`
}

type RequiredPermission

type RequiredPermission struct {
	ResourceType        string
	ResourceKeys        []string
	ExtractResourceKeys func(c *gin.Context) []string // from route params, query params, etc.
	Action              string
}

type ServiceAccountAPIKeyRequest

type ServiceAccountAPIKeyRequest struct {
	ExpiresAt int64 `json:"expiresAt,omitempty"`
}

type ServiceUserProps

type ServiceUserProps struct {
	Label       string `json:"label"`
	Description string `json:"description"`
}

type SignInRequest

type SignInRequest struct {
	Sub        string   `json:"sub"`
	Roles      []string `json:"roles"`
	Name       string   `json:"name"`
	Provider   string   `json:"provider"`
	Email      string   `json:"email"`
	ImageURL   string   `json:"imageUrl"`
	RenewToken string   `json:"renewToken"`
	InstanceID string   `json:"instanceId"`
}

SignInRequest is the request body for the signin-with-idp endpoint

type StudyDisplayPropsUpdateReq

type StudyDisplayPropsUpdateReq struct {
	Name        []studyTypes.LocalisedObject `bson:"name" json:"name"`
	Description []studyTypes.LocalisedObject `bson:"description" json:"description"`
	Tags        []studyTypes.Tag             `bson:"tags" json:"tags"`
}

type StudyIsDefaultUpdateReq

type StudyIsDefaultUpdateReq struct {
	IsDefault bool `json:"isDefault"`
}

type StudyStatusUpdateReq

type StudyStatusUpdateReq struct {
	Status string `json:"status"`
}

type StudyUserPermissionInfo

type StudyUserPermissionInfo struct {
	User        *managementuser.ManagementUser `json:"user"`
	Permissions []managementuser.Permission    `json:"permissions"`
}

type SurveyInfo

type SurveyInfo struct {
	Key string `json:"key"`
}

type UpdateParticipantReportRequest

type UpdateParticipantReportRequest struct {
	Data []studyTypes.ReportData             `json:"data"`
	Mode dbStudy.UpdateParticipantReportMode `json:"mode"`
}

type UpdateStudyVariableDefRequest

type UpdateStudyVariableDefRequest struct {
	VariableDef studyTypes.StudyVariables `json:"variableDef"` // ignore value and key fields
}

type UpdateStudyVariableValueRequest

type UpdateStudyVariableValueRequest struct {
	Variable studyTypes.StudyVariables `json:"variable"` // only value is updated
}

Jump to

Keyboard shortcuts

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