Use request.CTX instead of *request.Context (#24877)
* Use request.CTX instead of *request.Context * Fix tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
37dc35c1a1
Коммит
c7461751f2
@@ -241,7 +241,7 @@ func (a *App) setWarnMetricsStatusForId(rctx request.CTX, warnMetricId string, s
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) RequestLicenseAndAckWarnMetric(c *request.Context, warnMetricId string, isBot bool) *model.AppError {
|
||||
func (a *App) RequestLicenseAndAckWarnMetric(c request.CTX, warnMetricId string, isBot bool) *model.AppError {
|
||||
if *a.Config().ExperimentalSettings.RestrictSystemAdmin {
|
||||
return model.NewAppError("RequestLicenseAndAckWarnMetric", "api.restricted_system_admin", nil, "", http.StatusForbidden)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import (
|
||||
// AppIface is extracted from App struct and contains all it's exported methods. It's provided to allow partial interface passing and app layers creation.
|
||||
type AppIface interface {
|
||||
// @openTracingParams args
|
||||
ExecuteCommand(c *request.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
|
||||
ExecuteCommand(c request.CTX, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
|
||||
// @openTracingParams teamID
|
||||
// previous ListCommands now ListAutocompleteCommands
|
||||
ListAutocompleteCommands(teamID string, T i18n.TranslateFunc) ([]*model.Command, *model.AppError)
|
||||
@@ -74,7 +74,7 @@ type AppIface interface {
|
||||
// CheckProviderAttributes returns the empty string if the patch can be applied without
|
||||
// overriding attributes set by the user's login provider; otherwise, the name of the offending
|
||||
// field is returned.
|
||||
CheckProviderAttributes(c *request.Context, user *model.User, patch *model.UserPatch) string
|
||||
CheckProviderAttributes(c request.CTX, user *model.User, patch *model.UserPatch) string
|
||||
// CommandsForTeam returns all the plugin commands for the given team.
|
||||
CommandsForTeam(teamID string) []*model.Command
|
||||
// ComputeLastAccessibleFileTime updates cache with CreateAt time of the last accessible file as per the cloud plan's limit.
|
||||
@@ -97,7 +97,7 @@ type AppIface interface {
|
||||
// are configured to sync with teams and channels for group members on or after the given timestamp.
|
||||
// If includeRemovedMembers is true, then members who left or were removed from a team/channel will
|
||||
// be re-added; otherwise, they will not be re-added.
|
||||
CreateDefaultMemberships(c *request.Context, params model.CreateDefaultMembershipParams) error
|
||||
CreateDefaultMemberships(c request.CTX, params model.CreateDefaultMembershipParams) error
|
||||
// CreateGuest creates a guest and sets several fields of the returned User struct to
|
||||
// their zero values.
|
||||
CreateGuest(c request.CTX, user *model.User) (*model.User, *model.AppError)
|
||||
@@ -121,14 +121,14 @@ type AppIface interface {
|
||||
DeleteChannelScheme(c request.CTX, channel *model.Channel) (*model.Channel, *model.AppError)
|
||||
// DeleteGroupConstrainedMemberships deletes team and channel memberships of users who aren't members of the allowed
|
||||
// groups of all group-constrained teams and channels.
|
||||
DeleteGroupConstrainedMemberships(c *request.Context) error
|
||||
DeleteGroupConstrainedMemberships(c request.CTX) error
|
||||
// DeletePersistentNotification stops the persistent notifications.
|
||||
DeletePersistentNotification(c request.CTX, post *model.Post) *model.AppError
|
||||
// DeletePublicKey will delete plugin public key from the config.
|
||||
DeletePublicKey(name string) *model.AppError
|
||||
// DemoteUserToGuest Convert user's roles and all his membership's roles from
|
||||
// regular user roles to guest roles.
|
||||
DemoteUserToGuest(c *request.Context, user *model.User) *model.AppError
|
||||
DemoteUserToGuest(c request.CTX, user *model.User) *model.AppError
|
||||
// DisablePlugin will set the config for an installed plugin to disabled, triggering deactivation if active.
|
||||
// Notifies cluster peers through config change.
|
||||
DisablePlugin(id string) *model.AppError
|
||||
@@ -219,7 +219,7 @@ type AppIface interface {
|
||||
// significant digit
|
||||
GetPostsUsage() (int64, *model.AppError)
|
||||
// GetProductNotices is called from the frontend to fetch the product notices that are relevant to the caller
|
||||
GetProductNotices(c *request.Context, userID, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError)
|
||||
GetProductNotices(c request.CTX, userID, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError)
|
||||
// GetPublicKey will return the actual public key saved in the `name` file.
|
||||
GetPublicKey(name string) ([]byte, *model.AppError)
|
||||
// GetSanitizedConfig gets the configuration for a system admin without any secrets.
|
||||
@@ -232,7 +232,7 @@ type AppIface interface {
|
||||
// GetStorageUsage returns the sum of files' sizes stored on this instance
|
||||
GetStorageUsage() (int64, *model.AppError)
|
||||
// GetSuggestions returns suggestions for user input.
|
||||
GetSuggestions(c *request.Context, commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion
|
||||
GetSuggestions(c request.CTX, commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion
|
||||
// GetTeamGroupUsers returns the users who are associated to the team via GroupTeams and GroupMembers.
|
||||
GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError)
|
||||
// GetTeamSchemeChannelRoles Checks if a team has an override scheme and returns the scheme channel role names or default channel role names.
|
||||
@@ -279,7 +279,7 @@ type AppIface interface {
|
||||
// Perform an HTTP POST request to an integration's action endpoint.
|
||||
// Caller must consume and close returned http.Response as necessary.
|
||||
// For internal requests, requests are routed directly to a plugin ServerHTTP hook
|
||||
DoActionRequest(c *request.Context, rawURL string, body []byte) (*http.Response, *model.AppError)
|
||||
DoActionRequest(c request.CTX, rawURL string, body []byte) (*http.Response, *model.AppError)
|
||||
// PermanentDeleteBot permanently deletes a bot and its corresponding user.
|
||||
PermanentDeleteBot(botUserId string) *model.AppError
|
||||
// PopulateWebConnConfig checks if the connection id already exists in the hub,
|
||||
@@ -287,7 +287,7 @@ type AppIface interface {
|
||||
PopulateWebConnConfig(s *model.Session, cfg *platform.WebConnConfig, seqVal string) (*platform.WebConnConfig, error)
|
||||
// PromoteGuestToUser Convert user's roles and all his membership's roles from
|
||||
// guest roles to regular user roles.
|
||||
PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError
|
||||
PromoteGuestToUser(c request.CTX, user *model.User, requestorId string) *model.AppError
|
||||
// Removes a listener function by the unique ID returned when AddConfigListener was called
|
||||
RemoveConfigListener(id string)
|
||||
// RenameChannel is used to rename the channel Name and the DisplayName fields
|
||||
@@ -332,7 +332,7 @@ type AppIface interface {
|
||||
// SyncLdap starts an LDAP sync job.
|
||||
// If includeRemovedMembers is true, then members who left or were removed from a team/channel will
|
||||
// be re-added; otherwise, they will not be re-added.
|
||||
SyncLdap(c *request.Context, includeRemovedMembers bool)
|
||||
SyncLdap(c request.CTX, includeRemovedMembers bool)
|
||||
// SyncPlugins synchronizes the plugins installed locally
|
||||
// with the plugin bundles available in the file store.
|
||||
SyncPlugins() *model.AppError
|
||||
@@ -364,7 +364,7 @@ type AppIface interface {
|
||||
// This to be used for places we check the users password when they are already logged in
|
||||
DoubleCheckPassword(user *model.User, password string) *model.AppError
|
||||
// UpdateBotActive marks a bot as active or inactive, along with its corresponding user.
|
||||
UpdateBotActive(c *request.Context, botUserId string, active bool) (*model.Bot, *model.AppError)
|
||||
UpdateBotActive(c request.CTX, botUserId string, active bool) (*model.Bot, *model.AppError)
|
||||
// UpdateBotOwner changes a bot's owner to the given value.
|
||||
UpdateBotOwner(botUserId, newOwnerId string) (*model.Bot, *model.AppError)
|
||||
// UpdateChannel updates a given channel by its Id. It also publishes the CHANNEL_UPDATED event.
|
||||
@@ -390,7 +390,7 @@ type AppIface interface {
|
||||
// returns a filled-out FileInfo and an optional error. A plugin may reject the
|
||||
// upload, returning a rejection error. In this case FileInfo would have
|
||||
// contained the last "good" FileInfo before the execution of that plugin.
|
||||
UploadFileX(c *request.Context, channelID, name string, input io.Reader, opts ...func(*UploadFileTask)) (*model.FileInfo, *model.AppError)
|
||||
UploadFileX(c request.CTX, channelID, name string, input io.Reader, opts ...func(*UploadFileTask)) (*model.FileInfo, *model.AppError)
|
||||
// UserIsInAdminRoleGroup returns true at least one of the user's groups are configured to set the members as
|
||||
// admins in the given syncable.
|
||||
UserIsInAdminRoleGroup(userID, syncableID string, syncableType model.GroupSyncableType) (bool, *model.AppError)
|
||||
@@ -412,25 +412,25 @@ type AppIface interface {
|
||||
AddSamlPublicCertificate(fileData *multipart.FileHeader) *model.AppError
|
||||
AddSessionToCache(session *model.Session)
|
||||
AddTeamMember(c request.CTX, teamID, userID string) (*model.TeamMember, *model.AppError)
|
||||
AddTeamMemberByInviteId(c *request.Context, inviteId, userID string) (*model.TeamMember, *model.AppError)
|
||||
AddTeamMemberByToken(c *request.Context, userID, tokenID string) (*model.TeamMember, *model.AppError)
|
||||
AddTeamMembers(c *request.Context, teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError)
|
||||
AddTeamMemberByInviteId(c request.CTX, inviteId, userID string) (*model.TeamMember, *model.AppError)
|
||||
AddTeamMemberByToken(c request.CTX, userID, tokenID string) (*model.TeamMember, *model.AppError)
|
||||
AddTeamMembers(c request.CTX, teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError)
|
||||
AddTeamsToRetentionPolicy(policyID string, teamIDs []string) *model.AppError
|
||||
AddUserToTeam(c request.CTX, teamID string, userID string, userRequestorId string) (*model.Team, *model.TeamMember, *model.AppError)
|
||||
AddUserToTeamByInviteId(c *request.Context, inviteId string, userID string) (*model.Team, *model.TeamMember, *model.AppError)
|
||||
AddUserToTeamByTeamId(c *request.Context, teamID string, user *model.User) *model.AppError
|
||||
AddUserToTeamByToken(c *request.Context, userID string, tokenID string) (*model.Team, *model.TeamMember, *model.AppError)
|
||||
AddUserToTeamByInviteId(c request.CTX, inviteId string, userID string) (*model.Team, *model.TeamMember, *model.AppError)
|
||||
AddUserToTeamByTeamId(c request.CTX, teamID string, user *model.User) *model.AppError
|
||||
AddUserToTeamByToken(c request.CTX, userID string, tokenID string) (*model.Team, *model.TeamMember, *model.AppError)
|
||||
AdjustImage(file io.Reader) (*bytes.Buffer, *model.AppError)
|
||||
AdjustInProductLimits(limits *model.ProductLimits, subscription *model.Subscription) *model.AppError
|
||||
AdjustTeamsFromProductLimits(teamLimits *model.TeamsLimits) *model.AppError
|
||||
AllowOAuthAppAccessToUser(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError)
|
||||
AllowOAuthAppAccessToUser(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError)
|
||||
AppendFile(fr io.Reader, path string) (int64, *model.AppError)
|
||||
AsymmetricSigningKey() *ecdsa.PrivateKey
|
||||
AttachCloudSessionCookie(c *request.Context, w http.ResponseWriter, r *http.Request)
|
||||
AttachCloudSessionCookie(c request.CTX, w http.ResponseWriter, r *http.Request)
|
||||
AttachDeviceId(sessionID string, deviceID string, expiresAt int64) *model.AppError
|
||||
AttachSessionCookies(c *request.Context, w http.ResponseWriter, r *http.Request)
|
||||
AuthenticateUserForLogin(c *request.Context, id, loginId, password, mfaToken, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError)
|
||||
AuthorizeOAuthUser(c *request.Context, w http.ResponseWriter, r *http.Request, service, code, state, redirectURI string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError)
|
||||
AttachSessionCookies(c request.CTX, w http.ResponseWriter, r *http.Request)
|
||||
AuthenticateUserForLogin(c request.CTX, id, loginId, password, mfaToken, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError)
|
||||
AuthorizeOAuthUser(c request.CTX, w http.ResponseWriter, r *http.Request, service, code, state, redirectURI string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError)
|
||||
AutocompleteChannels(c request.CTX, userID, term string) (model.ChannelListWithTeamData, *model.AppError)
|
||||
AutocompleteChannelsForSearch(c request.CTX, teamID string, userID string, term string) (model.ChannelList, *model.AppError)
|
||||
AutocompleteChannelsForTeam(c request.CTX, teamID, userID, term string) (model.ChannelList, *model.AppError)
|
||||
@@ -440,10 +440,10 @@ type AppIface interface {
|
||||
BuildPushNotificationMessage(c request.CTX, contentsConfig string, post *model.Post, user *model.User, channel *model.Channel, channelName string, senderName string, explicitMention bool, channelWideMention bool, replyToThreadType string) (*model.PushNotification, *model.AppError)
|
||||
BuildSamlMetadataObject(idpMetadata []byte) (*model.SamlMetadataResponse, *model.AppError)
|
||||
BulkExport(ctx request.CTX, writer io.Writer, outPath string, job *model.Job, opts model.BulkExportOpts) *model.AppError
|
||||
BulkImport(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int) (*model.AppError, int)
|
||||
BulkImportWithPath(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int)
|
||||
BulkImport(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int) (*model.AppError, int)
|
||||
BulkImportWithPath(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int)
|
||||
CanNotifyAdmin(trial bool) bool
|
||||
CancelJob(c *request.Context, jobId string) *model.AppError
|
||||
CancelJob(c request.CTX, jobId string) *model.AppError
|
||||
ChannelMembersToRemove(teamID *string) ([]*model.ChannelMember, *model.AppError)
|
||||
Channels() *Channels
|
||||
CheckCanInviteToSharedChannel(channelId string) error
|
||||
@@ -471,9 +471,9 @@ type AppIface interface {
|
||||
Cluster() einterfaces.ClusterInterface
|
||||
CompareAndDeletePluginKey(pluginID string, key string, oldValue []byte) (bool, *model.AppError)
|
||||
CompareAndSetPluginKey(pluginID string, key string, oldValue, newValue []byte) (bool, *model.AppError)
|
||||
CompleteOAuth(c *request.Context, service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError)
|
||||
CompleteOnboarding(c *request.Context, request *model.CompleteOnboardingRequest) *model.AppError
|
||||
CompleteSwitchWithOAuth(c *request.Context, service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError)
|
||||
CompleteOAuth(c request.CTX, service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError)
|
||||
CompleteOnboarding(c request.CTX, request *model.CompleteOnboardingRequest) *model.AppError
|
||||
CompleteSwitchWithOAuth(c request.CTX, service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError)
|
||||
Compliance() einterfaces.ComplianceInterface
|
||||
Config() *model.Config
|
||||
ConvertGroupMessageToChannel(c request.CTX, convertedByUserId string, gmConversionRequest *model.GroupMessageConversionRequestBody) (*model.Channel, *model.AppError)
|
||||
@@ -487,10 +487,10 @@ type AppIface interface {
|
||||
CreateGroupChannel(c request.CTX, userIDs []string, creatorId string) (*model.Channel, *model.AppError)
|
||||
CreateGroupWithUserIds(group *model.GroupWithUserIds) (*model.Group, *model.AppError)
|
||||
CreateIncomingWebhookForChannel(creatorId string, channel *model.Channel, hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
|
||||
CreateJob(c *request.Context, job *model.Job) (*model.Job, *model.AppError)
|
||||
CreateJob(c request.CTX, job *model.Job) (*model.Job, *model.AppError)
|
||||
CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)
|
||||
CreateOAuthStateToken(extra string) (*model.Token, *model.AppError)
|
||||
CreateOAuthUser(c *request.Context, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError)
|
||||
CreateOAuthUser(c request.CTX, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError)
|
||||
CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
|
||||
CreatePasswordRecoveryToken(userID, email string) (*model.Token, *model.AppError)
|
||||
CreatePost(c request.CTX, post *model.Post, channel *model.Channel, triggerWebhooks, setOnline bool) (savedPost *model.Post, err *model.AppError)
|
||||
@@ -499,10 +499,10 @@ type AppIface interface {
|
||||
CreateRetentionPolicy(policy *model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, *model.AppError)
|
||||
CreateRole(role *model.Role) (*model.Role, *model.AppError)
|
||||
CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError)
|
||||
CreateSession(c *request.Context, session *model.Session) (*model.Session, *model.AppError)
|
||||
CreateSession(c request.CTX, session *model.Session) (*model.Session, *model.AppError)
|
||||
CreateSidebarCategory(c request.CTX, userID, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError)
|
||||
CreateTeam(c request.CTX, team *model.Team) (*model.Team, *model.AppError)
|
||||
CreateTeamWithUser(c *request.Context, team *model.Team, userID string) (*model.Team, *model.AppError)
|
||||
CreateTeamWithUser(c request.CTX, team *model.Team, userID string) (*model.Team, *model.AppError)
|
||||
CreateTermsOfService(text, userID string) (*model.TermsOfService, *model.AppError)
|
||||
CreateUploadSession(c request.CTX, us *model.UploadSession) (*model.UploadSession, *model.AppError)
|
||||
CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError)
|
||||
@@ -514,10 +514,10 @@ type AppIface interface {
|
||||
DBHealthCheckDelete() error
|
||||
DBHealthCheckWrite() error
|
||||
DataRetention() einterfaces.DataRetentionInterface
|
||||
DeactivateGuests(c *request.Context) *model.AppError
|
||||
DeactivateGuests(c request.CTX) *model.AppError
|
||||
DeactivateMfa(userID string) *model.AppError
|
||||
DeauthorizeOAuthAppForUser(c *request.Context, userID, appID string) *model.AppError
|
||||
DeleteAcknowledgementForPost(c *request.Context, postID, userID string) *model.AppError
|
||||
DeauthorizeOAuthAppForUser(c request.CTX, userID, appID string) *model.AppError
|
||||
DeleteAcknowledgementForPost(c request.CTX, postID, userID string) *model.AppError
|
||||
DeleteAllExpiredPluginKeys() *model.AppError
|
||||
DeleteAllKeysForPlugin(pluginID string) *model.AppError
|
||||
DeleteBrandImage() *model.AppError
|
||||
@@ -537,7 +537,7 @@ type AppIface interface {
|
||||
DeletePluginKey(pluginID string, key string) *model.AppError
|
||||
DeletePost(c request.CTX, postID, deleteByID string) (*model.Post, *model.AppError)
|
||||
DeletePreferences(userID string, preferences model.Preferences) *model.AppError
|
||||
DeleteReactionForPost(c *request.Context, reaction *model.Reaction) *model.AppError
|
||||
DeleteReactionForPost(c request.CTX, reaction *model.Reaction) *model.AppError
|
||||
DeleteRemoteCluster(remoteClusterId string) (bool, *model.AppError)
|
||||
DeleteRetentionPolicy(policyID string) *model.AppError
|
||||
DeleteScheme(schemeId string) (*model.Scheme, *model.AppError)
|
||||
@@ -546,21 +546,21 @@ type AppIface interface {
|
||||
DeleteSidebarCategory(c request.CTX, userID, teamID, categoryId string) *model.AppError
|
||||
DeleteToken(token *model.Token) *model.AppError
|
||||
DisableAutoResponder(c request.CTX, userID string, asAdmin bool) *model.AppError
|
||||
DisableUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError
|
||||
DisableUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError
|
||||
DoAppMigrations()
|
||||
DoCheckForAdminNotifications(trial bool) *model.AppError
|
||||
DoCommandRequest(cmd *model.Command, p url.Values) (*model.Command, *model.CommandResponse, *model.AppError)
|
||||
DoEmojisPermissionsMigration()
|
||||
DoGuestRolesCreationMigration()
|
||||
DoLocalRequest(c *request.Context, rawURL string, body []byte) (*http.Response, *model.AppError)
|
||||
DoLogin(c *request.Context, w http.ResponseWriter, r *http.Request, user *model.User, deviceID string, isMobile, isOAuthUser, isSaml bool) *model.AppError
|
||||
DoPostAction(c *request.Context, postID, actionId, userID, selectedOption string) (string, *model.AppError)
|
||||
DoPostActionWithCookie(c *request.Context, postID, actionId, userID, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError)
|
||||
DoLocalRequest(c request.CTX, rawURL string, body []byte) (*http.Response, *model.AppError)
|
||||
DoLogin(c request.CTX, w http.ResponseWriter, r *http.Request, user *model.User, deviceID string, isMobile, isOAuthUser, isSaml bool) *model.AppError
|
||||
DoPostAction(c request.CTX, postID, actionId, userID, selectedOption string) (string, *model.AppError)
|
||||
DoPostActionWithCookie(c request.CTX, postID, actionId, userID, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError)
|
||||
DoSystemConsoleRolesCreationMigration()
|
||||
DoUploadFile(c request.CTX, now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError)
|
||||
DoUploadFileExpectModification(c request.CTX, now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError)
|
||||
DownloadFromURL(downloadURL string) ([]byte, error)
|
||||
EnableUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError
|
||||
EnableUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError
|
||||
EnvironmentConfig(filter func(reflect.StructField) bool) map[string]any
|
||||
ExportFileBackend() filestore.FileBackend
|
||||
ExportFileExists(path string) (bool, *model.AppError)
|
||||
@@ -581,7 +581,7 @@ type AppIface interface {
|
||||
GenerateMfaSecret(userID string) (*model.MfaSecret, *model.AppError)
|
||||
GeneratePresignURLForExport(name string) (*model.PresignURLResponse, *model.AppError)
|
||||
GeneratePublicLink(siteURL string, info *model.FileInfo) string
|
||||
GenerateSupportPacket(c *request.Context) []model.FileData
|
||||
GenerateSupportPacket(c request.CTX) []model.FileData
|
||||
GetAcknowledgementsForPost(postID string) ([]*model.PostAcknowledgement, *model.AppError)
|
||||
GetAcknowledgementsForPostList(postList *model.PostList) (map[string][]*model.PostAcknowledgement, *model.AppError)
|
||||
GetActivePluginManifests() ([]*model.Manifest, *model.AppError)
|
||||
@@ -598,7 +598,7 @@ type AppIface interface {
|
||||
GetAppliedSchemaMigrations() ([]model.AppliedMigration, *model.AppError)
|
||||
GetAudits(userID string, limit int) (model.Audits, *model.AppError)
|
||||
GetAuditsPage(userID string, page int, perPage int) (model.Audits, *model.AppError)
|
||||
GetAuthorizationCode(c *request.Context, w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError)
|
||||
GetAuthorizationCode(c request.CTX, w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError)
|
||||
GetAuthorizedAppsForUser(userID string, page, perPage int) ([]*model.OAuthApp, *model.AppError)
|
||||
GetBrandImage() ([]byte, *model.AppError)
|
||||
GetBulkReactionsForPosts(postIDs []string) (map[string][]*model.Reaction, *model.AppError)
|
||||
@@ -678,11 +678,11 @@ type AppIface interface {
|
||||
GetIncomingWebhooksForTeamPageByUser(teamID string, userID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError)
|
||||
GetIncomingWebhooksPage(page, perPage int) ([]*model.IncomingWebhook, *model.AppError)
|
||||
GetIncomingWebhooksPageByUser(userID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError)
|
||||
GetJob(c *request.Context, id string) (*model.Job, *model.AppError)
|
||||
GetJobsByType(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, *model.AppError)
|
||||
GetJobsByTypePage(c *request.Context, jobType string, page int, perPage int) ([]*model.Job, *model.AppError)
|
||||
GetJobsByTypes(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, *model.AppError)
|
||||
GetJobsByTypesPage(c *request.Context, jobType []string, page int, perPage int) ([]*model.Job, *model.AppError)
|
||||
GetJob(c request.CTX, id string) (*model.Job, *model.AppError)
|
||||
GetJobsByType(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, *model.AppError)
|
||||
GetJobsByTypePage(c request.CTX, jobType string, page int, perPage int) ([]*model.Job, *model.AppError)
|
||||
GetJobsByTypes(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, *model.AppError)
|
||||
GetJobsByTypesPage(c request.CTX, jobType []string, page int, perPage int) ([]*model.Job, *model.AppError)
|
||||
GetLatestTermsOfService() (*model.TermsOfService, *model.AppError)
|
||||
GetLatestVersion(latestVersionUrl string) (*model.GithubReleaseInfo, *model.AppError)
|
||||
GetLogs(c request.CTX, page, perPage int) ([]string, *model.AppError)
|
||||
@@ -694,15 +694,15 @@ type AppIface interface {
|
||||
GetNextPostIdFromPostList(postList *model.PostList, collapsedThreads bool) string
|
||||
GetNotificationNameFormat(user *model.User) string
|
||||
GetNumberOfChannelsOnTeam(c request.CTX, teamID string) (int, *model.AppError)
|
||||
GetOAuthAccessTokenForCodeFlow(c *request.Context, clientId, grantType, redirectURI, code, secret, refreshToken string) (*model.AccessResponse, *model.AppError)
|
||||
GetOAuthAccessTokenForImplicitFlow(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError)
|
||||
GetOAuthAccessTokenForCodeFlow(c request.CTX, clientId, grantType, redirectURI, code, secret, refreshToken string) (*model.AccessResponse, *model.AppError)
|
||||
GetOAuthAccessTokenForImplicitFlow(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError)
|
||||
GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError)
|
||||
GetOAuthApps(page, perPage int) ([]*model.OAuthApp, *model.AppError)
|
||||
GetOAuthAppsByCreator(userID string, page, perPage int) ([]*model.OAuthApp, *model.AppError)
|
||||
GetOAuthCodeRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError)
|
||||
GetOAuthImplicitRedirect(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError)
|
||||
GetOAuthLoginEndpoint(c *request.Context, w http.ResponseWriter, r *http.Request, service, teamID, action, redirectTo, loginHint string, isMobile bool, desktopToken string) (string, *model.AppError)
|
||||
GetOAuthSignupEndpoint(c *request.Context, w http.ResponseWriter, r *http.Request, service, teamID string, desktopToken string) (string, *model.AppError)
|
||||
GetOAuthImplicitRedirect(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError)
|
||||
GetOAuthLoginEndpoint(c request.CTX, w http.ResponseWriter, r *http.Request, service, teamID, action, redirectTo, loginHint string, isMobile bool, desktopToken string) (string, *model.AppError)
|
||||
GetOAuthSignupEndpoint(c request.CTX, w http.ResponseWriter, r *http.Request, service, teamID string, desktopToken string) (string, *model.AppError)
|
||||
GetOAuthStateToken(token string) (*model.Token, *model.AppError)
|
||||
GetOnboarding() (*model.System, *model.AppError)
|
||||
GetOpenGraphMetadata(requestURL string) ([]byte, error)
|
||||
@@ -757,7 +757,7 @@ type AppIface interface {
|
||||
GetRoleByName(ctx context.Context, name string) (*model.Role, *model.AppError)
|
||||
GetRolesByNames(names []string) ([]*model.Role, *model.AppError)
|
||||
GetSamlCertificateStatus() *model.SamlCertificateStatus
|
||||
GetSamlMetadata(c *request.Context) (string, *model.AppError)
|
||||
GetSamlMetadata(c request.CTX) (string, *model.AppError)
|
||||
GetSamlMetadataFromIdp(idpMetadataURL string) (*model.SamlMetadataResponse, *model.AppError)
|
||||
GetSanitizeOptions(asAdmin bool) map[string]bool
|
||||
GetScheme(id string) (*model.Scheme, *model.AppError)
|
||||
@@ -766,8 +766,8 @@ type AppIface interface {
|
||||
GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError)
|
||||
GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError)
|
||||
GetSession(token string) (*model.Session, *model.AppError)
|
||||
GetSessionById(c *request.Context, sessionID string) (*model.Session, *model.AppError)
|
||||
GetSessions(c *request.Context, userID string) ([]*model.Session, *model.AppError)
|
||||
GetSessionById(c request.CTX, sessionID string) (*model.Session, *model.AppError)
|
||||
GetSessions(c request.CTX, userID string) ([]*model.Session, *model.AppError)
|
||||
GetSharedChannel(channelID string) (*model.SharedChannel, error)
|
||||
GetSharedChannelRemote(id string) (*model.SharedChannelRemote, error)
|
||||
GetSharedChannelRemoteByIds(channelID string, remoteID string) (*model.SharedChannelRemote, error)
|
||||
@@ -821,10 +821,10 @@ type AppIface interface {
|
||||
GetUserByEmail(email string) (*model.User, *model.AppError)
|
||||
GetUserByRemoteID(remoteID string) (*model.User, *model.AppError)
|
||||
GetUserByUsername(username string) (*model.User, *model.AppError)
|
||||
GetUserForLogin(c *request.Context, id, loginId string) (*model.User, *model.AppError)
|
||||
GetUserForLogin(c request.CTX, id, loginId string) (*model.User, *model.AppError)
|
||||
GetUserTermsOfService(userID string) (*model.UserTermsOfService, *model.AppError)
|
||||
GetUsers(userIDs []string) ([]*model.User, *model.AppError)
|
||||
GetUsersByGroupChannelIds(c *request.Context, channelIDs []string, asAdmin bool) (map[string][]*model.User, *model.AppError)
|
||||
GetUsersByGroupChannelIds(c request.CTX, channelIDs []string, asAdmin bool) (map[string][]*model.User, *model.AppError)
|
||||
GetUsersByIds(userIDs []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError)
|
||||
GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
|
||||
GetUsersEtag(restrictionsHash string) string
|
||||
@@ -858,9 +858,9 @@ type AppIface interface {
|
||||
Handle404(w http.ResponseWriter, r *http.Request)
|
||||
HandleCommandResponse(c request.CTX, command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError)
|
||||
HandleCommandResponsePost(c request.CTX, command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.Post, *model.AppError)
|
||||
HandleCommandWebhook(c *request.Context, hookID string, response *model.CommandResponse) *model.AppError
|
||||
HandleCommandWebhook(c request.CTX, hookID string, response *model.CommandResponse) *model.AppError
|
||||
HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte)
|
||||
HandleIncomingWebhook(c *request.Context, hookID string, req *model.IncomingWebhookRequest) *model.AppError
|
||||
HandleIncomingWebhook(c request.CTX, hookID string, req *model.IncomingWebhookRequest) *model.AppError
|
||||
HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config)
|
||||
HasPermissionTo(askingUserId string, permission *model.Permission) bool
|
||||
HasPermissionToChannel(c request.CTX, askingUserId string, channelID string, permission *model.Permission) bool
|
||||
@@ -873,9 +873,9 @@ type AppIface interface {
|
||||
ImageProxyAdder() func(string) string
|
||||
ImageProxyRemover() (f func(string) string)
|
||||
ImportPermissions(jsonl io.Reader) error
|
||||
InitPlugins(c *request.Context, pluginDir, webappPluginDir string)
|
||||
InvalidateAllEmailInvites(c *request.Context) *model.AppError
|
||||
InvalidateAllResendInviteEmailJobs(c *request.Context) *model.AppError
|
||||
InitPlugins(c request.CTX, pluginDir, webappPluginDir string)
|
||||
InvalidateAllEmailInvites(c request.CTX) *model.AppError
|
||||
InvalidateAllResendInviteEmailJobs(c request.CTX) *model.AppError
|
||||
InvalidateCacheForUser(userID string)
|
||||
InvalidatePasswordRecoveryTokensForUser(userID string) *model.AppError
|
||||
InviteGuestsToChannels(teamID string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError
|
||||
@@ -909,16 +909,16 @@ type AppIface interface {
|
||||
ListPluginKeys(pluginID string, page, perPage int) ([]string, *model.AppError)
|
||||
ListTeamCommands(teamID string) ([]*model.Command, *model.AppError)
|
||||
Log() *mlog.Logger
|
||||
LoginByOAuth(c *request.Context, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError)
|
||||
LoginByOAuth(c request.CTX, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError)
|
||||
MakePermissionError(s *model.Session, permissions []*model.Permission) *model.AppError
|
||||
MarkChannelsAsViewed(c request.CTX, channelIDs []string, userID string, currentSessionId string, collapsedThreadsSupported, isCRTEnabled bool) (map[string]int64, *model.AppError)
|
||||
MaxPostSize() int
|
||||
MessageExport() einterfaces.MessageExportInterface
|
||||
Metrics() einterfaces.MetricsInterface
|
||||
MigrateIdLDAP(c *request.Context, toAttribute string) *model.AppError
|
||||
MigrateIdLDAP(c request.CTX, toAttribute string) *model.AppError
|
||||
MoveCommand(team *model.Team, command *model.Command) *model.AppError
|
||||
MoveFile(oldPath, newPath string) *model.AppError
|
||||
NewPluginAPI(c *request.Context, manifest *model.Manifest) plugin.API
|
||||
NewPluginAPI(c request.CTX, manifest *model.Manifest) plugin.API
|
||||
Notification() einterfaces.NotificationInterface
|
||||
NotificationsLog() *mlog.Logger
|
||||
NotifyAndSetWarnMetricAck(rctx request.CTX, warnMetricId string, sender *model.User, forceAck bool, isBot bool) *model.AppError
|
||||
@@ -927,17 +927,17 @@ type AppIface interface {
|
||||
OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppError
|
||||
OriginChecker() func(*http.Request) bool
|
||||
PatchChannel(c request.CTX, channel *model.Channel, patch *model.ChannelPatch, userID string) (*model.Channel, *model.AppError)
|
||||
PatchPost(c *request.Context, postID string, patch *model.PostPatch) (*model.Post, *model.AppError)
|
||||
PatchPost(c request.CTX, postID string, patch *model.PostPatch) (*model.Post, *model.AppError)
|
||||
PatchRetentionPolicy(patch *model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, *model.AppError)
|
||||
PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError)
|
||||
PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError)
|
||||
PatchTeam(teamID string, patch *model.TeamPatch) (*model.Team, *model.AppError)
|
||||
PatchUser(c request.CTX, userID string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError)
|
||||
PermanentDeleteAllUsers(c *request.Context) *model.AppError
|
||||
PermanentDeleteAllUsers(c request.CTX) *model.AppError
|
||||
PermanentDeleteChannel(c request.CTX, channel *model.Channel) *model.AppError
|
||||
PermanentDeleteTeam(c request.CTX, team *model.Team) *model.AppError
|
||||
PermanentDeleteTeamId(c request.CTX, teamID string) *model.AppError
|
||||
PermanentDeleteUser(c *request.Context, user *model.User) *model.AppError
|
||||
PermanentDeleteUser(c request.CTX, user *model.User) *model.AppError
|
||||
PostActionCookieSecret() []byte
|
||||
PostAddToChannelMessage(c request.CTX, user *model.User, addedUser *model.User, channel *model.Channel, postRootId string) *model.AppError
|
||||
PostPatchWithProxyRemovedFromImageURLs(patch *model.PostPatch) *model.PostPatch
|
||||
@@ -981,7 +981,7 @@ type AppIface interface {
|
||||
RemoveUserFromChannel(c request.CTX, userIDToRemove string, removerUserId string, channel *model.Channel) *model.AppError
|
||||
RemoveUserFromTeam(c request.CTX, teamID string, userID string, requestorId string) *model.AppError
|
||||
RemoveUsersFromChannelNotMemberOfTeam(c request.CTX, remover *model.User, channel *model.Channel, team *model.Team) *model.AppError
|
||||
RequestLicenseAndAckWarnMetric(c *request.Context, warnMetricId string, isBot bool) *model.AppError
|
||||
RequestLicenseAndAckWarnMetric(c request.CTX, warnMetricId string, isBot bool) *model.AppError
|
||||
ResetPasswordFromToken(c request.CTX, userSuppliedTokenString, newPassword string) *model.AppError
|
||||
ResetPermissionsSystem() *model.AppError
|
||||
ResetSamlAuthDataToEmail(includeDeleted bool, dryRun bool, userIDs []string) (numAffected int, appErr *model.AppError)
|
||||
@@ -991,12 +991,12 @@ type AppIface interface {
|
||||
RestrictUsersGetByPermissions(c request.CTX, userID string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError)
|
||||
RestrictUsersSearchByPermissions(c request.CTX, userID string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError)
|
||||
ReturnSessionToPool(session *model.Session)
|
||||
RevokeAccessToken(c *request.Context, token string) *model.AppError
|
||||
RevokeAllSessions(c *request.Context, userID string) *model.AppError
|
||||
RevokeSession(c *request.Context, session *model.Session) *model.AppError
|
||||
RevokeSessionById(c *request.Context, sessionID string) *model.AppError
|
||||
RevokeSessionsForDeviceId(c *request.Context, userID string, deviceID string, currentSessionId string) *model.AppError
|
||||
RevokeUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError
|
||||
RevokeAccessToken(c request.CTX, token string) *model.AppError
|
||||
RevokeAllSessions(c request.CTX, userID string) *model.AppError
|
||||
RevokeSession(c request.CTX, session *model.Session) *model.AppError
|
||||
RevokeSessionById(c request.CTX, sessionID string) *model.AppError
|
||||
RevokeSessionsForDeviceId(c request.CTX, userID string, deviceID string, currentSessionId string) *model.AppError
|
||||
RevokeUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError
|
||||
RolesGrantPermission(roleNames []string, permissionId string) bool
|
||||
Saml() einterfaces.SamlInterface
|
||||
SanitizePostListMetadataForUser(c request.CTX, postList *model.PostList, userID string) (*model.PostList, *model.AppError)
|
||||
@@ -1004,12 +1004,12 @@ type AppIface interface {
|
||||
SanitizeProfile(user *model.User, asAdmin bool)
|
||||
SanitizeTeam(session model.Session, team *model.Team) *model.Team
|
||||
SanitizeTeams(session model.Session, teams []*model.Team) []*model.Team
|
||||
SaveAcknowledgementForPost(c *request.Context, postID, userID string) (*model.PostAcknowledgement, *model.AppError)
|
||||
SaveAcknowledgementForPost(c request.CTX, postID, userID string) (*model.PostAcknowledgement, *model.AppError)
|
||||
SaveAdminNotification(userId string, notifyData *model.NotifyAdminToUpgradeRequest) *model.AppError
|
||||
SaveAdminNotifyData(data *model.NotifyAdminData) (*model.NotifyAdminData, *model.AppError)
|
||||
SaveBrandImage(imageData *multipart.FileHeader) *model.AppError
|
||||
SaveComplianceReport(rctx request.CTX, job *model.Compliance) (*model.Compliance, *model.AppError)
|
||||
SaveReactionForPost(c *request.Context, reaction *model.Reaction) (*model.Reaction, *model.AppError)
|
||||
SaveReactionForPost(c request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError)
|
||||
SaveSharedChannel(c request.CTX, sc *model.SharedChannel) (*model.SharedChannel, error)
|
||||
SaveSharedChannelRemote(remote *model.SharedChannelRemote) (*model.SharedChannelRemote, error)
|
||||
SaveUserTermsOfService(userID, termsOfServiceId string, accepted bool) *model.AppError
|
||||
@@ -1020,9 +1020,9 @@ type AppIface interface {
|
||||
SearchChannelsUserNotIn(c request.CTX, teamID string, userID string, term string) (model.ChannelList, *model.AppError)
|
||||
SearchEmoji(c request.CTX, name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError)
|
||||
SearchEngine() *searchengine.Broker
|
||||
SearchFilesInTeamForUser(c *request.Context, terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.FileInfoList, *model.AppError)
|
||||
SearchFilesInTeamForUser(c request.CTX, terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.FileInfoList, *model.AppError)
|
||||
SearchGroupChannels(c request.CTX, userID, term string) (model.ChannelList, *model.AppError)
|
||||
SearchPostsForUser(c *request.Context, terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError)
|
||||
SearchPostsForUser(c request.CTX, terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError)
|
||||
SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError)
|
||||
SearchPrivateTeams(searchOpts *model.TeamSearch) ([]*model.Team, *model.AppError)
|
||||
SearchPublicTeams(searchOpts *model.TeamSearch) ([]*model.Team, *model.AppError)
|
||||
@@ -1042,7 +1042,7 @@ type AppIface interface {
|
||||
SendEmailVerification(user *model.User, newEmail, redirect string) *model.AppError
|
||||
SendEphemeralPost(c request.CTX, userID string, post *model.Post) *model.Post
|
||||
SendNotifications(c request.CTX, post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, parentPostList *model.PostList, setOnline bool) ([]string, error)
|
||||
SendNotifyAdminPosts(c *request.Context, workspaceName string, currentSKU string, trial bool) *model.AppError
|
||||
SendNotifyAdminPosts(c request.CTX, workspaceName string, currentSKU string, trial bool) *model.AppError
|
||||
SendPasswordReset(email string, siteURL string) (bool, *model.AppError)
|
||||
SendPaymentFailedEmail(failedPayment *model.FailedPayment) *model.AppError
|
||||
SendPersistentNotifications() error
|
||||
@@ -1086,14 +1086,14 @@ type AppIface interface {
|
||||
SetTeamIcon(teamID string, imageData *multipart.FileHeader) *model.AppError
|
||||
SetTeamIconFromFile(team *model.Team, file io.Reader) *model.AppError
|
||||
SetTeamIconFromMultiPartFile(teamID string, file multipart.File) *model.AppError
|
||||
SlackImport(c *request.Context, fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer)
|
||||
SlackImport(c request.CTX, fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer)
|
||||
SoftDeleteTeam(teamID string) *model.AppError
|
||||
Srv() *Server
|
||||
SubmitInteractiveDialog(c *request.Context, request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError)
|
||||
SwitchEmailToLdap(c *request.Context, email, password, code, ldapLoginId, ldapPassword string) (string, *model.AppError)
|
||||
SwitchEmailToOAuth(c *request.Context, w http.ResponseWriter, r *http.Request, email, password, code, service string) (string, *model.AppError)
|
||||
SwitchLdapToEmail(c *request.Context, ldapPassword, code, email, newPassword string) (string, *model.AppError)
|
||||
SwitchOAuthToEmail(c *request.Context, email, password, requesterId string) (string, *model.AppError)
|
||||
SubmitInteractiveDialog(c request.CTX, request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError)
|
||||
SwitchEmailToLdap(c request.CTX, email, password, code, ldapLoginId, ldapPassword string) (string, *model.AppError)
|
||||
SwitchEmailToOAuth(c request.CTX, w http.ResponseWriter, r *http.Request, email, password, code, service string) (string, *model.AppError)
|
||||
SwitchLdapToEmail(c request.CTX, ldapPassword, code, email, newPassword string) (string, *model.AppError)
|
||||
SwitchOAuthToEmail(c request.CTX, email, password, requesterId string) (string, *model.AppError)
|
||||
TeamMembersToRemove(teamID *string) ([]*model.TeamMember, *model.AppError)
|
||||
TelemetryId() string
|
||||
TestElasticsearch(cfg *model.Config) *model.AppError
|
||||
@@ -1107,7 +1107,7 @@ type AppIface interface {
|
||||
TotalWebsocketConnections() int
|
||||
TriggerWebhook(c request.CTX, payload *model.OutgoingWebhookPayload, hook *model.OutgoingWebhook, post *model.Post, channel *model.Channel)
|
||||
UnregisterPluginCommand(pluginID, teamID, trigger string)
|
||||
UpdateActive(c *request.Context, user *model.User, active bool) (*model.User, *model.AppError)
|
||||
UpdateActive(c request.CTX, user *model.User, active bool) (*model.User, *model.AppError)
|
||||
UpdateChannelMemberNotifyProps(c request.CTX, data map[string]string, channelID string, userID string) (*model.ChannelMember, *model.AppError)
|
||||
UpdateChannelMemberRoles(c request.CTX, channelID string, userID string, newRoles string) (*model.ChannelMember, *model.AppError)
|
||||
UpdateChannelMemberSchemeRoles(c request.CTX, channelID string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError)
|
||||
@@ -1125,13 +1125,13 @@ type AppIface interface {
|
||||
UpdateMfa(c request.CTX, activate bool, userID, token string) *model.AppError
|
||||
UpdateMobileAppBadge(userID string)
|
||||
UpdateOAuthApp(oldApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError)
|
||||
UpdateOAuthUserAttrs(c *request.Context, userData io.Reader, user *model.User, provider einterfaces.OAuthProvider, service string, tokenUser *model.User) *model.AppError
|
||||
UpdateOAuthUserAttrs(c request.CTX, userData io.Reader, user *model.User, provider einterfaces.OAuthProvider, service string, tokenUser *model.User) *model.AppError
|
||||
UpdateOutgoingWebhook(c request.CTX, oldHook, updatedHook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
|
||||
UpdatePassword(user *model.User, newPassword string) *model.AppError
|
||||
UpdatePasswordAsUser(c request.CTX, userID, currentPassword, newPassword string) *model.AppError
|
||||
UpdatePasswordByUserIdSendEmail(c request.CTX, userID, newPassword, method string) *model.AppError
|
||||
UpdatePasswordSendEmail(c request.CTX, user *model.User, newPassword, method string) *model.AppError
|
||||
UpdatePost(c *request.Context, receivedUpdatedPost *model.Post, safeUpdate bool) (*model.Post, *model.AppError)
|
||||
UpdatePost(c request.CTX, receivedUpdatedPost *model.Post, safeUpdate bool) (*model.Post, *model.AppError)
|
||||
UpdatePreferences(userID string, preferences model.Preferences) *model.AppError
|
||||
UpdateRemoteCluster(rc *model.RemoteCluster) (*model.RemoteCluster, *model.AppError)
|
||||
UpdateRemoteClusterTopics(remoteClusterId string, topics string) (*model.RemoteCluster, *model.AppError)
|
||||
@@ -1152,7 +1152,7 @@ type AppIface interface {
|
||||
UpdateThreadReadForUserByPost(c request.CTX, currentSessionId, userID, teamID, threadID, postID string) (*model.ThreadResponse, *model.AppError)
|
||||
UpdateThreadsReadForUser(userID, teamID string) *model.AppError
|
||||
UpdateUser(c request.CTX, user *model.User, sendNotifications bool) (*model.User, *model.AppError)
|
||||
UpdateUserActive(c *request.Context, userID string, active bool) *model.AppError
|
||||
UpdateUserActive(c request.CTX, userID string, active bool) *model.AppError
|
||||
UpdateUserAsUser(c request.CTX, user *model.User, asAdmin bool) (*model.User, *model.AppError)
|
||||
UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError)
|
||||
UpdateUserRoles(c request.CTX, userID string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError)
|
||||
@@ -1160,7 +1160,7 @@ type AppIface interface {
|
||||
UploadData(c request.CTX, us *model.UploadSession, rd io.Reader) (*model.FileInfo, *model.AppError)
|
||||
UploadEmojiImage(c request.CTX, id string, imageData *multipart.FileHeader) *model.AppError
|
||||
UploadFileForUserAndTeam(c request.CTX, data []byte, channelID string, filename string, rawUserId string, rawTeamId string) (*model.FileInfo, *model.AppError)
|
||||
UpsertDraft(c *request.Context, draft *model.Draft, connectionID string) (*model.Draft, *model.AppError)
|
||||
UpsertDraft(c request.CTX, draft *model.Draft, connectionID string) (*model.Draft, *model.AppError)
|
||||
UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError)
|
||||
UpsertGroupMembers(groupID string, userIDs []string) ([]*model.GroupMember, *model.AppError)
|
||||
UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
|
||||
|
||||
@@ -137,7 +137,7 @@ func (a *App) DoubleCheckPassword(user *model.User, password string) *model.AppE
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) checkLdapUserPasswordAndAllCriteria(c *request.Context, ldapId *string, password string, mfaToken string) (*model.User, *model.AppError) {
|
||||
func (a *App) checkLdapUserPasswordAndAllCriteria(c request.CTX, ldapId *string, password string, mfaToken string) (*model.User, *model.AppError) {
|
||||
if a.Ldap() == nil || ldapId == nil {
|
||||
err := model.NewAppError("doLdapAuthentication", "api.user.login_ldap.not_available.app_error", nil, "", http.StatusNotImplemented)
|
||||
return nil, err
|
||||
@@ -240,7 +240,7 @@ func checkUserNotBot(user *model.User) *model.AppError {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) authenticateUser(c *request.Context, user *model.User, password, mfaToken string) (*model.User, *model.AppError) {
|
||||
func (a *App) authenticateUser(c request.CTX, user *model.User, password, mfaToken string) (*model.User, *model.AppError) {
|
||||
license := a.Srv().License()
|
||||
ldapAvailable := *a.Config().LdapSettings.Enable && a.Ldap() != nil && license != nil && *license.Features.LDAP
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ type botServiceWrapper struct {
|
||||
app AppIface
|
||||
}
|
||||
|
||||
func (w *botServiceWrapper) EnsureBot(c *request.Context, productID string, bot *model.Bot) (string, error) {
|
||||
func (w *botServiceWrapper) EnsureBot(c request.CTX, productID string, bot *model.Bot) (string, error) {
|
||||
return w.app.EnsureBot(c, productID, bot)
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ func (a *App) GetBots(options *model.BotGetOptions) (model.BotList, *model.AppEr
|
||||
}
|
||||
|
||||
// UpdateBotActive marks a bot as active or inactive, along with its corresponding user.
|
||||
func (a *App) UpdateBotActive(c *request.Context, botUserId string, active bool) (*model.Bot, *model.AppError) {
|
||||
func (a *App) UpdateBotActive(c request.CTX, botUserId string, active bool) (*model.Bot, *model.AppError) {
|
||||
user, nErr := a.Srv().Store().User().Get(context.Background(), botUserId)
|
||||
if nErr != nil {
|
||||
var nfErr *store.ErrNotFound
|
||||
@@ -495,7 +495,7 @@ func (a *App) UpdateBotOwner(botUserId, newOwnerId string) (*model.Bot, *model.A
|
||||
}
|
||||
|
||||
// disableUserBots disables all bots owned by the given user.
|
||||
func (a *App) disableUserBots(c *request.Context, userID string) *model.AppError {
|
||||
func (a *App) disableUserBots(c request.CTX, userID string) *model.AppError {
|
||||
perPage := 20
|
||||
for {
|
||||
options := &model.BotGetOptions{
|
||||
|
||||
@@ -32,7 +32,7 @@ var atMentionRegexp = regexp.MustCompile(`\B@[[:alnum:]][[:alnum:]\.\-_:]*`)
|
||||
type CommandProvider interface {
|
||||
GetTrigger() string
|
||||
GetCommand(a *App, T i18n.TranslateFunc) *model.Command
|
||||
DoCommand(a *App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse
|
||||
DoCommand(a *App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse
|
||||
}
|
||||
|
||||
var commandProviders = make(map[string]CommandProvider)
|
||||
@@ -179,7 +179,7 @@ func (a *App) ListAllCommands(teamID string, T i18n.TranslateFunc) ([]*model.Com
|
||||
}
|
||||
|
||||
// @openTracingParams args
|
||||
func (a *App) ExecuteCommand(c *request.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
|
||||
func (a *App) ExecuteCommand(c request.CTX, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
|
||||
trigger := ""
|
||||
message := ""
|
||||
index := strings.IndexFunc(args.Command, unicode.IsSpace)
|
||||
@@ -346,7 +346,7 @@ func (a *App) MentionsToPublicChannels(c request.CTX, message, teamID string) mo
|
||||
|
||||
// tryExecuteBuiltInCommand attempts to run a built in command based on the given arguments. If no such command can be
|
||||
// found, returns nil for all arguments.
|
||||
func (a *App) tryExecuteBuiltInCommand(c *request.Context, args *model.CommandArgs, trigger string, message string) (*model.Command, *model.CommandResponse) {
|
||||
func (a *App) tryExecuteBuiltInCommand(c request.CTX, args *model.CommandArgs, trigger string, message string) (*model.Command, *model.CommandResponse) {
|
||||
provider := GetCommandProvider(trigger)
|
||||
if provider == nil {
|
||||
return nil, nil
|
||||
|
||||
@@ -22,7 +22,7 @@ type AutocompleteDynamicArgProvider interface {
|
||||
}
|
||||
|
||||
// GetSuggestions returns suggestions for user input.
|
||||
func (a *App) GetSuggestions(c *request.Context, commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion {
|
||||
func (a *App) GetSuggestions(c request.CTX, commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion {
|
||||
sort.Slice(commands, func(i, j int) bool {
|
||||
return strings.Compare(strings.ToLower(commands[i].Trigger), strings.ToLower(commands[j].Trigger)) < 0
|
||||
})
|
||||
@@ -49,7 +49,7 @@ func (a *App) GetSuggestions(c *request.Context, commandArgs *model.CommandArgs,
|
||||
return suggestions
|
||||
}
|
||||
|
||||
func (a *App) getSuggestions(c *request.Context, commandArgs *model.CommandArgs, commands []*model.AutocompleteData, inputParsed, inputToBeParsed, roleID string) []model.AutocompleteSuggestion {
|
||||
func (a *App) getSuggestions(c request.CTX, commandArgs *model.CommandArgs, commands []*model.AutocompleteData, inputParsed, inputToBeParsed, roleID string) []model.AutocompleteSuggestion {
|
||||
suggestions := []model.AutocompleteSuggestion{}
|
||||
index := strings.Index(inputToBeParsed, " ")
|
||||
|
||||
@@ -94,7 +94,7 @@ func (a *App) getSuggestions(c *request.Context, commandArgs *model.CommandArgs,
|
||||
return suggestions
|
||||
}
|
||||
|
||||
func (a *App) parseArguments(c *request.Context, commandArgs *model.CommandArgs, args []*model.AutocompleteArg, parsed, toBeParsed string) (found bool, alreadyParsed string, yetToBeParsed string, suggestions []model.AutocompleteSuggestion) {
|
||||
func (a *App) parseArguments(c request.CTX, commandArgs *model.CommandArgs, args []*model.AutocompleteArg, parsed, toBeParsed string) (found bool, alreadyParsed string, yetToBeParsed string, suggestions []model.AutocompleteSuggestion) {
|
||||
if len(args) == 0 {
|
||||
return false, parsed, toBeParsed, suggestions
|
||||
}
|
||||
@@ -142,7 +142,7 @@ func (a *App) parseArguments(c *request.Context, commandArgs *model.CommandArgs,
|
||||
return foundWithoutOptional, changedParsedWithoutOptional, changedToBeParsedWithoutOptional, suggestions
|
||||
}
|
||||
|
||||
func (a *App) parseArgument(c *request.Context, commandArgs *model.CommandArgs, arg *model.AutocompleteArg, parsed, toBeParsed string) (found bool, alreadyParsed string, yetToBeParsed string, suggestions []model.AutocompleteSuggestion) {
|
||||
func (a *App) parseArgument(c request.CTX, commandArgs *model.CommandArgs, arg *model.AutocompleteArg, parsed, toBeParsed string) (found bool, alreadyParsed string, yetToBeParsed string, suggestions []model.AutocompleteSuggestion) {
|
||||
if arg.Name != "" { //Parse the --name first
|
||||
found, changedParsed, changedToBeParsed, suggestion := parseNamedArgument(arg, parsed, toBeParsed)
|
||||
if found {
|
||||
@@ -239,7 +239,7 @@ func parseStaticListArgument(arg *model.AutocompleteArg, parsed, toBeParsed stri
|
||||
return parseListItems(a.PossibleArguments, parsed, toBeParsed)
|
||||
}
|
||||
|
||||
func (a *App) getDynamicListArgument(c *request.Context, commandArgs *model.CommandArgs, arg *model.AutocompleteArg, parsed, toBeParsed string) (found bool, alreadyParsed string, yetToBeParsed string, suggestions []model.AutocompleteSuggestion) {
|
||||
func (a *App) getDynamicListArgument(c request.CTX, commandArgs *model.CommandArgs, arg *model.AutocompleteArg, parsed, toBeParsed string) (found bool, alreadyParsed string, yetToBeParsed string, suggestions []model.AutocompleteSuggestion) {
|
||||
dynamicArg := arg.Data.(*model.AutocompleteDynamicListArg)
|
||||
|
||||
if strings.HasPrefix(dynamicArg.FetchURL, "builtin:") {
|
||||
|
||||
@@ -658,7 +658,7 @@ func (p *testCommandProvider) GetCommand(a *App, T i18n.TranslateFunc) *model.Co
|
||||
}
|
||||
}
|
||||
|
||||
func (p *testCommandProvider) DoCommand(a *App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (p *testCommandProvider) DoCommand(a *App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
return &model.CommandResponse{
|
||||
Text: "I do nothing!",
|
||||
ResponseType: model.CommandResponseTypeEphemeral,
|
||||
|
||||
@@ -34,7 +34,7 @@ func (a *App) GetDraft(userID, channelID, rootID string) (*model.Draft, *model.A
|
||||
return draft, nil
|
||||
}
|
||||
|
||||
func (a *App) UpsertDraft(c *request.Context, draft *model.Draft, connectionID string) (*model.Draft, *model.AppError) {
|
||||
func (a *App) UpsertDraft(c request.CTX, draft *model.Draft, connectionID string) (*model.Draft, *model.AppError) {
|
||||
if !*a.Config().ServiceSettings.AllowSyncedDrafts {
|
||||
return nil, model.NewAppError("CreateDraft", "app.draft.feature_disabled", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ func (t *UploadFileTask) init(a *App) {
|
||||
// returns a filled-out FileInfo and an optional error. A plugin may reject the
|
||||
// upload, returning a rejection error. In this case FileInfo would have
|
||||
// contained the last "good" FileInfo before the execution of that plugin.
|
||||
func (a *App) UploadFileX(c *request.Context, channelID, name string, input io.Reader,
|
||||
func (a *App) UploadFileX(c request.CTX, channelID, name string, input io.Reader,
|
||||
opts ...func(*UploadFileTask)) (*model.FileInfo, *model.AppError) {
|
||||
t := &UploadFileTask{
|
||||
ChannelId: filepath.Base(channelID),
|
||||
@@ -1398,7 +1398,7 @@ func populateZipfile(w *zip.Writer, fileDatas []model.FileData) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) SearchFilesInTeamForUser(c *request.Context, terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.FileInfoList, *model.AppError) {
|
||||
func (a *App) SearchFilesInTeamForUser(c request.CTX, terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.FileInfoList, *model.AppError) {
|
||||
paramsList := model.ParseSearchParams(strings.TrimSpace(terms), timeZoneOffset)
|
||||
includeDeleted := includeDeletedChannels && *a.Config().TeamSettings.ExperimentalViewArchivedChannels
|
||||
|
||||
|
||||
@@ -171,11 +171,11 @@ func (a *App) bulkImportWorker(c request.CTX, dryRun bool, wg *sync.WaitGroup, l
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) BulkImport(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int) (*model.AppError, int) {
|
||||
func (a *App) BulkImport(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int) (*model.AppError, int) {
|
||||
return a.bulkImport(c, jsonlReader, attachmentsReader, dryRun, workers, "")
|
||||
}
|
||||
|
||||
func (a *App) BulkImportWithPath(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int) {
|
||||
func (a *App) BulkImportWithPath(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int) {
|
||||
return a.bulkImport(c, jsonlReader, attachmentsReader, dryRun, workers, importPath)
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/utils"
|
||||
)
|
||||
|
||||
func (a *App) DoPostAction(c *request.Context, postID, actionId, userID, selectedOption string) (string, *model.AppError) {
|
||||
func (a *App) DoPostAction(c request.CTX, postID, actionId, userID, selectedOption string) (string, *model.AppError) {
|
||||
return a.DoPostActionWithCookie(c, postID, actionId, userID, selectedOption, nil)
|
||||
}
|
||||
|
||||
func (a *App) DoPostActionWithCookie(c *request.Context, postID, actionId, userID, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) {
|
||||
func (a *App) DoPostActionWithCookie(c request.CTX, postID, actionId, userID, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) {
|
||||
// PostAction may result in the original post being updated. For the
|
||||
// updated post, we need to unconditionally preserve the original
|
||||
// IsPinned and HasReaction attributes, and preserve its entire
|
||||
@@ -309,7 +309,7 @@ func (a *App) DoPostActionWithCookie(c *request.Context, postID, actionId, userI
|
||||
// Perform an HTTP POST request to an integration's action endpoint.
|
||||
// Caller must consume and close returned http.Response as necessary.
|
||||
// For internal requests, requests are routed directly to a plugin ServerHTTP hook
|
||||
func (a *App) DoActionRequest(c *request.Context, rawURL string, body []byte) (*http.Response, *model.AppError) {
|
||||
func (a *App) DoActionRequest(c request.CTX, rawURL string, body []byte) (*http.Response, *model.AppError) {
|
||||
inURL, err := url.Parse(rawURL)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("DoActionRequest", "api.post.do_action.action_integration.app_error", nil, "", http.StatusBadRequest).Wrap(err)
|
||||
@@ -373,11 +373,11 @@ func (w *LocalResponseWriter) WriteHeader(statusCode int) {
|
||||
w.status = statusCode
|
||||
}
|
||||
|
||||
func (a *App) doPluginRequest(c *request.Context, method, rawURL string, values url.Values, body []byte) (*http.Response, *model.AppError) {
|
||||
func (a *App) doPluginRequest(c request.CTX, method, rawURL string, values url.Values, body []byte) (*http.Response, *model.AppError) {
|
||||
return a.ch.doPluginRequest(c, method, rawURL, values, body)
|
||||
}
|
||||
|
||||
func (ch *Channels) doPluginRequest(c *request.Context, method, rawURL string, values url.Values, body []byte) (*http.Response, *model.AppError) {
|
||||
func (ch *Channels) doPluginRequest(c request.CTX, method, rawURL string, values url.Values, body []byte) (*http.Response, *model.AppError) {
|
||||
rawURL = strings.TrimPrefix(rawURL, "/")
|
||||
inURL, err := url.Parse(rawURL)
|
||||
if err != nil {
|
||||
@@ -443,7 +443,7 @@ func (ch *Channels) doPluginRequest(c *request.Context, method, rawURL string, v
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (a *App) doLocalWarnMetricsRequest(c *request.Context, rawURL string, upstreamRequest *model.PostActionIntegrationRequest) *model.AppError {
|
||||
func (a *App) doLocalWarnMetricsRequest(c request.CTX, rawURL string, upstreamRequest *model.PostActionIntegrationRequest) *model.AppError {
|
||||
_, err := url.Parse(rawURL)
|
||||
if err != nil {
|
||||
return model.NewAppError("doLocalWarnMetricsRequest", "api.post.do_action.action_integration.app_error", nil, "", http.StatusBadRequest).Wrap(err)
|
||||
@@ -579,7 +579,7 @@ func (a *App) buildWarnMetricMailtoLink(rctx request.CTX, warnMetricId string, u
|
||||
return mailToLinkContent.ToJSON()
|
||||
}
|
||||
|
||||
func (a *App) DoLocalRequest(c *request.Context, rawURL string, body []byte) (*http.Response, *model.AppError) {
|
||||
func (a *App) DoLocalRequest(c request.CTX, rawURL string, body []byte) (*http.Response, *model.AppError) {
|
||||
return a.doPluginRequest(c, "POST", rawURL, nil, body)
|
||||
}
|
||||
|
||||
@@ -603,7 +603,7 @@ func (a *App) OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppE
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) SubmitInteractiveDialog(c *request.Context, request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError) {
|
||||
func (a *App) SubmitInteractiveDialog(c request.CTX, request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError) {
|
||||
url := request.URL
|
||||
request.URL = ""
|
||||
request.Type = "dialog_submission"
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
)
|
||||
|
||||
func (a *App) GetJob(c *request.Context, id string) (*model.Job, *model.AppError) {
|
||||
func (a *App) GetJob(c request.CTX, id string) (*model.Job, *model.AppError) {
|
||||
job, err := a.Srv().Store().Job().Get(c, id)
|
||||
if err != nil {
|
||||
var nfErr *store.ErrNotFound
|
||||
@@ -27,11 +27,11 @@ func (a *App) GetJob(c *request.Context, id string) (*model.Job, *model.AppError
|
||||
return job, nil
|
||||
}
|
||||
|
||||
func (a *App) GetJobsByTypePage(c *request.Context, jobType string, page int, perPage int) ([]*model.Job, *model.AppError) {
|
||||
func (a *App) GetJobsByTypePage(c request.CTX, jobType string, page int, perPage int) ([]*model.Job, *model.AppError) {
|
||||
return a.GetJobsByType(c, jobType, page*perPage, perPage)
|
||||
}
|
||||
|
||||
func (a *App) GetJobsByType(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
func (a *App) GetJobsByType(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
jobs, err := a.Srv().Store().Job().GetAllByTypePage(c, jobType, offset, limit)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("GetJobsByType", "app.job.get_all.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
@@ -40,11 +40,11 @@ func (a *App) GetJobsByType(c *request.Context, jobType string, offset int, limi
|
||||
return jobs, nil
|
||||
}
|
||||
|
||||
func (a *App) GetJobsByTypesPage(c *request.Context, jobType []string, page int, perPage int) ([]*model.Job, *model.AppError) {
|
||||
func (a *App) GetJobsByTypesPage(c request.CTX, jobType []string, page int, perPage int) ([]*model.Job, *model.AppError) {
|
||||
return a.GetJobsByTypes(c, jobType, page*perPage, perPage)
|
||||
}
|
||||
|
||||
func (a *App) GetJobsByTypes(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
func (a *App) GetJobsByTypes(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
jobs, err := a.Srv().Store().Job().GetAllByTypesPage(c, jobTypes, offset, limit)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("GetJobsByType", "app.job.get_all.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
@@ -52,11 +52,11 @@ func (a *App) GetJobsByTypes(c *request.Context, jobTypes []string, offset int,
|
||||
return jobs, nil
|
||||
}
|
||||
|
||||
func (a *App) CreateJob(c *request.Context, job *model.Job) (*model.Job, *model.AppError) {
|
||||
func (a *App) CreateJob(c request.CTX, job *model.Job) (*model.Job, *model.AppError) {
|
||||
return a.Srv().Jobs.CreateJob(c, job.Type, job.Data)
|
||||
}
|
||||
|
||||
func (a *App) CancelJob(c *request.Context, jobId string) *model.AppError {
|
||||
func (a *App) CancelJob(c request.CTX, jobId string) *model.AppError {
|
||||
return a.Srv().Jobs.RequestCancellation(c, jobId)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
// SyncLdap starts an LDAP sync job.
|
||||
// If includeRemovedMembers is true, then members who left or were removed from a team/channel will
|
||||
// be re-added; otherwise, they will not be re-added.
|
||||
func (a *App) SyncLdap(c *request.Context, includeRemovedMembers bool) {
|
||||
func (a *App) SyncLdap(c request.CTX, includeRemovedMembers bool) {
|
||||
a.Srv().Go(func() {
|
||||
if license := a.Srv().License(); license != nil && *license.Features.LDAP {
|
||||
if !*a.Config().LdapSettings.EnableSync {
|
||||
@@ -88,7 +88,7 @@ func (a *App) GetAllLdapGroupsPage(page int, perPage int, opts model.LdapGroupSe
|
||||
return groups, total, nil
|
||||
}
|
||||
|
||||
func (a *App) SwitchEmailToLdap(c *request.Context, email, password, code, ldapLoginId, ldapPassword string) (string, *model.AppError) {
|
||||
func (a *App) SwitchEmailToLdap(c request.CTX, email, password, code, ldapLoginId, ldapPassword string) (string, *model.AppError) {
|
||||
if a.Srv().License() != nil && !*a.Config().ServiceSettings.ExperimentalEnableAuthenticationTransfer {
|
||||
return "", model.NewAppError("emailToLdap", "api.user.email_to_ldap.not_available.app_error", nil, "", http.StatusForbidden)
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func (a *App) SwitchEmailToLdap(c *request.Context, email, password, code, ldapL
|
||||
return "/login?extra=signin_change", nil
|
||||
}
|
||||
|
||||
func (a *App) SwitchLdapToEmail(c *request.Context, ldapPassword, code, email, newPassword string) (string, *model.AppError) {
|
||||
func (a *App) SwitchLdapToEmail(c request.CTX, ldapPassword, code, email, newPassword string) (string, *model.AppError) {
|
||||
if a.Srv().License() != nil && !*a.Config().ServiceSettings.ExperimentalEnableAuthenticationTransfer {
|
||||
return "", model.NewAppError("ldapToEmail", "api.user.ldap_to_email.not_available.app_error", nil, "", http.StatusForbidden)
|
||||
}
|
||||
@@ -170,7 +170,7 @@ func (a *App) SwitchLdapToEmail(c *request.Context, ldapPassword, code, email, n
|
||||
return "/login?extra=signin_change", nil
|
||||
}
|
||||
|
||||
func (a *App) MigrateIdLDAP(c *request.Context, toAttribute string) *model.AppError {
|
||||
func (a *App) MigrateIdLDAP(c request.CTX, toAttribute string) *model.AppError {
|
||||
if ldapI := a.Ldap(); ldapI != nil {
|
||||
if err := ldapI.MigrateIDAttribute(c, toAttribute); err != nil {
|
||||
switch err := err.(type) {
|
||||
|
||||
@@ -43,7 +43,7 @@ func (a *App) CheckForClientSideCert(r *http.Request) (string, string, string) {
|
||||
return pem, subject, email
|
||||
}
|
||||
|
||||
func (a *App) AuthenticateUserForLogin(c *request.Context, id, loginId, password, mfaToken, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError) {
|
||||
func (a *App) AuthenticateUserForLogin(c request.CTX, id, loginId, password, mfaToken, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError) {
|
||||
// Do statistics
|
||||
defer func() {
|
||||
if a.Metrics() != nil {
|
||||
@@ -120,7 +120,7 @@ func (a *App) AuthenticateUserForLogin(c *request.Context, id, loginId, password
|
||||
return user, nil
|
||||
}
|
||||
|
||||
func (a *App) GetUserForLogin(c *request.Context, id, loginId string) (*model.User, *model.AppError) {
|
||||
func (a *App) GetUserForLogin(c request.CTX, id, loginId string) (*model.User, *model.AppError) {
|
||||
enableUsername := *a.Config().EmailSettings.EnableSignInWithUsername
|
||||
enableEmail := *a.Config().EmailSettings.EnableSignInWithEmail
|
||||
|
||||
@@ -156,7 +156,7 @@ func (a *App) GetUserForLogin(c *request.Context, id, loginId string) (*model.Us
|
||||
return nil, model.NewAppError("GetUserForLogin", "store.sql_user.get_for_login.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
func (a *App) DoLogin(c *request.Context, w http.ResponseWriter, r *http.Request, user *model.User, deviceID string, isMobile, isOAuthUser, isSaml bool) *model.AppError {
|
||||
func (a *App) DoLogin(c request.CTX, w http.ResponseWriter, r *http.Request, user *model.User, deviceID string, isMobile, isOAuthUser, isSaml bool) *model.AppError {
|
||||
var rejectionReason string
|
||||
pluginContext := pluginContext(c)
|
||||
a.ch.RunMultiHook(func(hooks plugin.Hooks) bool {
|
||||
@@ -234,7 +234,7 @@ func (a *App) DoLogin(c *request.Context, w http.ResponseWriter, r *http.Request
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) AttachCloudSessionCookie(c *request.Context, w http.ResponseWriter, r *http.Request) {
|
||||
func (a *App) AttachCloudSessionCookie(c request.CTX, w http.ResponseWriter, r *http.Request) {
|
||||
secure := false
|
||||
if GetProtocol(r) == "https" {
|
||||
secure = true
|
||||
@@ -279,7 +279,7 @@ func (a *App) AttachCloudSessionCookie(c *request.Context, w http.ResponseWriter
|
||||
http.SetCookie(w, cookie)
|
||||
}
|
||||
|
||||
func (a *App) AttachSessionCookies(c *request.Context, w http.ResponseWriter, r *http.Request) {
|
||||
func (a *App) AttachSessionCookies(c request.CTX, w http.ResponseWriter, r *http.Request) {
|
||||
secure := false
|
||||
if GetProtocol(r) == "https" {
|
||||
secure = true
|
||||
|
||||
@@ -554,7 +554,7 @@ func (s *Server) doPostPriorityConfigDefaultTrueMigration() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) doElasticsearchFixChannelIndex(c *request.Context) {
|
||||
func (s *Server) doElasticsearchFixChannelIndex(c request.CTX) {
|
||||
// If the migration is already marked as completed, don't do it again.
|
||||
if _, err := s.Store().System().GetByName(model.MigrationKeyElasticsearchFixChannelIndex); err == nil {
|
||||
return
|
||||
@@ -572,7 +572,7 @@ func (s *Server) doElasticsearchFixChannelIndex(c *request.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) doCloudS3PathMigrations(c *request.Context) {
|
||||
func (s *Server) doCloudS3PathMigrations(c request.CTX) {
|
||||
// This migration is only applicable for cloud environments
|
||||
if os.Getenv("MM_CLOUD_FILESTORE_BIFROST") == "" {
|
||||
return
|
||||
@@ -600,7 +600,7 @@ func (s *Server) doCloudS3PathMigrations(c *request.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) doDeleteEmptyDraftsMigration(c *request.Context) {
|
||||
func (s *Server) doDeleteEmptyDraftsMigration(c request.CTX) {
|
||||
// If the migration is already marked as completed, don't do it again.
|
||||
if _, err := s.Store().System().GetByName(model.MigrationKeyDeleteEmptyDrafts); err == nil {
|
||||
return
|
||||
|
||||
@@ -83,7 +83,7 @@ func filterNotificationData(data []*model.NotifyAdminData, test func(*model.Noti
|
||||
return
|
||||
}
|
||||
|
||||
func (a *App) SendNotifyAdminPosts(c *request.Context, workspaceName string, currentSKU string, trial bool) *model.AppError {
|
||||
func (a *App) SendNotifyAdminPosts(c request.CTX, workspaceName string, currentSKU string, trial bool) *model.AppError {
|
||||
if !a.CanNotifyAdmin(trial) {
|
||||
return model.NewAppError("SendNotifyAdminPosts", "app.notify_admin.send_notification_post.app_error", nil, "Cannot notify yet", http.StatusForbidden)
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func (a *App) SendNotifyAdminPosts(c *request.Context, workspaceName string, cur
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) pluginInstallAdminNotifyPost(c *request.Context, userBasedData map[string][]*model.NotifyAdminData, pluginBasedPluginData map[string][]*model.NotifyAdminData, systemBot *model.Bot, admin *model.User) {
|
||||
func (a *App) pluginInstallAdminNotifyPost(c request.CTX, userBasedData map[string][]*model.NotifyAdminData, pluginBasedPluginData map[string][]*model.NotifyAdminData, systemBot *model.Bot, admin *model.User) {
|
||||
props := make(model.StringInterface)
|
||||
|
||||
channel, appErr := a.GetOrCreateDirectChannel(c, systemBot.UserId, admin.Id)
|
||||
@@ -160,7 +160,7 @@ func (a *App) pluginInstallAdminNotifyPost(c *request.Context, userBasedData map
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) upgradePlanAdminNotifyPost(c *request.Context, workspaceName string, userBasedData map[string][]*model.NotifyAdminData, featureBasedData map[model.MattermostFeature][]*model.NotifyAdminData, systemBot *model.Bot, admin *model.User, trial bool) {
|
||||
func (a *App) upgradePlanAdminNotifyPost(c request.CTX, workspaceName string, userBasedData map[string][]*model.NotifyAdminData, featureBasedData map[model.MattermostFeature][]*model.NotifyAdminData, systemBot *model.Bot, admin *model.User, trial bool) {
|
||||
props := make(model.StringInterface)
|
||||
T := i18n.GetUserTranslations(admin.Locale)
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ func (a *App) GetOAuthAppsByCreator(userID string, page, perPage int) ([]*model.
|
||||
return oauthApps, nil
|
||||
}
|
||||
|
||||
func (a *App) GetOAuthImplicitRedirect(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) {
|
||||
func (a *App) GetOAuthImplicitRedirect(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) {
|
||||
session, err := a.GetOAuthAccessTokenForImplicitFlow(c, userID, authRequest)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -184,7 +184,7 @@ func (a *App) GetOAuthCodeRedirect(userID string, authRequest *model.AuthorizeRe
|
||||
return uri.String(), nil
|
||||
}
|
||||
|
||||
func (a *App) AllowOAuthAppAccessToUser(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) {
|
||||
func (a *App) AllowOAuthAppAccessToUser(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) {
|
||||
if !*a.Config().ServiceSettings.EnableOAuthServiceProvider {
|
||||
return "", model.NewAppError("AllowOAuthAppAccessToUser", "api.oauth.allow_oauth.turn_off.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
@@ -240,7 +240,7 @@ func (a *App) AllowOAuthAppAccessToUser(c *request.Context, userID string, authR
|
||||
return redirectURI, nil
|
||||
}
|
||||
|
||||
func (a *App) GetOAuthAccessTokenForImplicitFlow(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) {
|
||||
func (a *App) GetOAuthAccessTokenForImplicitFlow(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) {
|
||||
if !*a.Config().ServiceSettings.EnableOAuthServiceProvider {
|
||||
return nil, model.NewAppError("GetOAuthAccessToken", "api.oauth.get_access_token.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
@@ -269,7 +269,7 @@ func (a *App) GetOAuthAccessTokenForImplicitFlow(c *request.Context, userID stri
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (a *App) GetOAuthAccessTokenForCodeFlow(c *request.Context, clientId, grantType, redirectURI, code, secret, refreshToken string) (*model.AccessResponse, *model.AppError) {
|
||||
func (a *App) GetOAuthAccessTokenForCodeFlow(c request.CTX, clientId, grantType, redirectURI, code, secret, refreshToken string) (*model.AccessResponse, *model.AppError) {
|
||||
if !*a.Config().ServiceSettings.EnableOAuthServiceProvider {
|
||||
return nil, model.NewAppError("GetOAuthAccessToken", "api.oauth.get_access_token.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
@@ -382,7 +382,7 @@ func (a *App) GetOAuthAccessTokenForCodeFlow(c *request.Context, clientId, grant
|
||||
return accessRsp, nil
|
||||
}
|
||||
|
||||
func (a *App) newSession(c *request.Context, app *model.OAuthApp, user *model.User) (*model.Session, *model.AppError) {
|
||||
func (a *App) newSession(c request.CTX, app *model.OAuthApp, user *model.User) (*model.Session, *model.AppError) {
|
||||
// Set new token an session
|
||||
session := &model.Session{UserId: user.Id, Roles: user.Roles, IsOAuth: true}
|
||||
session.GenerateCSRF()
|
||||
@@ -403,7 +403,7 @@ func (a *App) newSession(c *request.Context, app *model.OAuthApp, user *model.Us
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (a *App) newSessionUpdateToken(c *request.Context, app *model.OAuthApp, accessData *model.AccessData, user *model.User) (*model.AccessResponse, *model.AppError) {
|
||||
func (a *App) newSessionUpdateToken(c request.CTX, app *model.OAuthApp, accessData *model.AccessData, user *model.User) (*model.AccessResponse, *model.AppError) {
|
||||
// Remove the previous session
|
||||
if err := a.Srv().Store().Session().Remove(accessData.Token); err != nil {
|
||||
mlog.Warn("error removing access data token from session", mlog.Err(err))
|
||||
@@ -431,7 +431,7 @@ func (a *App) newSessionUpdateToken(c *request.Context, app *model.OAuthApp, acc
|
||||
return accessRsp, nil
|
||||
}
|
||||
|
||||
func (a *App) GetOAuthLoginEndpoint(c *request.Context, w http.ResponseWriter, r *http.Request, service, teamID, action, redirectTo, loginHint string, isMobile bool, desktopToken string) (string, *model.AppError) {
|
||||
func (a *App) GetOAuthLoginEndpoint(c request.CTX, w http.ResponseWriter, r *http.Request, service, teamID, action, redirectTo, loginHint string, isMobile bool, desktopToken string) (string, *model.AppError) {
|
||||
stateProps := map[string]string{}
|
||||
stateProps["action"] = action
|
||||
if teamID != "" {
|
||||
@@ -456,7 +456,7 @@ func (a *App) GetOAuthLoginEndpoint(c *request.Context, w http.ResponseWriter, r
|
||||
return authURL, nil
|
||||
}
|
||||
|
||||
func (a *App) GetOAuthSignupEndpoint(c *request.Context, w http.ResponseWriter, r *http.Request, service, teamID string, desktopToken string) (string, *model.AppError) {
|
||||
func (a *App) GetOAuthSignupEndpoint(c request.CTX, w http.ResponseWriter, r *http.Request, service, teamID string, desktopToken string) (string, *model.AppError) {
|
||||
stateProps := map[string]string{}
|
||||
stateProps["action"] = model.OAuthActionSignup
|
||||
if teamID != "" {
|
||||
@@ -493,7 +493,7 @@ func (a *App) GetAuthorizedAppsForUser(userID string, page, perPage int) ([]*mod
|
||||
return apps, nil
|
||||
}
|
||||
|
||||
func (a *App) DeauthorizeOAuthAppForUser(c *request.Context, userID, appID string) *model.AppError {
|
||||
func (a *App) DeauthorizeOAuthAppForUser(c request.CTX, userID, appID string) *model.AppError {
|
||||
if !*a.Config().ServiceSettings.EnableOAuthServiceProvider {
|
||||
return model.NewAppError("DeauthorizeOAuthAppForUser", "api.oauth.allow_oauth.turn_off.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
@@ -548,7 +548,7 @@ func (a *App) RegenerateOAuthAppSecret(app *model.OAuthApp) (*model.OAuthApp, *m
|
||||
return app, nil
|
||||
}
|
||||
|
||||
func (a *App) RevokeAccessToken(c *request.Context, token string) *model.AppError {
|
||||
func (a *App) RevokeAccessToken(c request.CTX, token string) *model.AppError {
|
||||
if err := a.ch.srv.platform.RevokeAccessToken(c, token); err != nil {
|
||||
switch {
|
||||
case errors.Is(err, platform.GetTokenError):
|
||||
@@ -563,7 +563,7 @@ func (a *App) RevokeAccessToken(c *request.Context, token string) *model.AppErro
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) CompleteOAuth(c *request.Context, service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
func (a *App) CompleteOAuth(c request.CTX, service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
defer body.Close()
|
||||
|
||||
action := props["action"]
|
||||
@@ -599,7 +599,7 @@ func (a *App) getSSOProvider(service string) (einterfaces.OAuthProvider, *model.
|
||||
return provider, nil
|
||||
}
|
||||
|
||||
func (a *App) LoginByOAuth(c *request.Context, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
func (a *App) LoginByOAuth(c request.CTX, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
provider, e := a.getSSOProvider(service)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
@@ -652,7 +652,7 @@ func (a *App) LoginByOAuth(c *request.Context, service string, userData io.Reade
|
||||
return user, nil
|
||||
}
|
||||
|
||||
func (a *App) CompleteSwitchWithOAuth(c *request.Context, service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
func (a *App) CompleteSwitchWithOAuth(c request.CTX, service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
provider, e := a.getSSOProvider(service)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
@@ -730,7 +730,7 @@ func (a *App) GetOAuthStateToken(token string) (*model.Token, *model.AppError) {
|
||||
return mToken, nil
|
||||
}
|
||||
|
||||
func (a *App) GetAuthorizationCode(c *request.Context, w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) {
|
||||
func (a *App) GetAuthorizationCode(c request.CTX, w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) {
|
||||
provider, e := a.getSSOProvider(service)
|
||||
if e != nil {
|
||||
return "", e
|
||||
@@ -795,7 +795,7 @@ func (a *App) GetAuthorizationCode(c *request.Context, w http.ResponseWriter, r
|
||||
return authURL, nil
|
||||
}
|
||||
|
||||
func (a *App) AuthorizeOAuthUser(c *request.Context, w http.ResponseWriter, r *http.Request, service, code, state, redirectURI string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError) {
|
||||
func (a *App) AuthorizeOAuthUser(c request.CTX, w http.ResponseWriter, r *http.Request, service, code, state, redirectURI string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError) {
|
||||
provider, e := a.getSSOProvider(service)
|
||||
if e != nil {
|
||||
return nil, "", nil, nil, e
|
||||
@@ -939,7 +939,7 @@ func (a *App) AuthorizeOAuthUser(c *request.Context, w http.ResponseWriter, r *h
|
||||
return resp.Body, teamID, stateProps, userFromToken, nil
|
||||
}
|
||||
|
||||
func (a *App) SwitchEmailToOAuth(c *request.Context, w http.ResponseWriter, r *http.Request, email, password, code, service string) (string, *model.AppError) {
|
||||
func (a *App) SwitchEmailToOAuth(c request.CTX, w http.ResponseWriter, r *http.Request, email, password, code, service string) (string, *model.AppError) {
|
||||
if a.Srv().License() != nil && !*a.Config().ServiceSettings.ExperimentalEnableAuthenticationTransfer {
|
||||
return "", model.NewAppError("emailToOAuth", "api.user.email_to_oauth.not_available.app_error", nil, "", http.StatusForbidden)
|
||||
}
|
||||
@@ -969,7 +969,7 @@ func (a *App) SwitchEmailToOAuth(c *request.Context, w http.ResponseWriter, r *h
|
||||
return authURL, nil
|
||||
}
|
||||
|
||||
func (a *App) SwitchOAuthToEmail(c *request.Context, email, password, requesterId string) (string, *model.AppError) {
|
||||
func (a *App) SwitchOAuthToEmail(c request.CTX, email, password, requesterId string) (string, *model.AppError) {
|
||||
if a.Srv().License() != nil && !*a.Config().ServiceSettings.ExperimentalEnableAuthenticationTransfer {
|
||||
return "", model.NewAppError("oauthToEmail", "api.user.oauth_to_email.not_available.app_error", nil, "", http.StatusForbidden)
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ func (glu *GitLabUser) getAuthData() string {
|
||||
return strconv.FormatInt(glu.Id, 10)
|
||||
}
|
||||
|
||||
func (m *GitLabProvider) GetUserFromJSON(c *request.Context, data io.Reader, tokenUser *model.User) (*model.User, error) {
|
||||
func (m *GitLabProvider) GetUserFromJSON(c request.CTX, data io.Reader, tokenUser *model.User) (*model.User, error) {
|
||||
glu, err := gitLabUserFromJSON(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -96,14 +96,14 @@ func (m *GitLabProvider) GetUserFromJSON(c *request.Context, data io.Reader, tok
|
||||
return userFromGitLabUser(c.Logger(), glu), nil
|
||||
}
|
||||
|
||||
func (m *GitLabProvider) GetSSOSettings(_ *request.Context, config *model.Config, service string) (*model.SSOSettings, error) {
|
||||
func (m *GitLabProvider) GetSSOSettings(_ request.CTX, config *model.Config, service string) (*model.SSOSettings, error) {
|
||||
return &config.GitLabSettings, nil
|
||||
}
|
||||
|
||||
func (m *GitLabProvider) GetUserFromIdToken(_ *request.Context, idToken string) (*model.User, error) {
|
||||
func (m *GitLabProvider) GetUserFromIdToken(_ request.CTX, idToken string) (*model.User, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *GitLabProvider) IsSameUser(_ *request.Context, dbUser, oauthUser *model.User) bool {
|
||||
func (m *GitLabProvider) IsSameUser(_ request.CTX, dbUser, oauthUser *model.User) bool {
|
||||
return dbUser.AuthData == oauthUser.AuthData
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
)
|
||||
|
||||
func (a *App) markAdminOnboardingComplete(c *request.Context) *model.AppError {
|
||||
func (a *App) markAdminOnboardingComplete(c request.CTX) *model.AppError {
|
||||
firstAdminCompleteSetupObj := model.System{
|
||||
Name: model.SystemFirstAdminSetupComplete,
|
||||
Value: "true",
|
||||
@@ -27,7 +27,7 @@ func (a *App) markAdminOnboardingComplete(c *request.Context) *model.AppError {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) CompleteOnboarding(c *request.Context, request *model.CompleteOnboardingRequest) *model.AppError {
|
||||
func (a *App) CompleteOnboarding(c request.CTX, request *model.CompleteOnboardingRequest) *model.AppError {
|
||||
isCloud := a.Srv().License() != nil && *a.Srv().License().Features.Cloud
|
||||
|
||||
if !isCloud && request.Organization == "" {
|
||||
|
||||
@@ -9,14 +9,13 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
mm_model "github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/shared/request"
|
||||
)
|
||||
|
||||
func TestOnboardingSavesOrganizationName(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
err := th.App.CompleteOnboarding(&request.Context{}, &mm_model.CompleteOnboardingRequest{
|
||||
err := th.App.CompleteOnboarding(th.Context, &mm_model.CompleteOnboardingRequest{
|
||||
Organization: "Mattermost In Tests",
|
||||
})
|
||||
require.Nil(t, err)
|
||||
|
||||
@@ -394,7 +394,7 @@ func (a *OpenTracingAppLayer) AddTeamMember(c request.CTX, teamID string, userID
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(c *request.Context, inviteId string, userID string) (*model.TeamMember, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(c request.CTX, inviteId string, userID string) (*model.TeamMember, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByInviteId")
|
||||
|
||||
@@ -416,7 +416,7 @@ func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(c *request.Context, invite
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AddTeamMemberByToken(c *request.Context, userID string, tokenID string) (*model.TeamMember, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) AddTeamMemberByToken(c request.CTX, userID string, tokenID string) (*model.TeamMember, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByToken")
|
||||
|
||||
@@ -438,7 +438,7 @@ func (a *OpenTracingAppLayer) AddTeamMemberByToken(c *request.Context, userID st
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AddTeamMembers(c *request.Context, teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) AddTeamMembers(c request.CTX, teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMembers")
|
||||
|
||||
@@ -526,7 +526,7 @@ func (a *OpenTracingAppLayer) AddUserToTeam(c request.CTX, teamID string, userID
|
||||
return resultVar0, resultVar1, resultVar2
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(c *request.Context, inviteId string, userID string) (*model.Team, *model.TeamMember, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(c request.CTX, inviteId string, userID string) (*model.Team, *model.TeamMember, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByInviteId")
|
||||
|
||||
@@ -548,7 +548,7 @@ func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(c *request.Context, invite
|
||||
return resultVar0, resultVar1, resultVar2
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(c *request.Context, teamID string, user *model.User) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(c request.CTX, teamID string, user *model.User) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByTeamId")
|
||||
|
||||
@@ -570,7 +570,7 @@ func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(c *request.Context, teamID s
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AddUserToTeamByToken(c *request.Context, userID string, tokenID string) (*model.Team, *model.TeamMember, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) AddUserToTeamByToken(c request.CTX, userID string, tokenID string) (*model.Team, *model.TeamMember, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByToken")
|
||||
|
||||
@@ -658,7 +658,7 @@ func (a *OpenTracingAppLayer) AdjustTeamsFromProductLimits(teamLimits *model.Tea
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AllowOAuthAppAccessToUser")
|
||||
|
||||
@@ -719,7 +719,7 @@ func (a *OpenTracingAppLayer) AsymmetricSigningKey() *ecdsa.PrivateKey {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AttachCloudSessionCookie(c *request.Context, w http.ResponseWriter, r *http.Request) {
|
||||
func (a *OpenTracingAppLayer) AttachCloudSessionCookie(c request.CTX, w http.ResponseWriter, r *http.Request) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachCloudSessionCookie")
|
||||
|
||||
@@ -756,7 +756,7 @@ func (a *OpenTracingAppLayer) AttachDeviceId(sessionID string, deviceID string,
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AttachSessionCookies(c *request.Context, w http.ResponseWriter, r *http.Request) {
|
||||
func (a *OpenTracingAppLayer) AttachSessionCookies(c request.CTX, w http.ResponseWriter, r *http.Request) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachSessionCookies")
|
||||
|
||||
@@ -771,7 +771,7 @@ func (a *OpenTracingAppLayer) AttachSessionCookies(c *request.Context, w http.Re
|
||||
a.app.AttachSessionCookies(c, w, r)
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AuthenticateUserForLogin(c *request.Context, id string, loginId string, password string, mfaToken string, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) AuthenticateUserForLogin(c request.CTX, id string, loginId string, password string, mfaToken string, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthenticateUserForLogin")
|
||||
|
||||
@@ -793,7 +793,7 @@ func (a *OpenTracingAppLayer) AuthenticateUserForLogin(c *request.Context, id st
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) AuthorizeOAuthUser(c *request.Context, w http.ResponseWriter, r *http.Request, service string, code string, state string, redirectURI string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) AuthorizeOAuthUser(c request.CTX, w http.ResponseWriter, r *http.Request, service string, code string, state string, redirectURI string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthorizeOAuthUser")
|
||||
|
||||
@@ -1013,7 +1013,7 @@ func (a *OpenTracingAppLayer) BulkExport(ctx request.CTX, writer io.Writer, outP
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) BulkImport(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int) (*model.AppError, int) {
|
||||
func (a *OpenTracingAppLayer) BulkImport(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int) (*model.AppError, int) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkImport")
|
||||
|
||||
@@ -1035,7 +1035,7 @@ func (a *OpenTracingAppLayer) BulkImport(c *request.Context, jsonlReader io.Read
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) BulkImportWithPath(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int) {
|
||||
func (a *OpenTracingAppLayer) BulkImportWithPath(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkImportWithPath")
|
||||
|
||||
@@ -1074,7 +1074,7 @@ func (a *OpenTracingAppLayer) CanNotifyAdmin(trial bool) bool {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CancelJob(c *request.Context, jobId string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) CancelJob(c request.CTX, jobId string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CancelJob")
|
||||
|
||||
@@ -1294,7 +1294,7 @@ func (a *OpenTracingAppLayer) CheckPostReminders() {
|
||||
a.app.CheckPostReminders()
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CheckProviderAttributes(c *request.Context, user *model.User, patch *model.UserPatch) string {
|
||||
func (a *OpenTracingAppLayer) CheckProviderAttributes(c request.CTX, user *model.User, patch *model.UserPatch) string {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckProviderAttributes")
|
||||
|
||||
@@ -1669,7 +1669,7 @@ func (a *OpenTracingAppLayer) CompareAndSetPluginKey(pluginID string, key string
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CompleteOAuth(c *request.Context, service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) CompleteOAuth(c request.CTX, service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteOAuth")
|
||||
|
||||
@@ -1691,7 +1691,7 @@ func (a *OpenTracingAppLayer) CompleteOAuth(c *request.Context, service string,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CompleteOnboarding(c *request.Context, request *model.CompleteOnboardingRequest) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) CompleteOnboarding(c request.CTX, request *model.CompleteOnboardingRequest) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteOnboarding")
|
||||
|
||||
@@ -1713,7 +1713,7 @@ func (a *OpenTracingAppLayer) CompleteOnboarding(c *request.Context, request *mo
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CompleteSwitchWithOAuth(c *request.Context, service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) CompleteSwitchWithOAuth(c request.CTX, service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteSwitchWithOAuth")
|
||||
|
||||
@@ -2042,7 +2042,7 @@ func (a *OpenTracingAppLayer) CreateCommandWebhook(commandID string, args *model
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CreateDefaultMemberships(c *request.Context, params model.CreateDefaultMembershipParams) error {
|
||||
func (a *OpenTracingAppLayer) CreateDefaultMemberships(c request.CTX, params model.CreateDefaultMembershipParams) error {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateDefaultMemberships")
|
||||
|
||||
@@ -2196,7 +2196,7 @@ func (a *OpenTracingAppLayer) CreateIncomingWebhookForChannel(creatorId string,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CreateJob(c *request.Context, job *model.Job) (*model.Job, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) CreateJob(c request.CTX, job *model.Job) (*model.Job, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateJob")
|
||||
|
||||
@@ -2262,7 +2262,7 @@ func (a *OpenTracingAppLayer) CreateOAuthStateToken(extra string) (*model.Token,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CreateOAuthUser(c *request.Context, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) CreateOAuthUser(c request.CTX, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthUser")
|
||||
|
||||
@@ -2460,7 +2460,7 @@ func (a *OpenTracingAppLayer) CreateScheme(scheme *model.Scheme) (*model.Scheme,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CreateSession(c *request.Context, session *model.Session) (*model.Session, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) CreateSession(c request.CTX, session *model.Session) (*model.Session, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSession")
|
||||
|
||||
@@ -2526,7 +2526,7 @@ func (a *OpenTracingAppLayer) CreateTeam(c request.CTX, team *model.Team) (*mode
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CreateTeamWithUser(c *request.Context, team *model.Team, userID string) (*model.Team, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) CreateTeamWithUser(c request.CTX, team *model.Team, userID string) (*model.Team, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTeamWithUser")
|
||||
|
||||
@@ -2812,7 +2812,7 @@ func (a *OpenTracingAppLayer) DBHealthCheckWrite() error {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DeactivateGuests(c *request.Context) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) DeactivateGuests(c request.CTX) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateGuests")
|
||||
|
||||
@@ -2856,7 +2856,7 @@ func (a *OpenTracingAppLayer) DeactivateMfa(userID string) *model.AppError {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(c *request.Context, userID string, appID string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(c request.CTX, userID string, appID string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeauthorizeOAuthAppForUser")
|
||||
|
||||
@@ -2895,7 +2895,7 @@ func (a *OpenTracingAppLayer) DefaultChannelNames(c request.CTX) []string {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DeleteAcknowledgementForPost(c *request.Context, postID string, userID string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) DeleteAcknowledgementForPost(c request.CTX, postID string, userID string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteAcknowledgementForPost")
|
||||
|
||||
@@ -3152,7 +3152,7 @@ func (a *OpenTracingAppLayer) DeleteGroup(groupID string) (*model.Group, *model.
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DeleteGroupConstrainedMemberships(c *request.Context) error {
|
||||
func (a *OpenTracingAppLayer) DeleteGroupConstrainedMemberships(c request.CTX) error {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupConstrainedMemberships")
|
||||
|
||||
@@ -3416,7 +3416,7 @@ func (a *OpenTracingAppLayer) DeletePublicKey(name string) *model.AppError {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DeleteReactionForPost(c *request.Context, reaction *model.Reaction) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) DeleteReactionForPost(c request.CTX, reaction *model.Reaction) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteReactionForPost")
|
||||
|
||||
@@ -3592,7 +3592,7 @@ func (a *OpenTracingAppLayer) DeleteToken(token *model.Token) *model.AppError {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DemoteUserToGuest(c *request.Context, user *model.User) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) DemoteUserToGuest(c request.CTX, user *model.User) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DemoteUserToGuest")
|
||||
|
||||
@@ -3658,7 +3658,7 @@ func (a *OpenTracingAppLayer) DisablePlugin(id string) *model.AppError {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DisableUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) DisableUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableUserAccessToken")
|
||||
|
||||
@@ -3680,7 +3680,7 @@ func (a *OpenTracingAppLayer) DisableUserAccessToken(c *request.Context, token *
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DoActionRequest(c *request.Context, rawURL string, body []byte) (*http.Response, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) DoActionRequest(c request.CTX, rawURL string, body []byte) (*http.Response, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoActionRequest")
|
||||
|
||||
@@ -3806,7 +3806,7 @@ func (a *OpenTracingAppLayer) DoGuestRolesCreationMigration() {
|
||||
a.app.DoGuestRolesCreationMigration()
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DoLocalRequest(c *request.Context, rawURL string, body []byte) (*http.Response, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) DoLocalRequest(c request.CTX, rawURL string, body []byte) (*http.Response, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLocalRequest")
|
||||
|
||||
@@ -3828,7 +3828,7 @@ func (a *OpenTracingAppLayer) DoLocalRequest(c *request.Context, rawURL string,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DoLogin(c *request.Context, w http.ResponseWriter, r *http.Request, user *model.User, deviceID string, isMobile bool, isOAuthUser bool, isSaml bool) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) DoLogin(c request.CTX, w http.ResponseWriter, r *http.Request, user *model.User, deviceID string, isMobile bool, isOAuthUser bool, isSaml bool) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLogin")
|
||||
|
||||
@@ -3872,7 +3872,7 @@ func (a *OpenTracingAppLayer) DoPermissionsMigrations() error {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DoPostAction(c *request.Context, postID string, actionId string, userID string, selectedOption string) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) DoPostAction(c request.CTX, postID string, actionId string, userID string, selectedOption string) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostAction")
|
||||
|
||||
@@ -3894,7 +3894,7 @@ func (a *OpenTracingAppLayer) DoPostAction(c *request.Context, postID string, ac
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) DoPostActionWithCookie(c *request.Context, postID string, actionId string, userID string, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) DoPostActionWithCookie(c request.CTX, postID string, actionId string, userID string, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostActionWithCookie")
|
||||
|
||||
@@ -4041,7 +4041,7 @@ func (a *OpenTracingAppLayer) EnablePlugin(id string) *model.AppError {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) EnableUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) EnableUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnableUserAccessToken")
|
||||
|
||||
@@ -4102,7 +4102,7 @@ func (a *OpenTracingAppLayer) EnvironmentConfig(filter func(reflect.StructField)
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) ExecuteCommand(c *request.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) ExecuteCommand(c request.CTX, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExecuteCommand")
|
||||
|
||||
@@ -4644,7 +4644,7 @@ func (a *OpenTracingAppLayer) GeneratePublicLink(siteURL string, info *model.Fil
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GenerateSupportPacket(c *request.Context) []model.FileData {
|
||||
func (a *OpenTracingAppLayer) GenerateSupportPacket(c request.CTX) []model.FileData {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GenerateSupportPacket")
|
||||
|
||||
@@ -5035,7 +5035,7 @@ func (a *OpenTracingAppLayer) GetAuditsPage(userID string, page int, perPage int
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetAuthorizationCode(c *request.Context, w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetAuthorizationCode(c request.CTX, w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizationCode")
|
||||
|
||||
@@ -7012,7 +7012,7 @@ func (a *OpenTracingAppLayer) GetIncomingWebhooksPageByUser(userID string, page
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetJob(c *request.Context, id string) (*model.Job, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetJob(c request.CTX, id string) (*model.Job, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJob")
|
||||
|
||||
@@ -7034,7 +7034,7 @@ func (a *OpenTracingAppLayer) GetJob(c *request.Context, id string) (*model.Job,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetJobsByType(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetJobsByType(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByType")
|
||||
|
||||
@@ -7056,7 +7056,7 @@ func (a *OpenTracingAppLayer) GetJobsByType(c *request.Context, jobType string,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetJobsByTypePage(c *request.Context, jobType string, page int, perPage int) ([]*model.Job, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetJobsByTypePage(c request.CTX, jobType string, page int, perPage int) ([]*model.Job, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypePage")
|
||||
|
||||
@@ -7078,7 +7078,7 @@ func (a *OpenTracingAppLayer) GetJobsByTypePage(c *request.Context, jobType stri
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetJobsByTypes(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetJobsByTypes(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypes")
|
||||
|
||||
@@ -7100,7 +7100,7 @@ func (a *OpenTracingAppLayer) GetJobsByTypes(c *request.Context, jobTypes []stri
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetJobsByTypesPage(c *request.Context, jobType []string, page int, perPage int) ([]*model.Job, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetJobsByTypesPage(c request.CTX, jobType []string, page int, perPage int) ([]*model.Job, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypesPage")
|
||||
|
||||
@@ -7459,7 +7459,7 @@ func (a *OpenTracingAppLayer) GetNumberOfChannelsOnTeam(c request.CTX, teamID st
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetOAuthAccessTokenForCodeFlow(c *request.Context, clientId string, grantType string, redirectURI string, code string, secret string, refreshToken string) (*model.AccessResponse, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetOAuthAccessTokenForCodeFlow(c request.CTX, clientId string, grantType string, redirectURI string, code string, secret string, refreshToken string) (*model.AccessResponse, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForCodeFlow")
|
||||
|
||||
@@ -7481,7 +7481,7 @@ func (a *OpenTracingAppLayer) GetOAuthAccessTokenForCodeFlow(c *request.Context,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForImplicitFlow")
|
||||
|
||||
@@ -7591,7 +7591,7 @@ func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userID string, authRequest *m
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(c *request.Context, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(c request.CTX, userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthImplicitRedirect")
|
||||
|
||||
@@ -7613,7 +7613,7 @@ func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(c *request.Context, userI
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(c *request.Context, w http.ResponseWriter, r *http.Request, service string, teamID string, action string, redirectTo string, loginHint string, isMobile bool, desktopToken string) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(c request.CTX, w http.ResponseWriter, r *http.Request, service string, teamID string, action string, redirectTo string, loginHint string, isMobile bool, desktopToken string) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthLoginEndpoint")
|
||||
|
||||
@@ -7635,7 +7635,7 @@ func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(c *request.Context, w http.R
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(c *request.Context, w http.ResponseWriter, r *http.Request, service string, teamID string, desktopToken string) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(c request.CTX, w http.ResponseWriter, r *http.Request, service string, teamID string, desktopToken string) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthSignupEndpoint")
|
||||
|
||||
@@ -8566,7 +8566,7 @@ func (a *OpenTracingAppLayer) GetPrivateChannelsForTeam(c request.CTX, teamID st
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetProductNotices(c *request.Context, userID string, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetProductNotices(c request.CTX, userID string, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetProductNotices")
|
||||
|
||||
@@ -8979,7 +8979,7 @@ func (a *OpenTracingAppLayer) GetSamlCertificateStatus() *model.SamlCertificateS
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetSamlMetadata(c *request.Context) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetSamlMetadata(c request.CTX) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadata")
|
||||
|
||||
@@ -9211,7 +9211,7 @@ func (a *OpenTracingAppLayer) GetSession(token string) (*model.Session, *model.A
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetSessionById(c *request.Context, sessionID string) (*model.Session, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetSessionById(c request.CTX, sessionID string) (*model.Session, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessionById")
|
||||
|
||||
@@ -9250,7 +9250,7 @@ func (a *OpenTracingAppLayer) GetSessionLengthInMillis(session *model.Session) i
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetSessions(c *request.Context, userID string) ([]*model.Session, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetSessions(c request.CTX, userID string) ([]*model.Session, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessions")
|
||||
|
||||
@@ -9614,7 +9614,7 @@ func (a *OpenTracingAppLayer) GetStorageUsage() (int64, *model.AppError) {
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetSuggestions(c *request.Context, commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion {
|
||||
func (a *OpenTracingAppLayer) GetSuggestions(c request.CTX, commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSuggestions")
|
||||
|
||||
@@ -10533,7 +10533,7 @@ func (a *OpenTracingAppLayer) GetUserByUsername(username string) (*model.User, *
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetUserForLogin(c *request.Context, id string, loginId string) (*model.User, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetUserForLogin(c request.CTX, id string, loginId string) (*model.User, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserForLogin")
|
||||
|
||||
@@ -10621,7 +10621,7 @@ func (a *OpenTracingAppLayer) GetUsers(userIDs []string) ([]*model.User, *model.
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) GetUsersByGroupChannelIds(c *request.Context, channelIDs []string, asAdmin bool) (map[string][]*model.User, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) GetUsersByGroupChannelIds(c request.CTX, channelIDs []string, asAdmin bool) (map[string][]*model.User, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByGroupChannelIds")
|
||||
|
||||
@@ -11325,7 +11325,7 @@ func (a *OpenTracingAppLayer) HandleCommandResponsePost(c request.CTX, command *
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) HandleCommandWebhook(c *request.Context, hookID string, response *model.CommandResponse) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) HandleCommandWebhook(c request.CTX, hookID string, response *model.CommandResponse) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandWebhook")
|
||||
|
||||
@@ -11362,7 +11362,7 @@ func (a *OpenTracingAppLayer) HandleImages(previewPathList []string, thumbnailPa
|
||||
a.app.HandleImages(previewPathList, thumbnailPathList, fileData)
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) HandleIncomingWebhook(c *request.Context, hookID string, req *model.IncomingWebhookRequest) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) HandleIncomingWebhook(c request.CTX, hookID string, req *model.IncomingWebhookRequest) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleIncomingWebhook")
|
||||
|
||||
@@ -11631,7 +11631,7 @@ func (a *OpenTracingAppLayer) ImportPermissions(jsonl io.Reader) error {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) InitPlugins(c *request.Context, pluginDir string, webappPluginDir string) {
|
||||
func (a *OpenTracingAppLayer) InitPlugins(c request.CTX, pluginDir string, webappPluginDir string) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitPlugins")
|
||||
|
||||
@@ -11668,7 +11668,7 @@ func (a *OpenTracingAppLayer) InstallPlugin(pluginFile io.ReadSeeker, replace bo
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) InvalidateAllEmailInvites(c *request.Context) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) InvalidateAllEmailInvites(c request.CTX) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateAllEmailInvites")
|
||||
|
||||
@@ -11690,7 +11690,7 @@ func (a *OpenTracingAppLayer) InvalidateAllEmailInvites(c *request.Context) *mod
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) InvalidateAllResendInviteEmailJobs(c *request.Context) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) InvalidateAllResendInviteEmailJobs(c request.CTX) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateAllResendInviteEmailJobs")
|
||||
|
||||
@@ -12401,7 +12401,7 @@ func (a *OpenTracingAppLayer) LogAuditRecWithLevel(rec *audit.Record, level mlog
|
||||
a.app.LogAuditRecWithLevel(rec, level, err)
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) LoginByOAuth(c *request.Context, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) LoginByOAuth(c request.CTX, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LoginByOAuth")
|
||||
|
||||
@@ -12574,7 +12574,7 @@ func (a *OpenTracingAppLayer) MigrateFilenamesToFileInfos(post *model.Post) []*m
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) MigrateIdLDAP(c *request.Context, toAttribute string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) MigrateIdLDAP(c request.CTX, toAttribute string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MigrateIdLDAP")
|
||||
|
||||
@@ -12662,7 +12662,7 @@ func (a *OpenTracingAppLayer) MoveFile(oldPath string, newPath string) *model.Ap
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) NewPluginAPI(c *request.Context, manifest *model.Manifest) plugin.API {
|
||||
func (a *OpenTracingAppLayer) NewPluginAPI(c request.CTX, manifest *model.Manifest) plugin.API {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewPluginAPI")
|
||||
|
||||
@@ -12873,7 +12873,7 @@ func (a *OpenTracingAppLayer) PatchChannelModerationsForChannel(c request.CTX, c
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) PatchPost(c *request.Context, postID string, patch *model.PostPatch) (*model.Post, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) PatchPost(c request.CTX, postID string, patch *model.PostPatch) (*model.Post, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchPost")
|
||||
|
||||
@@ -13005,7 +13005,7 @@ func (a *OpenTracingAppLayer) PatchUser(c request.CTX, userID string, patch *mod
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) PermanentDeleteAllUsers(c *request.Context) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) PermanentDeleteAllUsers(c request.CTX) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteAllUsers")
|
||||
|
||||
@@ -13115,7 +13115,7 @@ func (a *OpenTracingAppLayer) PermanentDeleteTeamId(c request.CTX, teamID string
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) PermanentDeleteUser(c *request.Context, user *model.User) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) PermanentDeleteUser(c request.CTX, user *model.User) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteUser")
|
||||
|
||||
@@ -13400,7 +13400,7 @@ func (a *OpenTracingAppLayer) ProcessSlackText(text string) string {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) PromoteGuestToUser(c request.CTX, user *model.User, requestorId string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PromoteGuestToUser")
|
||||
|
||||
@@ -14149,7 +14149,7 @@ func (a *OpenTracingAppLayer) RenameTeam(team *model.Team, newTeamName string, n
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) RequestLicenseAndAckWarnMetric(c *request.Context, warnMetricId string, isBot bool) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) RequestLicenseAndAckWarnMetric(c request.CTX, warnMetricId string, isBot bool) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RequestLicenseAndAckWarnMetric")
|
||||
|
||||
@@ -14384,7 +14384,7 @@ func (a *OpenTracingAppLayer) ReturnSessionToPool(session *model.Session) {
|
||||
a.app.ReturnSessionToPool(session)
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) RevokeAccessToken(c *request.Context, token string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) RevokeAccessToken(c request.CTX, token string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAccessToken")
|
||||
|
||||
@@ -14406,7 +14406,7 @@ func (a *OpenTracingAppLayer) RevokeAccessToken(c *request.Context, token string
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) RevokeAllSessions(c *request.Context, userID string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) RevokeAllSessions(c request.CTX, userID string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAllSessions")
|
||||
|
||||
@@ -14428,7 +14428,7 @@ func (a *OpenTracingAppLayer) RevokeAllSessions(c *request.Context, userID strin
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) RevokeSession(c *request.Context, session *model.Session) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) RevokeSession(c request.CTX, session *model.Session) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSession")
|
||||
|
||||
@@ -14450,7 +14450,7 @@ func (a *OpenTracingAppLayer) RevokeSession(c *request.Context, session *model.S
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) RevokeSessionById(c *request.Context, sessionID string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) RevokeSessionById(c request.CTX, sessionID string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionById")
|
||||
|
||||
@@ -14472,7 +14472,7 @@ func (a *OpenTracingAppLayer) RevokeSessionById(c *request.Context, sessionID st
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(c *request.Context, userID string, deviceID string, currentSessionId string) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(c request.CTX, userID string, deviceID string, currentSessionId string) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsForDeviceId")
|
||||
|
||||
@@ -14516,7 +14516,7 @@ func (a *OpenTracingAppLayer) RevokeSessionsFromAllUsers() *model.AppError {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) RevokeUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) RevokeUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeUserAccessToken")
|
||||
|
||||
@@ -14648,7 +14648,7 @@ func (a *OpenTracingAppLayer) SanitizeTeams(session model.Session, teams []*mode
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SaveAcknowledgementForPost(c *request.Context, postID string, userID string) (*model.PostAcknowledgement, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SaveAcknowledgementForPost(c request.CTX, postID string, userID string) (*model.PostAcknowledgement, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveAcknowledgementForPost")
|
||||
|
||||
@@ -14780,7 +14780,7 @@ func (a *OpenTracingAppLayer) SaveConfig(newCfg *model.Config, sendConfigChangeC
|
||||
return resultVar0, resultVar1, resultVar2
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SaveReactionForPost(c *request.Context, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SaveReactionForPost(c request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveReactionForPost")
|
||||
|
||||
@@ -15056,7 +15056,7 @@ func (a *OpenTracingAppLayer) SearchEngine() *searchengine.Broker {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SearchFilesInTeamForUser(c *request.Context, terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.FileInfoList, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SearchFilesInTeamForUser(c request.CTX, terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.FileInfoList, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchFilesInTeamForUser")
|
||||
|
||||
@@ -15100,7 +15100,7 @@ func (a *OpenTracingAppLayer) SearchGroupChannels(c request.CTX, userID string,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SearchPostsForUser(c *request.Context, terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.PostSearchResults, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SearchPostsForUser(c request.CTX, terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.PostSearchResults, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsForUser")
|
||||
|
||||
@@ -15557,7 +15557,7 @@ func (a *OpenTracingAppLayer) SendNotifications(c request.CTX, post *model.Post,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SendNotifyAdminPosts(c *request.Context, workspaceName string, currentSKU string, trial bool) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) SendNotifyAdminPosts(c request.CTX, workspaceName string, currentSKU string, trial bool) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendNotifyAdminPosts")
|
||||
|
||||
@@ -16520,7 +16520,7 @@ func (a *OpenTracingAppLayer) SetTeamIconFromMultiPartFile(teamID string, file m
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SlackImport(c *request.Context, fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer) {
|
||||
func (a *OpenTracingAppLayer) SlackImport(c request.CTX, fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackImport")
|
||||
|
||||
@@ -16564,7 +16564,7 @@ func (a *OpenTracingAppLayer) SoftDeleteTeam(teamID string) *model.AppError {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SubmitInteractiveDialog(c *request.Context, request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SubmitInteractiveDialog(c request.CTX, request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SubmitInteractiveDialog")
|
||||
|
||||
@@ -16586,7 +16586,7 @@ func (a *OpenTracingAppLayer) SubmitInteractiveDialog(c *request.Context, reques
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SwitchEmailToLdap(c *request.Context, email string, password string, code string, ldapLoginId string, ldapPassword string) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SwitchEmailToLdap(c request.CTX, email string, password string, code string, ldapLoginId string, ldapPassword string) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToLdap")
|
||||
|
||||
@@ -16608,7 +16608,7 @@ func (a *OpenTracingAppLayer) SwitchEmailToLdap(c *request.Context, email string
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SwitchEmailToOAuth(c *request.Context, w http.ResponseWriter, r *http.Request, email string, password string, code string, service string) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SwitchEmailToOAuth(c request.CTX, w http.ResponseWriter, r *http.Request, email string, password string, code string, service string) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToOAuth")
|
||||
|
||||
@@ -16630,7 +16630,7 @@ func (a *OpenTracingAppLayer) SwitchEmailToOAuth(c *request.Context, w http.Resp
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SwitchLdapToEmail(c *request.Context, ldapPassword string, code string, email string, newPassword string) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SwitchLdapToEmail(c request.CTX, ldapPassword string, code string, email string, newPassword string) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchLdapToEmail")
|
||||
|
||||
@@ -16652,7 +16652,7 @@ func (a *OpenTracingAppLayer) SwitchLdapToEmail(c *request.Context, ldapPassword
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SwitchOAuthToEmail(c *request.Context, email string, password string, requesterId string) (string, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) SwitchOAuthToEmail(c request.CTX, email string, password string, requesterId string) (string, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchOAuthToEmail")
|
||||
|
||||
@@ -16674,7 +16674,7 @@ func (a *OpenTracingAppLayer) SwitchOAuthToEmail(c *request.Context, email strin
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) SyncLdap(c *request.Context, includeRemovedMembers bool) {
|
||||
func (a *OpenTracingAppLayer) SyncLdap(c request.CTX, includeRemovedMembers bool) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncLdap")
|
||||
|
||||
@@ -17032,7 +17032,7 @@ func (a *OpenTracingAppLayer) UnregisterPluginCommand(pluginID string, teamID st
|
||||
a.app.UnregisterPluginCommand(pluginID, teamID, trigger)
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) UpdateActive(c *request.Context, user *model.User, active bool) (*model.User, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) UpdateActive(c request.CTX, user *model.User, active bool) (*model.User, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateActive")
|
||||
|
||||
@@ -17054,7 +17054,7 @@ func (a *OpenTracingAppLayer) UpdateActive(c *request.Context, user *model.User,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) UpdateBotActive(c *request.Context, botUserId string, active bool) (*model.Bot, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) UpdateBotActive(c request.CTX, botUserId string, active bool) (*model.Bot, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBotActive")
|
||||
|
||||
@@ -17512,7 +17512,7 @@ func (a *OpenTracingAppLayer) UpdateOAuthApp(oldApp *model.OAuthApp, updatedApp
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) UpdateOAuthUserAttrs(c *request.Context, userData io.Reader, user *model.User, provider einterfaces.OAuthProvider, service string, tokenUser *model.User) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) UpdateOAuthUserAttrs(c request.CTX, userData io.Reader, user *model.User, provider einterfaces.OAuthProvider, service string, tokenUser *model.User) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOAuthUserAttrs")
|
||||
|
||||
@@ -17644,7 +17644,7 @@ func (a *OpenTracingAppLayer) UpdatePasswordSendEmail(c request.CTX, user *model
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) UpdatePost(c *request.Context, receivedUpdatedPost *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) UpdatePost(c request.CTX, receivedUpdatedPost *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePost")
|
||||
|
||||
@@ -18128,7 +18128,7 @@ func (a *OpenTracingAppLayer) UpdateUser(c request.CTX, user *model.User, sendNo
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) UpdateUserActive(c *request.Context, userID string, active bool) *model.AppError {
|
||||
func (a *OpenTracingAppLayer) UpdateUserActive(c request.CTX, userID string, active bool) *model.AppError {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserActive")
|
||||
|
||||
@@ -18378,7 +18378,7 @@ func (a *OpenTracingAppLayer) UploadFileForUserAndTeam(c request.CTX, data []byt
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) UploadFileX(c *request.Context, channelID string, name string, input io.Reader, opts ...func(*app.UploadFileTask)) (*model.FileInfo, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) UploadFileX(c request.CTX, channelID string, name string, input io.Reader, opts ...func(*app.UploadFileTask)) (*model.FileInfo, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFileX")
|
||||
|
||||
@@ -18400,7 +18400,7 @@ func (a *OpenTracingAppLayer) UploadFileX(c *request.Context, channelID string,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) UpsertDraft(c *request.Context, draft *model.Draft, connectionID string) (*model.Draft, *model.AppError) {
|
||||
func (a *OpenTracingAppLayer) UpsertDraft(c request.CTX, draft *model.Draft, connectionID string) (*model.Draft, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpsertDraft")
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ func (s *permissionsServiceWrapper) HasPermissionTo(userID string, permission *m
|
||||
return s.app.HasPermissionTo(userID, permission)
|
||||
}
|
||||
|
||||
func (s *permissionsServiceWrapper) HasPermissionToTeam(c *request.Context, userID string, teamID string, permission *model.Permission) bool {
|
||||
func (s *permissionsServiceWrapper) HasPermissionToTeam(c request.CTX, userID string, teamID string, permission *model.Permission) bool {
|
||||
return s.app.HasPermissionToTeam(c, userID, teamID, permission)
|
||||
}
|
||||
|
||||
func (s *permissionsServiceWrapper) HasPermissionToChannel(c *request.Context, askingUserID string, channelID string, permission *model.Permission) bool {
|
||||
func (s *permissionsServiceWrapper) HasPermissionToChannel(c request.CTX, askingUserID string, channelID string, permission *model.Permission) bool {
|
||||
return s.app.HasPermissionToChannel(c, askingUserID, channelID, permission)
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
type TestHelper struct {
|
||||
Context *request.Context
|
||||
Context request.CTX
|
||||
Service *PlatformService
|
||||
Suite SuiteIFace
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ func (ps *PlatformService) ReturnSessionToPool(session *model.Session) {
|
||||
}
|
||||
}
|
||||
|
||||
func (ps *PlatformService) CreateSession(c *request.Context, session *model.Session) (*model.Session, error) {
|
||||
func (ps *PlatformService) CreateSession(c request.CTX, session *model.Session) (*model.Session, error) {
|
||||
session.Token = ""
|
||||
|
||||
session, err := ps.Store.Session().Save(c, session)
|
||||
@@ -32,11 +32,11 @@ func (ps *PlatformService) CreateSession(c *request.Context, session *model.Sess
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (ps *PlatformService) GetSessionContext(c *request.Context, token string) (*model.Session, error) {
|
||||
func (ps *PlatformService) GetSessionContext(c request.CTX, token string) (*model.Session, error) {
|
||||
return ps.Store.Session().Get(c, token)
|
||||
}
|
||||
|
||||
func (ps *PlatformService) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (ps *PlatformService) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
return ps.Store.Session().GetSessions(c, userID)
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func (ps *PlatformService) ClearAllUsersSessionCache() {
|
||||
}
|
||||
}
|
||||
|
||||
func (ps *PlatformService) GetSession(c *request.Context, token string) (*model.Session, error) {
|
||||
func (ps *PlatformService) GetSession(c request.CTX, token string) (*model.Session, error) {
|
||||
var session = ps.sessionPool.Get().(*model.Session)
|
||||
if err := ps.sessionCache.Get(token, session); err == nil {
|
||||
if m := ps.metricsIFace; m != nil {
|
||||
@@ -115,7 +115,7 @@ func (ps *PlatformService) GetSession(c *request.Context, token string) (*model.
|
||||
return ps.GetSessionContext(c, token)
|
||||
}
|
||||
|
||||
func (ps *PlatformService) GetSessionByID(c *request.Context, sessionID string) (*model.Session, error) {
|
||||
func (ps *PlatformService) GetSessionByID(c request.CTX, sessionID string) (*model.Session, error) {
|
||||
return ps.Store.Session().Get(c, sessionID)
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ func (ps *PlatformService) RevokeSessionsFromAllUsers() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ps *PlatformService) RevokeSessionsForDeviceId(c *request.Context, userID string, deviceID string, currentSessionId string) error {
|
||||
func (ps *PlatformService) RevokeSessionsForDeviceId(c request.CTX, userID string, deviceID string, currentSessionId string) error {
|
||||
sessions, err := ps.Store.Session().GetSessions(c, userID)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -151,7 +151,7 @@ func (ps *PlatformService) RevokeSessionsForDeviceId(c *request.Context, userID
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ps *PlatformService) RevokeSession(c *request.Context, session *model.Session) error {
|
||||
func (ps *PlatformService) RevokeSession(c request.CTX, session *model.Session) error {
|
||||
if session.IsOAuth {
|
||||
if err := ps.RevokeAccessToken(c, session.Token); err != nil {
|
||||
return err
|
||||
@@ -167,7 +167,7 @@ func (ps *PlatformService) RevokeSession(c *request.Context, session *model.Sess
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ps *PlatformService) RevokeAccessToken(c *request.Context, token string) error {
|
||||
func (ps *PlatformService) RevokeAccessToken(c request.CTX, token string) error {
|
||||
session, _ := ps.GetSession(c, token)
|
||||
|
||||
defer ps.ReturnSessionToPool(session)
|
||||
@@ -222,7 +222,7 @@ func (ps *PlatformService) ExtendSessionExpiry(session *model.Session, newExpiry
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ps *PlatformService) UpdateSessionsIsGuest(c *request.Context, userID string, isGuest bool) error {
|
||||
func (ps *PlatformService) UpdateSessionsIsGuest(c request.CTX, userID string, isGuest bool) error {
|
||||
sessions, err := ps.GetSessions(c, userID)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -240,7 +240,7 @@ func (ps *PlatformService) UpdateSessionsIsGuest(c *request.Context, userID stri
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ps *PlatformService) RevokeAllSessions(c *request.Context, userID string) error {
|
||||
func (ps *PlatformService) RevokeAllSessions(c request.CTX, userID string) error {
|
||||
sessions, err := ps.Store.Session().GetSessions(c, userID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: %w", err.Error(), GetSessionError)
|
||||
|
||||
@@ -190,15 +190,15 @@ func (ch *Channels) syncPluginsActiveState() {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) NewPluginAPI(c *request.Context, manifest *model.Manifest) plugin.API {
|
||||
func (a *App) NewPluginAPI(c request.CTX, manifest *model.Manifest) plugin.API {
|
||||
return NewPluginAPI(a, c, manifest)
|
||||
}
|
||||
|
||||
func (a *App) InitPlugins(c *request.Context, pluginDir, webappPluginDir string) {
|
||||
func (a *App) InitPlugins(c request.CTX, pluginDir, webappPluginDir string) {
|
||||
a.ch.initPlugins(c, pluginDir, webappPluginDir)
|
||||
}
|
||||
|
||||
func (ch *Channels) initPlugins(c *request.Context, pluginDir, webappPluginDir string) {
|
||||
func (ch *Channels) initPlugins(c request.CTX, pluginDir, webappPluginDir string) {
|
||||
// Acquiring lock manually, as plugins might be disabled. See GetPluginsEnvironment.
|
||||
defer func() {
|
||||
ch.srv.Platform().SetPluginsEnvironment(ch)
|
||||
|
||||
@@ -23,12 +23,12 @@ import (
|
||||
type PluginAPI struct {
|
||||
id string
|
||||
app *App
|
||||
ctx *request.Context
|
||||
ctx request.CTX
|
||||
logger mlog.Sugar
|
||||
manifest *model.Manifest
|
||||
}
|
||||
|
||||
func NewPluginAPI(a *App, c *request.Context, manifest *model.Manifest) *PluginAPI {
|
||||
func NewPluginAPI(a *App, c request.CTX, manifest *model.Manifest) *PluginAPI {
|
||||
return &PluginAPI{
|
||||
id: manifest.Id,
|
||||
manifest: manifest,
|
||||
|
||||
@@ -71,7 +71,7 @@ func setDefaultPluginConfig(th *TestHelper, pluginID string) {
|
||||
})
|
||||
}
|
||||
|
||||
func setupMultiPluginAPITest(t *testing.T, pluginCodes []string, pluginManifests []string, pluginIDs []string, asMain bool, app *App, c *request.Context) string {
|
||||
func setupMultiPluginAPITest(t *testing.T, pluginCodes []string, pluginManifests []string, pluginIDs []string, asMain bool, app *App, c request.CTX) string {
|
||||
pluginDir, err := os.MkdirTemp("", "")
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() {
|
||||
@@ -126,7 +126,7 @@ func setupMultiPluginAPITest(t *testing.T, pluginCodes []string, pluginManifests
|
||||
return pluginDir
|
||||
}
|
||||
|
||||
func setupPluginAPITest(t *testing.T, pluginCode string, pluginManifest string, pluginID string, app *App, c *request.Context) string {
|
||||
func setupPluginAPITest(t *testing.T, pluginCode string, pluginManifest string, pluginID string, app *App, c request.CTX) string {
|
||||
asMain := pluginID != "test_db_driver"
|
||||
return setupMultiPluginAPITest(t,
|
||||
[]string{pluginCode}, []string{pluginManifest}, []string{pluginID},
|
||||
@@ -915,7 +915,7 @@ func TestInstallPlugin(t *testing.T) {
|
||||
// we need a modified version of setupPluginAPITest() because it wasn't possible to use it directly here
|
||||
// since it removes plugin dirs right after it returns, does not update App configs with the plugin
|
||||
// dirs and this behavior tends to break this test as a result.
|
||||
setupTest := func(t *testing.T, pluginCode string, pluginManifest string, pluginID string, app *App, c *request.Context) (func(), string) {
|
||||
setupTest := func(t *testing.T, pluginCode string, pluginManifest string, pluginID string, app *App, c request.CTX) (func(), string) {
|
||||
pluginDir, err := os.MkdirTemp("", "")
|
||||
require.NoError(t, err)
|
||||
webappPluginDir, err := os.MkdirTemp("", "")
|
||||
@@ -1834,7 +1834,7 @@ func (*MockSlashCommandProvider) GetCommand(a *App, T i18n.TranslateFunc) *model
|
||||
}
|
||||
}
|
||||
|
||||
func (mscp *MockSlashCommandProvider) DoCommand(a *App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (mscp *MockSlashCommandProvider) DoCommand(a *App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
mscp.Args = args
|
||||
mscp.Message = message
|
||||
return &model.CommandResponse{
|
||||
|
||||
@@ -42,7 +42,7 @@ type postServiceWrapper struct {
|
||||
app AppIface
|
||||
}
|
||||
|
||||
func (s *postServiceWrapper) CreatePost(ctx *request.Context, post *model.Post) (*model.Post, *model.AppError) {
|
||||
func (s *postServiceWrapper) CreatePost(ctx request.CTX, post *model.Post) (*model.Post, *model.AppError) {
|
||||
return s.app.CreatePostMissingChannel(ctx, post, true, true)
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func (s *postServiceWrapper) GetPostsByIds(postIDs []string) ([]*model.Post, int
|
||||
return s.app.GetPostsByIds(postIDs)
|
||||
}
|
||||
|
||||
func (s *postServiceWrapper) SendEphemeralPost(ctx *request.Context, userID string, post *model.Post) *model.Post {
|
||||
func (s *postServiceWrapper) SendEphemeralPost(ctx request.CTX, userID string, post *model.Post) *model.Post {
|
||||
return s.app.SendEphemeralPost(ctx, userID, post)
|
||||
}
|
||||
|
||||
@@ -58,11 +58,11 @@ func (s *postServiceWrapper) GetPost(postID string) (*model.Post, *model.AppErro
|
||||
return s.app.GetSinglePost(postID, false)
|
||||
}
|
||||
|
||||
func (s *postServiceWrapper) DeletePost(ctx *request.Context, postID, productID string) (*model.Post, *model.AppError) {
|
||||
func (s *postServiceWrapper) DeletePost(ctx request.CTX, postID, productID string) (*model.Post, *model.AppError) {
|
||||
return s.app.DeletePost(ctx, postID, productID)
|
||||
}
|
||||
|
||||
func (s *postServiceWrapper) UpdatePost(ctx *request.Context, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
func (s *postServiceWrapper) UpdatePost(ctx request.CTX, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
return s.app.UpdatePost(ctx, post, false)
|
||||
}
|
||||
|
||||
@@ -627,7 +627,7 @@ func (a *App) DeleteEphemeralPost(userID, postID string) {
|
||||
a.Publish(message)
|
||||
}
|
||||
|
||||
func (a *App) UpdatePost(c *request.Context, receivedUpdatedPost *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
func (a *App) UpdatePost(c request.CTX, receivedUpdatedPost *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
receivedUpdatedPost.SanitizeProps()
|
||||
|
||||
postLists, nErr := a.Srv().Store().Post().Get(context.Background(), receivedUpdatedPost.Id, model.GetPostsOptions{}, "", a.Config().GetSanitizeOptions())
|
||||
@@ -825,7 +825,7 @@ func (a *App) publishWebsocketEventForPermalinkPost(c request.CTX, post *model.P
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (a *App) PatchPost(c *request.Context, postID string, patch *model.PostPatch) (*model.Post, *model.AppError) {
|
||||
func (a *App) PatchPost(c request.CTX, postID string, patch *model.PostPatch) (*model.Post, *model.AppError) {
|
||||
post, err := a.GetSinglePost(postID, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1400,7 +1400,7 @@ func (a *App) deletePostFiles(postID string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) parseAndFetchChannelIdByNameFromInFilter(c *request.Context, channelName, userID, teamID string, includeDeleted bool) (*model.Channel, error) {
|
||||
func (a *App) parseAndFetchChannelIdByNameFromInFilter(c request.CTX, channelName, userID, teamID string, includeDeleted bool) (*model.Channel, error) {
|
||||
if strings.HasPrefix(channelName, "@") && strings.Contains(channelName, ",") {
|
||||
var userIDs []string
|
||||
users, err := a.GetUsersByUsernames(strings.Split(channelName[1:], ","), false, nil)
|
||||
@@ -1477,7 +1477,7 @@ func (a *App) searchPostsInTeam(teamID string, userID string, paramsList []*mode
|
||||
return posts, nil
|
||||
}
|
||||
|
||||
func (a *App) convertChannelNamesToChannelIds(c *request.Context, channels []string, userID string, teamID string, includeDeletedChannels bool) []string {
|
||||
func (a *App) convertChannelNamesToChannelIds(c request.CTX, channels []string, userID string, teamID string, includeDeletedChannels bool) []string {
|
||||
for idx, channelName := range channels {
|
||||
channel, err := a.parseAndFetchChannelIdByNameFromInFilter(c, channelName, userID, teamID, includeDeletedChannels)
|
||||
if err != nil {
|
||||
@@ -1608,7 +1608,7 @@ func (a *App) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams)
|
||||
})
|
||||
}
|
||||
|
||||
func (a *App) SearchPostsForUser(c *request.Context, terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError) {
|
||||
func (a *App) SearchPostsForUser(c request.CTX, terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError) {
|
||||
var postSearchResults *model.PostSearchResults
|
||||
paramsList := model.ParseSearchParams(strings.TrimSpace(terms), timeZoneOffset)
|
||||
includeDeleted := includeDeletedChannels && *a.Config().TeamSettings.ExperimentalViewArchivedChannels
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
)
|
||||
|
||||
func (a *App) SaveAcknowledgementForPost(c *request.Context, postID, userID string) (*model.PostAcknowledgement, *model.AppError) {
|
||||
func (a *App) SaveAcknowledgementForPost(c request.CTX, postID, userID string) (*model.PostAcknowledgement, *model.AppError) {
|
||||
post, err := a.GetSinglePost(postID, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -55,7 +55,7 @@ func (a *App) SaveAcknowledgementForPost(c *request.Context, postID, userID stri
|
||||
return acknowledgement, nil
|
||||
}
|
||||
|
||||
func (a *App) DeleteAcknowledgementForPost(c *request.Context, postID, userID string) *model.AppError {
|
||||
func (a *App) DeleteAcknowledgementForPost(c request.CTX, postID, userID string) *model.AppError {
|
||||
post, err := a.GetSinglePost(postID, false)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -229,7 +229,7 @@ func validateConfigEntry(conf *model.Config, path string, expectedValue any) boo
|
||||
}
|
||||
|
||||
// GetProductNotices is called from the frontend to fetch the product notices that are relevant to the caller
|
||||
func (a *App) GetProductNotices(c *request.Context, userID, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) {
|
||||
func (a *App) GetProductNotices(c request.CTX, userID, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) {
|
||||
isSystemAdmin := a.SessionHasPermissionTo(*c.Session(), model.PermissionManageSystem)
|
||||
isTeamAdmin := a.SessionHasPermissionToTeam(*c.Session(), teamID, model.PermissionManageTeam)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/mattermost/mattermost/server/public/shared/request"
|
||||
)
|
||||
|
||||
func (a *App) SaveReactionForPost(c *request.Context, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
||||
func (a *App) SaveReactionForPost(c request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
||||
post, err := a.GetSinglePost(reaction.PostId, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -100,7 +100,7 @@ func populateEmptyReactions(postIDs []string, reactions map[string][]*model.Reac
|
||||
return reactions
|
||||
}
|
||||
|
||||
func (a *App) DeleteReactionForPost(c *request.Context, reaction *model.Reaction) *model.AppError {
|
||||
func (a *App) DeleteReactionForPost(c request.CTX, reaction *model.Reaction) *model.AppError {
|
||||
post, err := a.GetSinglePost(reaction.PostId, false)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -23,7 +23,7 @@ const (
|
||||
SamlIdpCertificateName = "saml-idp.crt"
|
||||
)
|
||||
|
||||
func (a *App) GetSamlMetadata(c *request.Context) (string, *model.AppError) {
|
||||
func (a *App) GetSamlMetadata(c request.CTX) (string, *model.AppError) {
|
||||
if a.Saml() == nil {
|
||||
err := model.NewAppError("GetSamlMetadata", "api.admin.saml.not_available.app_error", nil, "", http.StatusNotImplemented)
|
||||
return "", err
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
)
|
||||
|
||||
func (a *App) CreateSession(c *request.Context, session *model.Session) (*model.Session, *model.AppError) {
|
||||
func (a *App) CreateSession(c request.CTX, session *model.Session) (*model.Session, *model.AppError) {
|
||||
session, err := a.ch.srv.platform.CreateSession(c, session)
|
||||
if err != nil {
|
||||
var invErr *store.ErrInvalidInput
|
||||
@@ -127,7 +127,7 @@ func (a *App) GetSession(token string) (*model.Session, *model.AppError) {
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (a *App) GetSessions(c *request.Context, userID string) ([]*model.Session, *model.AppError) {
|
||||
func (a *App) GetSessions(c request.CTX, userID string) ([]*model.Session, *model.AppError) {
|
||||
sessions, err := a.ch.srv.platform.GetSessions(c, userID)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("GetSessions", "app.session.get_sessions.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
@@ -136,7 +136,7 @@ func (a *App) GetSessions(c *request.Context, userID string) ([]*model.Session,
|
||||
return sessions, nil
|
||||
}
|
||||
|
||||
func (a *App) RevokeAllSessions(c *request.Context, userID string) *model.AppError {
|
||||
func (a *App) RevokeAllSessions(c request.CTX, userID string) *model.AppError {
|
||||
if err := a.ch.srv.platform.RevokeAllSessions(c, userID); err != nil {
|
||||
switch {
|
||||
case errors.Is(err, platform.GetSessionError):
|
||||
@@ -190,7 +190,7 @@ func (a *App) ClearSessionCacheForAllUsersSkipClusterSend() {
|
||||
a.Srv().Platform().ClearSessionCacheForAllUsersSkipClusterSend()
|
||||
}
|
||||
|
||||
func (a *App) RevokeSessionsForDeviceId(c *request.Context, userID string, deviceID string, currentSessionId string) *model.AppError {
|
||||
func (a *App) RevokeSessionsForDeviceId(c request.CTX, userID string, deviceID string, currentSessionId string) *model.AppError {
|
||||
if err := a.ch.srv.platform.RevokeSessionsForDeviceId(c, userID, deviceID, currentSessionId); err != nil {
|
||||
return model.NewAppError("RevokeSessionsForDeviceId", "app.session.get_sessions.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
@@ -198,7 +198,7 @@ func (a *App) RevokeSessionsForDeviceId(c *request.Context, userID string, devic
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) GetSessionById(c *request.Context, sessionID string) (*model.Session, *model.AppError) {
|
||||
func (a *App) GetSessionById(c request.CTX, sessionID string) (*model.Session, *model.AppError) {
|
||||
session, err := a.ch.srv.platform.GetSessionByID(c, sessionID)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("GetSessionById", "app.session.get.app_error", nil, "", http.StatusBadRequest).Wrap(err)
|
||||
@@ -207,7 +207,7 @@ func (a *App) GetSessionById(c *request.Context, sessionID string) (*model.Sessi
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (a *App) RevokeSessionById(c *request.Context, sessionID string) *model.AppError {
|
||||
func (a *App) RevokeSessionById(c request.CTX, sessionID string) *model.AppError {
|
||||
session, err := a.GetSessionById(c, sessionID)
|
||||
if err != nil {
|
||||
return model.NewAppError("RevokeSessionById", "app.session.get.app_error", nil, "", http.StatusBadRequest).Wrap(err)
|
||||
@@ -216,7 +216,7 @@ func (a *App) RevokeSessionById(c *request.Context, sessionID string) *model.App
|
||||
return a.RevokeSession(c, session)
|
||||
}
|
||||
|
||||
func (a *App) RevokeSession(c *request.Context, session *model.Session) *model.AppError {
|
||||
func (a *App) RevokeSession(c request.CTX, session *model.Session) *model.AppError {
|
||||
if err := a.ch.srv.platform.RevokeSession(c, session); err != nil {
|
||||
switch {
|
||||
case errors.Is(err, platform.DeleteSessionError):
|
||||
@@ -351,7 +351,7 @@ func (a *App) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAc
|
||||
return token, nil
|
||||
}
|
||||
|
||||
func (a *App) createSessionForUserAccessToken(c *request.Context, tokenString string) (*model.Session, *model.AppError) {
|
||||
func (a *App) createSessionForUserAccessToken(c request.CTX, tokenString string) (*model.Session, *model.AppError) {
|
||||
token, nErr := a.Srv().Store().UserAccessToken().GetByToken(tokenString)
|
||||
if nErr != nil {
|
||||
return nil, model.NewAppError("createSessionForUserAccessToken", "app.user_access_token.invalid_or_missing", nil, "", http.StatusUnauthorized).Wrap(nErr)
|
||||
@@ -415,7 +415,7 @@ func (a *App) createSessionForUserAccessToken(c *request.Context, tokenString st
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (a *App) RevokeUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError {
|
||||
func (a *App) RevokeUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError {
|
||||
var session *model.Session
|
||||
session, _ = a.ch.srv.platform.GetSessionContext(c, token.Token)
|
||||
|
||||
@@ -430,7 +430,7 @@ func (a *App) RevokeUserAccessToken(c *request.Context, token *model.UserAccessT
|
||||
return a.RevokeSession(c, session)
|
||||
}
|
||||
|
||||
func (a *App) DisableUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError {
|
||||
func (a *App) DisableUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError {
|
||||
var session *model.Session
|
||||
session, _ = a.ch.srv.platform.GetSessionContext(c, token.Token)
|
||||
|
||||
@@ -445,7 +445,7 @@ func (a *App) DisableUserAccessToken(c *request.Context, token *model.UserAccess
|
||||
return a.RevokeSession(c, session)
|
||||
}
|
||||
|
||||
func (a *App) EnableUserAccessToken(c *request.Context, token *model.UserAccessToken) *model.AppError {
|
||||
func (a *App) EnableUserAccessToken(c request.CTX, token *model.UserAccessToken) *model.AppError {
|
||||
var session *model.Session
|
||||
session, _ = a.ch.srv.platform.GetSessionContext(c, token.Token)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/platform/services/slackimport"
|
||||
)
|
||||
|
||||
func (a *App) SlackImport(c *request.Context, fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer) {
|
||||
func (a *App) SlackImport(c request.CTX, fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer) {
|
||||
actions := slackimport.Actions{
|
||||
UpdateActive: func(user *model.User, active bool) (*model.User, *model.AppError) {
|
||||
return a.UpdateActive(c, user, active)
|
||||
|
||||
@@ -34,7 +34,7 @@ func (*AwayProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command
|
||||
}
|
||||
}
|
||||
|
||||
func (*AwayProvider) DoCommand(a *app.App, _ *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*AwayProvider) DoCommand(a *app.App, _ request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
a.SetStatusAwayIfNeeded(args.UserId, true)
|
||||
|
||||
return &model.CommandResponse{ResponseType: model.CommandResponseTypeEphemeral, Text: args.T("api.command_away.success")}
|
||||
|
||||
@@ -35,7 +35,7 @@ func (*HeaderProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comma
|
||||
}
|
||||
}
|
||||
|
||||
func (*HeaderProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*HeaderProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
channel, err := a.GetChannel(c, args.ChannelId)
|
||||
if err != nil {
|
||||
return &model.CommandResponse{
|
||||
|
||||
@@ -35,7 +35,7 @@ func (*PurposeProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comm
|
||||
}
|
||||
}
|
||||
|
||||
func (*PurposeProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*PurposeProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
channel, err := a.GetChannel(c, args.ChannelId)
|
||||
if err != nil {
|
||||
return &model.CommandResponse{
|
||||
|
||||
@@ -38,7 +38,7 @@ func (*RenameProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comma
|
||||
}
|
||||
}
|
||||
|
||||
func (*RenameProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*RenameProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
channel, err := a.GetChannel(c, args.ChannelId)
|
||||
if err != nil {
|
||||
return &model.CommandResponse{
|
||||
|
||||
@@ -37,7 +37,7 @@ func (*CodeProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command
|
||||
}
|
||||
}
|
||||
|
||||
func (*CodeProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*CodeProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
if message == "" {
|
||||
return &model.CommandResponse{Text: args.T("api.command_code.message.app_error"), ResponseType: model.CommandResponseTypeEphemeral}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ func (*CustomStatusProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model
|
||||
}
|
||||
}
|
||||
|
||||
func (*CustomStatusProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*CustomStatusProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
if !*a.Config().TeamSettings.EnableCustomUserStatuses {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ func (*DndProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command
|
||||
}
|
||||
}
|
||||
|
||||
func (*DndProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*DndProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
a.SetStatusDoNotDisturb(args.UserId)
|
||||
|
||||
return &model.CommandResponse{ResponseType: model.CommandResponseTypeEphemeral, Text: args.T("api.command_dnd.success")}
|
||||
|
||||
@@ -42,7 +42,7 @@ func (*EchoProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command
|
||||
}
|
||||
}
|
||||
|
||||
func (*EchoProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*EchoProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
if message == "" {
|
||||
return &model.CommandResponse{Text: args.T("api.command_echo.message.app_error"), ResponseType: model.CommandResponseTypeEphemeral}
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ func (*CollapseProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Com
|
||||
}
|
||||
}
|
||||
|
||||
func (*ExpandProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*ExpandProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
return setCollapsePreference(a, args, false)
|
||||
}
|
||||
|
||||
func (*CollapseProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*CollapseProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
return setCollapsePreference(a, args, true)
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ func (*ExportLinkProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.C
|
||||
}
|
||||
}
|
||||
|
||||
func (*ExportLinkProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*ExportLinkProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
if !a.SessionHasPermissionTo(*c.Session(), model.PermissionManageSystem) {
|
||||
return &model.CommandResponse{ResponseType: model.CommandResponseTypeEphemeral, Text: args.T("api.command_exportlink.permission.app_error")}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ func (*groupmsgProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Com
|
||||
}
|
||||
}
|
||||
|
||||
func (*groupmsgProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*groupmsgProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
targetUsers := map[string]*model.User{}
|
||||
targetUsersSlice := []string{args.UserId}
|
||||
invalidUsernames := []string{}
|
||||
|
||||
@@ -34,7 +34,7 @@ func (h *HelpProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comma
|
||||
}
|
||||
}
|
||||
|
||||
func (h *HelpProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (h *HelpProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
helpLink := *a.Config().SupportSettings.HelpLink
|
||||
|
||||
if helpLink == "" {
|
||||
|
||||
@@ -48,14 +48,14 @@ func (*InviteProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comma
|
||||
}
|
||||
}
|
||||
|
||||
func (i *InviteProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (i *InviteProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
return &model.CommandResponse{
|
||||
Text: i.doCommand(a, c, args, message),
|
||||
ResponseType: model.CommandResponseTypeEphemeral,
|
||||
}
|
||||
}
|
||||
|
||||
func (i *InviteProvider) doCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) string {
|
||||
func (i *InviteProvider) doCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) string {
|
||||
if message == "" {
|
||||
return args.T("api.command_invite.missing_message.app_error")
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ func (*InvitePeopleProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model
|
||||
}
|
||||
}
|
||||
|
||||
func (*InvitePeopleProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*InvitePeopleProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
if !a.HasPermissionToTeam(c, args.UserId, args.TeamId, model.PermissionInviteUser) {
|
||||
return &model.CommandResponse{Text: args.T("api.command_invite_people.permission.app_error"), ResponseType: model.CommandResponseTypeEphemeral}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func (*JoinProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command
|
||||
}
|
||||
}
|
||||
|
||||
func (*JoinProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*JoinProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
channelName := strings.ToLower(message)
|
||||
|
||||
if strings.HasPrefix(message, "~") {
|
||||
|
||||
@@ -34,7 +34,7 @@ func (*LeaveProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comman
|
||||
}
|
||||
}
|
||||
|
||||
func (*LeaveProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*LeaveProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
var channel *model.Channel
|
||||
var noChannelErr *model.AppError
|
||||
if channel, noChannelErr = a.GetChannel(c, args.ChannelId); noChannelErr != nil {
|
||||
|
||||
@@ -139,7 +139,7 @@ func (*LoadTestProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Com
|
||||
}
|
||||
}
|
||||
|
||||
func (lt *LoadTestProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (lt *LoadTestProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
commandResponse, err := lt.doCommand(a, c, args, message)
|
||||
if err != nil {
|
||||
c.Logger().Error("failed command /"+CmdTest, mlog.Err(err))
|
||||
@@ -148,7 +148,7 @@ func (lt *LoadTestProvider) DoCommand(a *app.App, c *request.Context, args *mode
|
||||
return commandResponse
|
||||
}
|
||||
|
||||
func (lt *LoadTestProvider) doCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) (*model.CommandResponse, error) {
|
||||
func (lt *LoadTestProvider) doCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) (*model.CommandResponse, error) {
|
||||
//This command is only available when EnableTesting is true
|
||||
if !*a.Config().ServiceSettings.EnableTesting {
|
||||
return &model.CommandResponse{}, nil
|
||||
@@ -291,7 +291,7 @@ func (*LoadTestProvider) SetupCommand(a *app.App, c request.CTX, args *model.Com
|
||||
return &model.CommandResponse{Text: "Created environment", ResponseType: model.CommandResponseTypeEphemeral}, nil
|
||||
}
|
||||
|
||||
func (*LoadTestProvider) ActivateUserCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) (*model.CommandResponse, error) {
|
||||
func (*LoadTestProvider) ActivateUserCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) (*model.CommandResponse, error) {
|
||||
user_id := strings.TrimSpace(strings.TrimPrefix(message, "activate_user"))
|
||||
if err := a.UpdateUserActive(c, user_id, true); err != nil {
|
||||
return &model.CommandResponse{Text: "Failed to activate user", ResponseType: model.CommandResponseTypeEphemeral}, err
|
||||
@@ -300,7 +300,7 @@ func (*LoadTestProvider) ActivateUserCommand(a *app.App, c *request.Context, arg
|
||||
return &model.CommandResponse{Text: "Activated user", ResponseType: model.CommandResponseTypeEphemeral}, nil
|
||||
}
|
||||
|
||||
func (*LoadTestProvider) DeActivateUserCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) (*model.CommandResponse, error) {
|
||||
func (*LoadTestProvider) DeActivateUserCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) (*model.CommandResponse, error) {
|
||||
user_id := strings.TrimSpace(strings.TrimPrefix(message, "deactivate_user"))
|
||||
if err := a.UpdateUserActive(c, user_id, false); err != nil {
|
||||
return &model.CommandResponse{Text: "Failed to deactivate user", ResponseType: model.CommandResponseTypeEphemeral}, err
|
||||
|
||||
@@ -35,7 +35,7 @@ func (*LogoutProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comma
|
||||
}
|
||||
}
|
||||
|
||||
func (*LogoutProvider) DoCommand(a *app.App, _ *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*LogoutProvider) DoCommand(a *app.App, _ request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
// Actual logout is handled client side.
|
||||
return &model.CommandResponse{GotoLocation: "/login"}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func (h *MarketplaceProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *mode
|
||||
}
|
||||
}
|
||||
|
||||
func (h *MarketplaceProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (h *MarketplaceProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
// This command is handled client-side and shouldn't hit the server.
|
||||
return &model.CommandResponse{
|
||||
Text: args.T("api.command_marketplace.unsupported.app_error"),
|
||||
|
||||
@@ -35,7 +35,7 @@ func (*MeProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
}
|
||||
}
|
||||
|
||||
func (*MeProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*MeProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
return &model.CommandResponse{
|
||||
ResponseType: model.CommandResponseTypeInChannel,
|
||||
Type: model.PostTypeMe,
|
||||
|
||||
@@ -40,7 +40,7 @@ func (*msgProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command
|
||||
}
|
||||
}
|
||||
|
||||
func (*msgProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*msgProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
splitMessage := strings.SplitN(message, " ", 2)
|
||||
|
||||
parsedMessage := ""
|
||||
|
||||
@@ -37,7 +37,7 @@ func (*MuteProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command
|
||||
}
|
||||
}
|
||||
|
||||
func (*MuteProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*MuteProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
var channel *model.Channel
|
||||
var noChannelErr *model.AppError
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ func (*OfflineProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comm
|
||||
}
|
||||
}
|
||||
|
||||
func (*OfflineProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*OfflineProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
a.SetStatusOffline(args.UserId, true)
|
||||
|
||||
return &model.CommandResponse{ResponseType: model.CommandResponseTypeEphemeral, Text: args.T("api.command_offline.success")}
|
||||
|
||||
@@ -34,7 +34,7 @@ func (*OnlineProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comma
|
||||
}
|
||||
}
|
||||
|
||||
func (*OnlineProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*OnlineProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
a.SetStatusOnline(args.UserId, true)
|
||||
|
||||
return &model.CommandResponse{ResponseType: model.CommandResponseTypeEphemeral, Text: args.T("api.command_online.success")}
|
||||
|
||||
@@ -68,7 +68,7 @@ func (rp *RemoteProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Co
|
||||
}
|
||||
}
|
||||
|
||||
func (rp *RemoteProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (rp *RemoteProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
if !a.HasPermissionTo(args.UserId, model.PermissionManageSecureConnections) {
|
||||
return responsef(args.T("api.command_remote.permission_required", map[string]any{"Permission": "manage_secure_connections"}))
|
||||
}
|
||||
|
||||
@@ -57,15 +57,15 @@ func (*KickProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command
|
||||
}
|
||||
}
|
||||
|
||||
func (*RemoveProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*RemoveProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
return doCommand(a, c, args, message)
|
||||
}
|
||||
|
||||
func (*KickProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*KickProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
return doCommand(a, c, args, message)
|
||||
}
|
||||
|
||||
func doCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func doCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
channel, err := a.GetChannel(c, args.ChannelId)
|
||||
if err != nil {
|
||||
return &model.CommandResponse{
|
||||
|
||||
@@ -35,7 +35,7 @@ func (search *SearchProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *mode
|
||||
}
|
||||
}
|
||||
|
||||
func (search *SearchProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (search *SearchProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
// This command is handled client-side and shouldn't hit the server.
|
||||
return &model.CommandResponse{
|
||||
Text: args.T("api.command_search.unsupported.app_error"),
|
||||
|
||||
@@ -35,7 +35,7 @@ func (settings *SettingsProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *
|
||||
}
|
||||
}
|
||||
|
||||
func (settings *SettingsProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (settings *SettingsProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
// This command is handled client-side and shouldn't hit the server.
|
||||
return &model.CommandResponse{
|
||||
Text: args.T("api.command_settings.unsupported.app_error"),
|
||||
|
||||
@@ -119,7 +119,7 @@ func (sp *ShareProvider) getAutoCompleteUnInviteRemote(a *app.App, _ *model.Comm
|
||||
}
|
||||
}
|
||||
|
||||
func (sp *ShareProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (sp *ShareProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
if !a.HasPermissionTo(args.UserId, model.PermissionManageSharedChannels) {
|
||||
return responsef(args.T("api.command_share.permission_required", map[string]any{"Permission": "manage_shared_channels"}))
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ func (*ShortcutsProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Co
|
||||
}
|
||||
}
|
||||
|
||||
func (*ShortcutsProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*ShortcutsProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
// This command is handled client-side and shouldn't hit the server.
|
||||
return &model.CommandResponse{
|
||||
Text: args.T("api.command_shortcuts.unsupported.app_error"),
|
||||
|
||||
@@ -35,7 +35,7 @@ func (*ShrugProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Comman
|
||||
}
|
||||
}
|
||||
|
||||
func (*ShrugProvider) DoCommand(a *app.App, c *request.Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (*ShrugProvider) DoCommand(a *app.App, c request.CTX, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
rmsg := `¯\\\_(ツ)\_/¯`
|
||||
if message != "" {
|
||||
rmsg = message + " " + rmsg
|
||||
|
||||
@@ -27,7 +27,7 @@ const (
|
||||
cpuProfileDuration = 5 * time.Second
|
||||
)
|
||||
|
||||
func (a *App) GenerateSupportPacket(c *request.Context) []model.FileData {
|
||||
func (a *App) GenerateSupportPacket(c request.CTX) []model.FileData {
|
||||
// If any errors we come across within this function, we will log it in a warning.txt file so that we know why certain files did not get produced if any
|
||||
var warnings []string
|
||||
|
||||
@@ -35,7 +35,7 @@ func (a *App) GenerateSupportPacket(c *request.Context) []model.FileData {
|
||||
fileDatas := []model.FileData{}
|
||||
|
||||
// A array of the functions that we can iterate through since they all have the same return value
|
||||
functions := map[string]func(c *request.Context) (*model.FileData, error){
|
||||
functions := map[string]func(c request.CTX) (*model.FileData, error){
|
||||
"support package": a.generateSupportPacketYaml,
|
||||
"plugins": a.createPluginsFile,
|
||||
"config": a.createSanitizedConfigFile,
|
||||
@@ -68,7 +68,7 @@ func (a *App) GenerateSupportPacket(c *request.Context) []model.FileData {
|
||||
return fileDatas
|
||||
}
|
||||
|
||||
func (a *App) generateSupportPacketYaml(c *request.Context) (*model.FileData, error) {
|
||||
func (a *App) generateSupportPacketYaml(c request.CTX) (*model.FileData, error) {
|
||||
var rErr error
|
||||
|
||||
/* DB */
|
||||
@@ -234,7 +234,7 @@ func (a *App) generateSupportPacketYaml(c *request.Context) (*model.FileData, er
|
||||
return fileData, rErr
|
||||
}
|
||||
|
||||
func (a *App) createPluginsFile(_ *request.Context) (*model.FileData, error) {
|
||||
func (a *App) createPluginsFile(_ request.CTX) (*model.FileData, error) {
|
||||
// Getting the plugins installed on the server, prettify it, and then add them to the file data array
|
||||
pluginsResponse, appErr := a.GetPlugins()
|
||||
if appErr != nil {
|
||||
@@ -253,7 +253,7 @@ func (a *App) createPluginsFile(_ *request.Context) (*model.FileData, error) {
|
||||
return fileData, nil
|
||||
}
|
||||
|
||||
func (a *App) getNotificationsLog(_ *request.Context) (*model.FileData, error) {
|
||||
func (a *App) getNotificationsLog(_ request.CTX) (*model.FileData, error) {
|
||||
if !*a.Config().NotificationLogSettings.EnableFile {
|
||||
return nil, errors.New("Unable to retrieve notifications.log because LogSettings: EnableFile is set to false")
|
||||
}
|
||||
@@ -271,7 +271,7 @@ func (a *App) getNotificationsLog(_ *request.Context) (*model.FileData, error) {
|
||||
return fileData, nil
|
||||
}
|
||||
|
||||
func (a *App) getMattermostLog(_ *request.Context) (*model.FileData, error) {
|
||||
func (a *App) getMattermostLog(_ request.CTX) (*model.FileData, error) {
|
||||
if !*a.Config().LogSettings.EnableFile {
|
||||
return nil, errors.New("Unable to retrieve mattermost.log because LogSettings: EnableFile is set to false")
|
||||
}
|
||||
@@ -289,7 +289,7 @@ func (a *App) getMattermostLog(_ *request.Context) (*model.FileData, error) {
|
||||
return fileData, nil
|
||||
}
|
||||
|
||||
func (a *App) createSanitizedConfigFile(_ *request.Context) (*model.FileData, error) {
|
||||
func (a *App) createSanitizedConfigFile(_ request.CTX) (*model.FileData, error) {
|
||||
// Getting sanitized config, prettifying it, and then adding it to our file data array
|
||||
sanitizedConfigPrettyJSON, err := json.MarshalIndent(a.GetSanitizedConfig(), "", " ")
|
||||
if err != nil {
|
||||
@@ -303,7 +303,7 @@ func (a *App) createSanitizedConfigFile(_ *request.Context) (*model.FileData, er
|
||||
return fileData, nil
|
||||
}
|
||||
|
||||
func (a *App) createCPUProfile(_ *request.Context) (*model.FileData, error) {
|
||||
func (a *App) createCPUProfile(_ request.CTX) (*model.FileData, error) {
|
||||
var b bytes.Buffer
|
||||
|
||||
err := pprof.StartCPUProfile(&b)
|
||||
@@ -322,7 +322,7 @@ func (a *App) createCPUProfile(_ *request.Context) (*model.FileData, error) {
|
||||
return fileData, nil
|
||||
}
|
||||
|
||||
func (a *App) createHeapProfile(*request.Context) (*model.FileData, error) {
|
||||
func (a *App) createHeapProfile(request.CTX) (*model.FileData, error) {
|
||||
var b bytes.Buffer
|
||||
|
||||
err := pprof.Lookup("heap").WriteTo(&b, 0)
|
||||
@@ -337,7 +337,7 @@ func (a *App) createHeapProfile(*request.Context) (*model.FileData, error) {
|
||||
return fileData, nil
|
||||
}
|
||||
|
||||
func (a *App) createGoroutineProfile(_ *request.Context) (*model.FileData, error) {
|
||||
func (a *App) createGoroutineProfile(_ request.CTX) (*model.FileData, error) {
|
||||
var b bytes.Buffer
|
||||
|
||||
err := pprof.Lookup("goroutine").WriteTo(&b, 2)
|
||||
|
||||
@@ -121,7 +121,7 @@ func (a *App) createDefaultTeamMemberships(c request.CTX, params model.CreateDef
|
||||
// are configured to sync with teams and channels for group members on or after the given timestamp.
|
||||
// If includeRemovedMembers is true, then members who left or were removed from a team/channel will
|
||||
// be re-added; otherwise, they will not be re-added.
|
||||
func (a *App) CreateDefaultMemberships(c *request.Context, params model.CreateDefaultMembershipParams) error {
|
||||
func (a *App) CreateDefaultMemberships(c request.CTX, params model.CreateDefaultMembershipParams) error {
|
||||
err := a.createDefaultTeamMemberships(c, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -137,7 +137,7 @@ func (a *App) CreateDefaultMemberships(c *request.Context, params model.CreateDe
|
||||
|
||||
// DeleteGroupConstrainedMemberships deletes team and channel memberships of users who aren't members of the allowed
|
||||
// groups of all group-constrained teams and channels.
|
||||
func (a *App) DeleteGroupConstrainedMemberships(c *request.Context) error {
|
||||
func (a *App) DeleteGroupConstrainedMemberships(c request.CTX) error {
|
||||
err := a.deleteGroupConstrainedChannelMemberships(c, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -40,7 +40,7 @@ func (w *teamServiceWrapper) GetMember(c request.CTX, teamID, userID string) (*m
|
||||
return w.app.GetTeamMember(c, teamID, userID)
|
||||
}
|
||||
|
||||
func (w *teamServiceWrapper) CreateMember(ctx *request.Context, teamID, userID string) (*model.TeamMember, *model.AppError) {
|
||||
func (w *teamServiceWrapper) CreateMember(ctx request.CTX, teamID, userID string) (*model.TeamMember, *model.AppError) {
|
||||
return w.app.AddTeamMember(ctx, teamID, userID)
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ func (a *App) CreateTeam(c request.CTX, team *model.Team) (*model.Team, *model.A
|
||||
return rteam, nil
|
||||
}
|
||||
|
||||
func (a *App) CreateTeamWithUser(c *request.Context, team *model.Team, userID string) (*model.Team, *model.AppError) {
|
||||
func (a *App) CreateTeamWithUser(c request.CTX, team *model.Team, userID string) (*model.Team, *model.AppError) {
|
||||
user, err := a.GetUser(userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -601,7 +601,7 @@ func (a *App) AddUserToTeam(c request.CTX, teamID string, userID string, userReq
|
||||
return team, teamMember, nil
|
||||
}
|
||||
|
||||
func (a *App) AddUserToTeamByTeamId(c *request.Context, teamID string, user *model.User) *model.AppError {
|
||||
func (a *App) AddUserToTeamByTeamId(c request.CTX, teamID string, user *model.User) *model.AppError {
|
||||
team, err := a.Srv().Store().Team().Get(teamID)
|
||||
if err != nil {
|
||||
var nfErr *store.ErrNotFound
|
||||
@@ -619,7 +619,7 @@ func (a *App) AddUserToTeamByTeamId(c *request.Context, teamID string, user *mod
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) AddUserToTeamByToken(c *request.Context, userID string, tokenID string) (*model.Team, *model.TeamMember, *model.AppError) {
|
||||
func (a *App) AddUserToTeamByToken(c request.CTX, userID string, tokenID string) (*model.Team, *model.TeamMember, *model.AppError) {
|
||||
token, err := a.Srv().Store().Token().GetByToken(tokenID)
|
||||
if err != nil {
|
||||
return nil, nil, model.NewAppError("AddUserToTeamByToken", "api.user.create_user.signup_link_invalid.app_error", nil, "", http.StatusBadRequest).Wrap(err)
|
||||
@@ -711,7 +711,7 @@ func (a *App) AddUserToTeamByToken(c *request.Context, userID string, tokenID st
|
||||
return team, teamMember, nil
|
||||
}
|
||||
|
||||
func (a *App) AddUserToTeamByInviteId(c *request.Context, inviteId string, userID string) (*model.Team, *model.TeamMember, *model.AppError) {
|
||||
func (a *App) AddUserToTeamByInviteId(c request.CTX, inviteId string, userID string) (*model.Team, *model.TeamMember, *model.AppError) {
|
||||
tchan := make(chan store.StoreResult, 1)
|
||||
go func() {
|
||||
team, err := a.Srv().Store().Team().GetByInviteId(inviteId)
|
||||
@@ -1066,7 +1066,7 @@ func (a *App) AddTeamMember(c request.CTX, teamID, userID string) (*model.TeamMe
|
||||
return teamMember, nil
|
||||
}
|
||||
|
||||
func (a *App) AddTeamMembers(c *request.Context, teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) {
|
||||
func (a *App) AddTeamMembers(c request.CTX, teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) {
|
||||
var membersWithErrors []*model.TeamMemberWithError
|
||||
|
||||
for _, userID := range userIDs {
|
||||
@@ -1096,7 +1096,7 @@ func (a *App) AddTeamMembers(c *request.Context, teamID string, userIDs []string
|
||||
return membersWithErrors, nil
|
||||
}
|
||||
|
||||
func (a *App) AddTeamMemberByToken(c *request.Context, userID, tokenID string) (*model.TeamMember, *model.AppError) {
|
||||
func (a *App) AddTeamMemberByToken(c request.CTX, userID, tokenID string) (*model.TeamMember, *model.AppError) {
|
||||
_, teamMember, err := a.AddUserToTeamByToken(c, userID, tokenID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1105,7 +1105,7 @@ func (a *App) AddTeamMemberByToken(c *request.Context, userID, tokenID string) (
|
||||
return teamMember, nil
|
||||
}
|
||||
|
||||
func (a *App) AddTeamMemberByInviteId(c *request.Context, inviteId, userID string) (*model.TeamMember, *model.AppError) {
|
||||
func (a *App) AddTeamMemberByInviteId(c request.CTX, inviteId, userID string) (*model.TeamMember, *model.AppError) {
|
||||
team, teamMember, err := a.AddUserToTeamByInviteId(c, inviteId, userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -2055,7 +2055,7 @@ func (a *App) RemoveTeamIcon(teamID string) *model.AppError {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) InvalidateAllEmailInvites(c *request.Context) *model.AppError {
|
||||
func (a *App) InvalidateAllEmailInvites(c request.CTX) *model.AppError {
|
||||
if err := a.Srv().Store().Token().RemoveAllTokensByType(TokenTypeTeamInvitation); err != nil {
|
||||
return model.NewAppError("InvalidateAllEmailInvites", "api.team.invalidate_all_email_invites.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
@@ -2068,7 +2068,7 @@ func (a *App) InvalidateAllEmailInvites(c *request.Context) *model.AppError {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) InvalidateAllResendInviteEmailJobs(c *request.Context) *model.AppError {
|
||||
func (a *App) InvalidateAllResendInviteEmailJobs(c request.CTX) *model.AppError {
|
||||
jobs, appErr := a.Srv().Jobs.GetJobsByTypeAndStatus(c, model.JobTypeResendInvitationEmail, model.JobStatusPending)
|
||||
if appErr != nil {
|
||||
return appErr
|
||||
|
||||
@@ -321,7 +321,7 @@ func (a *App) createUserOrGuest(c request.CTX, user *model.User, guest bool) (*m
|
||||
return ruser, nil
|
||||
}
|
||||
|
||||
func (a *App) CreateOAuthUser(c *request.Context, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
func (a *App) CreateOAuthUser(c request.CTX, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) {
|
||||
if !*a.Config().TeamSettings.EnableUserCreation {
|
||||
return nil, model.NewAppError("CreateOAuthUser", "api.user.create_user.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
@@ -687,7 +687,7 @@ func (a *App) GetUsersByIds(userIDs []string, options *store.UserGetByIdsOpts) (
|
||||
return users, nil
|
||||
}
|
||||
|
||||
func (a *App) GetUsersByGroupChannelIds(c *request.Context, channelIDs []string, asAdmin bool) (map[string][]*model.User, *model.AppError) {
|
||||
func (a *App) GetUsersByGroupChannelIds(c request.CTX, channelIDs []string, asAdmin bool) (map[string][]*model.User, *model.AppError) {
|
||||
usersByChannelId, err := a.Srv().Store().User().GetProfileByGroupChannelIdsForUser(c.Session().UserId, channelIDs)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("GetUsersByGroupChannelIds", "app.user.get_profile_by_group_channel_ids_for_user.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
@@ -917,7 +917,7 @@ func (a *App) UpdatePasswordAsUser(c request.CTX, userID, currentPassword, newPa
|
||||
return a.UpdatePasswordSendEmail(c, user, newPassword, T("api.user.update_password.menu"))
|
||||
}
|
||||
|
||||
func (a *App) userDeactivated(c *request.Context, userID string) *model.AppError {
|
||||
func (a *App) userDeactivated(c request.CTX, userID string) *model.AppError {
|
||||
a.SetStatusOffline(userID, false)
|
||||
|
||||
user, err := a.GetUser(userID)
|
||||
@@ -966,7 +966,7 @@ func (a *App) invalidateUserChannelMembersCaches(c request.CTX, userID string) *
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) UpdateActive(c *request.Context, user *model.User, active bool) (*model.User, *model.AppError) {
|
||||
func (a *App) UpdateActive(c request.CTX, user *model.User, active bool) (*model.User, *model.AppError) {
|
||||
user.UpdateAt = model.GetMillis()
|
||||
if active {
|
||||
user.DeleteAt = 0
|
||||
@@ -1016,7 +1016,7 @@ func (a *App) UpdateActive(c *request.Context, user *model.User, active bool) (*
|
||||
return ruser, nil
|
||||
}
|
||||
|
||||
func (a *App) DeactivateGuests(c *request.Context) *model.AppError {
|
||||
func (a *App) DeactivateGuests(c request.CTX) *model.AppError {
|
||||
userIDs, err := a.ch.srv.userService.DeactivateAllGuests()
|
||||
if err != nil {
|
||||
return model.NewAppError("DeactivateGuests", "app.user.update_active_for_multiple_users.updating.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
@@ -1065,7 +1065,7 @@ func (a *App) UpdateUserAsUser(c request.CTX, user *model.User, asAdmin bool) (*
|
||||
// CheckProviderAttributes returns the empty string if the patch can be applied without
|
||||
// overriding attributes set by the user's login provider; otherwise, the name of the offending
|
||||
// field is returned.
|
||||
func (a *App) CheckProviderAttributes(c *request.Context, user *model.User, patch *model.UserPatch) string {
|
||||
func (a *App) CheckProviderAttributes(c request.CTX, user *model.User, patch *model.UserPatch) string {
|
||||
tryingToChange := func(userValue *string, patchValue *string) bool {
|
||||
return patchValue != nil && *patchValue != *userValue
|
||||
}
|
||||
@@ -1300,7 +1300,7 @@ func (a *App) UpdateUser(c request.CTX, user *model.User, sendNotifications bool
|
||||
return newUser, nil
|
||||
}
|
||||
|
||||
func (a *App) UpdateUserActive(c *request.Context, userID string, active bool) *model.AppError {
|
||||
func (a *App) UpdateUserActive(c request.CTX, userID string, active bool) *model.AppError {
|
||||
user, err := a.GetUser(userID)
|
||||
|
||||
if err != nil {
|
||||
@@ -1649,7 +1649,7 @@ func (a *App) UpdateUserRolesWithUser(c request.CTX, user *model.User, newRoles
|
||||
return ruser, nil
|
||||
}
|
||||
|
||||
func (a *App) PermanentDeleteUser(c *request.Context, user *model.User) *model.AppError {
|
||||
func (a *App) PermanentDeleteUser(c request.CTX, user *model.User) *model.AppError {
|
||||
c.Logger().Warn("Attempting to permanently delete account", mlog.String("user_id", user.Id), mlog.String("user_email", user.Email))
|
||||
if user.IsInRole(model.SystemAdminRoleId) {
|
||||
c.Logger().Warn("You are deleting a user that is a system administrator. You may need to set another account as the system administrator using the command line tools.", mlog.String("user_email", user.Email))
|
||||
@@ -1801,7 +1801,7 @@ func (a *App) PermanentDeleteUser(c *request.Context, user *model.User) *model.A
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) PermanentDeleteAllUsers(c *request.Context) *model.AppError {
|
||||
func (a *App) PermanentDeleteAllUsers(c request.CTX) *model.AppError {
|
||||
users, err := a.Srv().Store().User().GetAll()
|
||||
if err != nil {
|
||||
return model.NewAppError("PermanentDeleteAllUsers", "app.user.get.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
@@ -2099,7 +2099,7 @@ func (a *App) AutocompleteUsersInTeam(teamID string, term string, options *model
|
||||
return autocomplete, nil
|
||||
}
|
||||
|
||||
func (a *App) UpdateOAuthUserAttrs(c *request.Context, userData io.Reader, user *model.User, provider einterfaces.OAuthProvider, service string, tokenUser *model.User) *model.AppError {
|
||||
func (a *App) UpdateOAuthUserAttrs(c request.CTX, userData io.Reader, user *model.User, provider einterfaces.OAuthProvider, service string, tokenUser *model.User) *model.AppError {
|
||||
oauthUser, err1 := provider.GetUserFromJSON(c, userData, tokenUser)
|
||||
if err1 != nil {
|
||||
return model.NewAppError("UpdateOAuthUserAttrs", "api.user.update_oauth_user_attrs.get_user.app_error", map[string]any{"Service": service}, "", http.StatusBadRequest).Wrap(err1)
|
||||
@@ -2299,7 +2299,7 @@ func (a *App) GetViewUsersRestrictions(c request.CTX, userID string) (*model.Vie
|
||||
|
||||
// PromoteGuestToUser Convert user's roles and all his membership's roles from
|
||||
// guest roles to regular user roles.
|
||||
func (a *App) PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError {
|
||||
func (a *App) PromoteGuestToUser(c request.CTX, user *model.User, requestorId string) *model.AppError {
|
||||
nErr := a.ch.srv.userService.PromoteGuestToUser(user)
|
||||
a.InvalidateCacheForUser(user.Id)
|
||||
if nErr != nil {
|
||||
@@ -2359,7 +2359,7 @@ func (a *App) PromoteGuestToUser(c *request.Context, user *model.User, requestor
|
||||
|
||||
// DemoteUserToGuest Convert user's roles and all his membership's roles from
|
||||
// regular user roles to guest roles.
|
||||
func (a *App) DemoteUserToGuest(c *request.Context, user *model.User) *model.AppError {
|
||||
func (a *App) DemoteUserToGuest(c request.CTX, user *model.User) *model.AppError {
|
||||
demotedUser, nErr := a.ch.srv.userService.DemoteUserToGuest(user)
|
||||
a.InvalidateCacheForUser(user.Id)
|
||||
if nErr != nil {
|
||||
|
||||
@@ -698,7 +698,7 @@ func getGitlabUserPayload(gitlabUser oauthgitlab.GitLabUser, t *testing.T) []byt
|
||||
return payload
|
||||
}
|
||||
|
||||
func createGitlabUser(t *testing.T, a *App, c *request.Context, id int64, username string, email string) (*model.User, oauthgitlab.GitLabUser) {
|
||||
func createGitlabUser(t *testing.T, a *App, c request.CTX, id int64, username string, email string) (*model.User, oauthgitlab.GitLabUser) {
|
||||
gitlabUserObj := oauthgitlab.GitLabUser{Id: id, Username: username, Login: "user1", Email: email, Name: "Test User"}
|
||||
gitlabUser := getGitlabUserPayload(gitlabUserObj, t)
|
||||
|
||||
|
||||
@@ -657,7 +657,7 @@ func (a *App) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.Out
|
||||
return webhook, nil
|
||||
}
|
||||
|
||||
func (a *App) HandleIncomingWebhook(c *request.Context, hookID string, req *model.IncomingWebhookRequest) *model.AppError {
|
||||
func (a *App) HandleIncomingWebhook(c request.CTX, hookID string, req *model.IncomingWebhookRequest) *model.AppError {
|
||||
if !*a.Config().ServiceSettings.EnableIncomingWebhooks {
|
||||
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
@@ -817,7 +817,7 @@ func (a *App) CreateCommandWebhook(commandID string, args *model.CommandArgs) (*
|
||||
return savedHook, nil
|
||||
}
|
||||
|
||||
func (a *App) HandleCommandWebhook(c *request.Context, hookID string, response *model.CommandResponse) *model.AppError {
|
||||
func (a *App) HandleCommandWebhook(c request.CTX, hookID string, response *model.CommandResponse) *model.AppError {
|
||||
if response == nil {
|
||||
return model.NewAppError("HandleCommandWebhook", "app.command_webhook.handle_command_webhook.parse", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ func (scheduler *PeriodicScheduler) NextScheduleTime(_ *model.Config, _ time.Tim
|
||||
return &nextTime
|
||||
}
|
||||
|
||||
func (scheduler *PeriodicScheduler) ScheduleJob(c *request.Context, _ *model.Config /* pendingJobs */, _ bool /* lastSuccessfulJob */, _ *model.Job) (*model.Job, *model.AppError) {
|
||||
func (scheduler *PeriodicScheduler) ScheduleJob(c request.CTX, _ *model.Config /* pendingJobs */, _ bool /* lastSuccessfulJob */, _ *model.Job) (*model.Job, *model.AppError) {
|
||||
return scheduler.jobs.CreateJob(c, scheduler.jobType, nil)
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ func (scheduler *DailyScheduler) NextScheduleTime(cfg *model.Config, now time.Ti
|
||||
return GenerateNextStartDateTime(now, *scheduledTime)
|
||||
}
|
||||
|
||||
func (scheduler *DailyScheduler) ScheduleJob(c *request.Context, _ *model.Config /* pendingJobs */, _ bool /* lastSuccessfulJob */, _ *model.Job) (*model.Job, *model.AppError) {
|
||||
func (scheduler *DailyScheduler) ScheduleJob(c request.CTX, _ *model.Config /* pendingJobs */, _ bool /* lastSuccessfulJob */, _ *model.Job) (*model.Job, *model.AppError) {
|
||||
return scheduler.jobs.CreateJob(c, scheduler.jobType, nil)
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ type AppIface interface {
|
||||
FileExists(path string) (bool, *model.AppError)
|
||||
FileSize(path string) (int64, *model.AppError)
|
||||
FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError)
|
||||
BulkImportWithPath(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int)
|
||||
BulkImportWithPath(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int)
|
||||
Log() *mlog.Logger
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ func JobLoggerFields(job *model.Job) []mlog.Field {
|
||||
}
|
||||
}
|
||||
|
||||
func (srv *JobServer) CreateJob(c *request.Context, jobType string, jobData map[string]string) (*model.Job, *model.AppError) {
|
||||
func (srv *JobServer) CreateJob(c request.CTX, jobType string, jobData map[string]string) (*model.Job, *model.AppError) {
|
||||
job, appErr := srv._createJob(c, jobType, jobData)
|
||||
if appErr != nil {
|
||||
return nil, appErr
|
||||
@@ -47,7 +47,7 @@ func (srv *JobServer) CreateJob(c *request.Context, jobType string, jobData map[
|
||||
return job, nil
|
||||
}
|
||||
|
||||
func (srv *JobServer) CreateJobOnce(c *request.Context, jobType string, jobData map[string]string) (*model.Job, *model.AppError) {
|
||||
func (srv *JobServer) CreateJobOnce(c request.CTX, jobType string, jobData map[string]string) (*model.Job, *model.AppError) {
|
||||
job, appErr := srv._createJob(c, jobType, jobData)
|
||||
if appErr != nil {
|
||||
return nil, appErr
|
||||
@@ -60,7 +60,7 @@ func (srv *JobServer) CreateJobOnce(c *request.Context, jobType string, jobData
|
||||
return job, nil
|
||||
}
|
||||
|
||||
func (srv *JobServer) _createJob(c *request.Context, jobType string, jobData map[string]string) (*model.Job, *model.AppError) {
|
||||
func (srv *JobServer) _createJob(c request.CTX, jobType string, jobData map[string]string) (*model.Job, *model.AppError) {
|
||||
job := model.Job{
|
||||
Id: model.NewId(),
|
||||
Type: jobType,
|
||||
@@ -80,7 +80,7 @@ func (srv *JobServer) _createJob(c *request.Context, jobType string, jobData map
|
||||
return &job, nil
|
||||
}
|
||||
|
||||
func (srv *JobServer) GetJob(c *request.Context, id string) (*model.Job, *model.AppError) {
|
||||
func (srv *JobServer) GetJob(c request.CTX, id string) (*model.Job, *model.AppError) {
|
||||
job, err := srv.Store.Job().Get(c, id)
|
||||
if err != nil {
|
||||
var nfErr *store.ErrNotFound
|
||||
@@ -242,7 +242,7 @@ func (srv *JobServer) HandleJobPanic(logger mlog.LoggerIFace, job *model.Job) {
|
||||
panic(r)
|
||||
}
|
||||
|
||||
func (srv *JobServer) RequestCancellation(c *request.Context, jobId string) *model.AppError {
|
||||
func (srv *JobServer) RequestCancellation(c request.CTX, jobId string) *model.AppError {
|
||||
updated, err := srv.Store.Job().UpdateStatusOptimistically(jobId, model.JobStatusPending, model.JobStatusCanceled)
|
||||
if err != nil {
|
||||
return model.NewAppError("RequestCancellation", "app.job.update.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
@@ -272,7 +272,7 @@ func (srv *JobServer) RequestCancellation(c *request.Context, jobId string) *mod
|
||||
return model.NewAppError("RequestCancellation", "jobs.request_cancellation.status.error", nil, "id="+jobId, http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
func (srv *JobServer) CancellationWatcher(c *request.Context, jobId string, cancelChan chan struct{}) {
|
||||
func (srv *JobServer) CancellationWatcher(c request.CTX, jobId string, cancelChan chan struct{}) {
|
||||
for {
|
||||
select {
|
||||
case <-c.Context().Done():
|
||||
@@ -311,7 +311,7 @@ func (srv *JobServer) CheckForPendingJobsByType(jobType string) (bool, *model.Ap
|
||||
return count > 0, nil
|
||||
}
|
||||
|
||||
func (srv *JobServer) GetJobsByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, *model.AppError) {
|
||||
func (srv *JobServer) GetJobsByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, *model.AppError) {
|
||||
jobs, err := srv.Store.Job().GetAllByTypeAndStatus(c, jobType, status)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("GetJobsByTypeAndStatus", "app.job.get_all_jobs_by_type_and_status.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
|
||||
@@ -26,7 +26,7 @@ func MakeMigrationsList() []string {
|
||||
}
|
||||
}
|
||||
|
||||
func GetMigrationState(c *request.Context, migration string, store store.Store) (string, *model.Job, *model.AppError) {
|
||||
func GetMigrationState(c request.CTX, migration string, store store.Store) (string, *model.Job, *model.AppError) {
|
||||
if _, err := store.System().GetByName(migration); err == nil {
|
||||
return MigrationStateCompleted, nil, nil
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ func (scheduler *Scheduler) NextScheduleTime(cfg *model.Config, now time.Time, p
|
||||
}
|
||||
|
||||
//nolint:unparam
|
||||
func (scheduler *Scheduler) ScheduleJob(c *request.Context, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
|
||||
func (scheduler *Scheduler) ScheduleJob(c request.CTX, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
|
||||
c.Logger().Debug("Scheduling Job", mlog.String("scheduler", model.JobTypeMigrations))
|
||||
|
||||
// Work through the list of migrations in order. Schedule the first one that isn't done (assuming it isn't in progress already).
|
||||
@@ -91,7 +91,7 @@ func (scheduler *Scheduler) ScheduleJob(c *request.Context, cfg *model.Config, p
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (scheduler *Scheduler) createJob(c *request.Context, migrationKey string, lastJob *model.Job) (*model.Job, *model.AppError) {
|
||||
func (scheduler *Scheduler) createJob(c request.CTX, migrationKey string, lastJob *model.Job) (*model.Job, *model.AppError) {
|
||||
var lastDone string
|
||||
if lastJob != nil {
|
||||
lastDone = lastJob.Data[JobDataKeyMigrationLastDone]
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
type Scheduler interface {
|
||||
Enabled(cfg *model.Config) bool
|
||||
NextScheduleTime(cfg *model.Config, now time.Time, pendingJobs bool, lastSuccessfulJob *model.Job) *time.Time
|
||||
ScheduleJob(c *request.Context, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError)
|
||||
ScheduleJob(c request.CTX, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError)
|
||||
}
|
||||
|
||||
type Schedulers struct {
|
||||
@@ -155,7 +155,7 @@ func (schedulers *Schedulers) setNextRunTime(cfg *model.Config, name string, now
|
||||
mlog.Debug("Next run time for scheduler", mlog.String("scheduler_name", name), mlog.String("next_runtime", fmt.Sprintf("%v", schedulers.nextRunTimes[name])))
|
||||
}
|
||||
|
||||
func (schedulers *Schedulers) scheduleJob(c *request.Context, cfg *model.Config, name string, scheduler Scheduler) (*model.Job, *model.AppError) {
|
||||
func (schedulers *Schedulers) scheduleJob(c request.CTX, cfg *model.Config, name string, scheduler Scheduler) (*model.Job, *model.AppError) {
|
||||
pendingJobs, err := schedulers.jobs.CheckForPendingJobsByType(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -30,7 +30,7 @@ func (scheduler *MockScheduler) NextScheduleTime(cfg *model.Config, now time.Tim
|
||||
return &nextTime
|
||||
}
|
||||
|
||||
func (scheduler *MockScheduler) ScheduleJob(c *request.Context, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
|
||||
func (scheduler *MockScheduler) ScheduleJob(c request.CTX, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ type RouterService interface {
|
||||
//
|
||||
// The service shall be registered via app.PostKey service key.
|
||||
type PostService interface {
|
||||
CreatePost(context *request.Context, post *model.Post) (*model.Post, *model.AppError)
|
||||
CreatePost(context request.CTX, post *model.Post) (*model.Post, *model.AppError)
|
||||
GetPostsByIds(postIDs []string) ([]*model.Post, int64, *model.AppError)
|
||||
SendEphemeralPost(ctx *request.Context, userID string, post *model.Post) *model.Post
|
||||
SendEphemeralPost(ctx request.CTX, userID string, post *model.Post) *model.Post
|
||||
GetPost(postID string) (*model.Post, *model.AppError)
|
||||
DeletePost(ctx *request.Context, postID, productID string) (*model.Post, *model.AppError)
|
||||
UpdatePost(c *request.Context, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError)
|
||||
DeletePost(ctx request.CTX, postID, productID string) (*model.Post, *model.AppError)
|
||||
UpdatePost(c request.CTX, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError)
|
||||
}
|
||||
|
||||
// PermissionService provides permissions related utilities. For now, the service implementation
|
||||
@@ -45,8 +45,8 @@ type PostService interface {
|
||||
// The service shall be registered via app.PermissionKey service key.
|
||||
type PermissionService interface {
|
||||
HasPermissionTo(userID string, permission *model.Permission) bool
|
||||
HasPermissionToTeam(c *request.Context, userID, teamID string, permission *model.Permission) bool
|
||||
HasPermissionToChannel(c *request.Context, askingUserID string, channelID string, permission *model.Permission) bool
|
||||
HasPermissionToTeam(c request.CTX, userID, teamID string, permission *model.Permission) bool
|
||||
HasPermissionToChannel(c request.CTX, askingUserID string, channelID string, permission *model.Permission) bool
|
||||
RolesGrantPermission(roleNames []string, permissionID string) bool
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ type UserService interface {
|
||||
// The service shall be registered via app.TeamKey service key.
|
||||
type TeamService interface {
|
||||
GetMember(c request.CTX, teamID, userID string) (*model.TeamMember, *model.AppError)
|
||||
CreateMember(ctx *request.Context, teamID, userID string) (*model.TeamMember, *model.AppError)
|
||||
CreateMember(ctx request.CTX, teamID, userID string) (*model.TeamMember, *model.AppError)
|
||||
GetGroup(groupId string) (*model.Group, *model.AppError)
|
||||
GetTeam(teamID string) (*model.Team, *model.AppError)
|
||||
GetGroupMemberUsers(groupID string, page, perPage int) ([]*model.User, *model.AppError)
|
||||
@@ -118,7 +118,7 @@ type TeamService interface {
|
||||
//
|
||||
// The service shall be registered via app.BotKey service key.
|
||||
type BotService interface {
|
||||
EnsureBot(ctx *request.Context, productID string, bot *model.Bot) (string, error)
|
||||
EnsureBot(ctx request.CTX, productID string, bot *model.Bot) (string, error)
|
||||
}
|
||||
|
||||
// ConfigService shall be registered via app.ConfigKey service key.
|
||||
|
||||
@@ -4945,7 +4945,7 @@ func (s *OpenTracingLayerJobStore) Delete(id string) (string, error) {
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.Get")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -4963,7 +4963,7 @@ func (s *OpenTracingLayerJobStore) Get(c *request.Context, id string) (*model.Jo
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByStatus")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -4981,7 +4981,7 @@ func (s *OpenTracingLayerJobStore) GetAllByStatus(c *request.Context, status str
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByType")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -4999,7 +4999,7 @@ func (s *OpenTracingLayerJobStore) GetAllByType(c *request.Context, jobType stri
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByTypeAndStatus")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5017,7 +5017,7 @@ func (s *OpenTracingLayerJobStore) GetAllByTypeAndStatus(c *request.Context, job
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByTypePage")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5035,7 +5035,7 @@ func (s *OpenTracingLayerJobStore) GetAllByTypePage(c *request.Context, jobType
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByTypesPage")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8299,7 +8299,7 @@ func (s *OpenTracingLayerSessionStore) Get(c request.CTX, sessionIDOrToken strin
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSessionStore) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (s *OpenTracingLayerSessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SessionStore.GetSessions")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
|
||||
@@ -5584,7 +5584,7 @@ func (s *RetryLayerJobStore) Delete(id string) (string, error) {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5605,7 +5605,7 @@ func (s *RetryLayerJobStore) Get(c *request.Context, id string) (*model.Job, err
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5626,7 +5626,7 @@ func (s *RetryLayerJobStore) GetAllByStatus(c *request.Context, status string) (
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5647,7 +5647,7 @@ func (s *RetryLayerJobStore) GetAllByType(c *request.Context, jobType string) ([
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5668,7 +5668,7 @@ func (s *RetryLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType s
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5689,7 +5689,7 @@ func (s *RetryLayerJobStore) GetAllByTypePage(c *request.Context, jobType string
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -9451,7 +9451,7 @@ func (s *RetryLayerSessionStore) Get(c request.CTX, sessionIDOrToken string) (*m
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSessionStore) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (s *RetryLayerSessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
|
||||
@@ -317,7 +317,7 @@ func createScheme(ss store.Store) *model.Scheme {
|
||||
return s
|
||||
}
|
||||
|
||||
func createSession(c *request.Context, ss store.Store, userId string) *model.Session {
|
||||
func createSession(c request.CTX, ss store.Store, userId string) *model.Session {
|
||||
m := model.Session{}
|
||||
m.UserId = userId
|
||||
s, _ := ss.Session().Save(c, &m)
|
||||
|
||||
@@ -202,7 +202,7 @@ func (jss SqlJobStore) UpdateStatusOptimistically(id string, currentStatus strin
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (jss SqlJobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -222,7 +222,7 @@ func (jss SqlJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
return &status, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -242,7 +242,7 @@ func (jss SqlJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string,
|
||||
return jobs, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -260,7 +260,7 @@ func (jss SqlJobStore) GetAllByType(c *request.Context, jobType string) ([]*mode
|
||||
return statuses, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -278,7 +278,7 @@ func (jss SqlJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string,
|
||||
return jobs, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -298,7 +298,7 @@ func (jss SqlJobStore) GetAllByTypePage(c *request.Context, jobType string, offs
|
||||
return statuses, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
statuses := []*model.Job{}
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
|
||||
@@ -100,7 +100,7 @@ func (me SqlSessionStore) Get(c request.CTX, sessionIdOrToken string) (*model.Se
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (me SqlSessionStore) GetSessions(c *request.Context, userId string) ([]*model.Session, error) {
|
||||
func (me SqlSessionStore) GetSessions(c request.CTX, userId string) ([]*model.Session, error) {
|
||||
sessions := []*model.Session{}
|
||||
|
||||
if err := me.GetReplicaX().Select(&sessions, "SELECT * FROM Sessions WHERE UserId = ? ORDER BY LastActivityAt DESC", userId); err != nil {
|
||||
|
||||
@@ -488,7 +488,7 @@ type BotStore interface {
|
||||
type SessionStore interface {
|
||||
Get(c request.CTX, sessionIDOrToken string) (*model.Session, error)
|
||||
Save(c request.CTX, session *model.Session) (*model.Session, error)
|
||||
GetSessions(c *request.Context, userID string) ([]*model.Session, error)
|
||||
GetSessions(c request.CTX, userID string) ([]*model.Session, error)
|
||||
GetSessionsWithActiveDeviceIds(userID string) ([]*model.Session, error)
|
||||
GetSessionsExpired(thresholdMillis int64, mobileOnly bool, unnotifiedOnly bool) ([]*model.Session, error)
|
||||
UpdateExpiredNotify(sessionid string, notified bool) error
|
||||
@@ -736,12 +736,12 @@ type JobStore interface {
|
||||
UpdateOptimistically(job *model.Job, currentStatus string) (bool, error)
|
||||
UpdateStatus(id string, status string) (*model.Job, error)
|
||||
UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (bool, error)
|
||||
Get(c *request.Context, id string) (*model.Job, error)
|
||||
GetAllByType(c *request.Context, jobType string) ([]*model.Job, error)
|
||||
GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error)
|
||||
GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error)
|
||||
GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error)
|
||||
GetAllByStatus(c *request.Context, status string) ([]*model.Job, error)
|
||||
Get(c request.CTX, id string) (*model.Job, error)
|
||||
GetAllByType(c request.CTX, jobType string) ([]*model.Job, error)
|
||||
GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error)
|
||||
GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error)
|
||||
GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error)
|
||||
GetAllByStatus(c request.CTX, status string) ([]*model.Job, error)
|
||||
GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, error)
|
||||
GetNewestJobByStatusesAndType(statuses []string, jobType string) (*model.Job, error)
|
||||
GetCountByStatusAndType(status string, jobType string) (int64, error)
|
||||
|
||||
@@ -54,15 +54,15 @@ func (_m *JobStore) Delete(id string) (string, error) {
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: c, id
|
||||
func (_m *JobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (_m *JobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
ret := _m.Called(c, id)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) (*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.Job, error)); ok {
|
||||
return rf(c, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) *model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.Job); ok {
|
||||
r0 = rf(c, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -70,7 +70,7 @@ func (_m *JobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -80,15 +80,15 @@ func (_m *JobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
}
|
||||
|
||||
// GetAllByStatus provides a mock function with given fields: c, status
|
||||
func (_m *JobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, status)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Job, error)); ok {
|
||||
return rf(c, status)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Job); ok {
|
||||
r0 = rf(c, status)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -96,7 +96,7 @@ func (_m *JobStore) GetAllByStatus(c *request.Context, status string) ([]*model.
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, status)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -106,15 +106,15 @@ func (_m *JobStore) GetAllByStatus(c *request.Context, status string) ([]*model.
|
||||
}
|
||||
|
||||
// GetAllByType provides a mock function with given fields: c, jobType
|
||||
func (_m *JobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobType)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Job); ok {
|
||||
r0 = rf(c, jobType)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -122,7 +122,7 @@ func (_m *JobStore) GetAllByType(c *request.Context, jobType string) ([]*model.J
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, jobType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -132,15 +132,15 @@ func (_m *JobStore) GetAllByType(c *request.Context, jobType string) ([]*model.J
|
||||
}
|
||||
|
||||
// GetAllByTypeAndStatus provides a mock function with given fields: c, jobType, status
|
||||
func (_m *JobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType, status)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobType, status)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) []*model.Job); ok {
|
||||
r0 = rf(c, jobType, status)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -148,7 +148,7 @@ func (_m *JobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, st
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
||||
r1 = rf(c, jobType, status)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -158,15 +158,15 @@ func (_m *JobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, st
|
||||
}
|
||||
|
||||
// GetAllByTypePage provides a mock function with given fields: c, jobType, offset, limit
|
||||
func (_m *JobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType, offset, limit)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, int, int) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobType, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, int, int) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int, int) []*model.Job); ok {
|
||||
r0 = rf(c, jobType, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -174,7 +174,7 @@ func (_m *JobStore) GetAllByTypePage(c *request.Context, jobType string, offset
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, int, int) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, int, int) error); ok {
|
||||
r1 = rf(c, jobType, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -184,15 +184,15 @@ func (_m *JobStore) GetAllByTypePage(c *request.Context, jobType string, offset
|
||||
}
|
||||
|
||||
// GetAllByTypesPage provides a mock function with given fields: c, jobTypes, offset, limit
|
||||
func (_m *JobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobTypes, offset, limit)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, []string, int, int) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobTypes, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, []string, int, int) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, int, int) []*model.Job); ok {
|
||||
r0 = rf(c, jobTypes, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -200,7 +200,7 @@ func (_m *JobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, off
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, []string, int, int) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []string, int, int) error); ok {
|
||||
r1 = rf(c, jobTypes, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
|
||||
@@ -80,15 +80,15 @@ func (_m *SessionStore) Get(c request.CTX, sessionIDOrToken string) (*model.Sess
|
||||
}
|
||||
|
||||
// GetSessions provides a mock function with given fields: c, userID
|
||||
func (_m *SessionStore) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (_m *SessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
ret := _m.Called(c, userID)
|
||||
|
||||
var r0 []*model.Session
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) ([]*model.Session, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Session, error)); ok {
|
||||
return rf(c, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) []*model.Session); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Session); ok {
|
||||
r0 = rf(c, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -96,7 +96,7 @@ func (_m *SessionStore) GetSessions(c *request.Context, userID string) ([]*model
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
|
||||
@@ -4497,7 +4497,7 @@ func (s *TimerLayerJobStore) Delete(id string) (string, error) {
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.Get(c, id)
|
||||
@@ -4513,7 +4513,7 @@ func (s *TimerLayerJobStore) Get(c *request.Context, id string) (*model.Job, err
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByStatus(c, status)
|
||||
@@ -4529,7 +4529,7 @@ func (s *TimerLayerJobStore) GetAllByStatus(c *request.Context, status string) (
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByType(c, jobType)
|
||||
@@ -4545,7 +4545,7 @@ func (s *TimerLayerJobStore) GetAllByType(c *request.Context, jobType string) ([
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByTypeAndStatus(c, jobType, status)
|
||||
@@ -4561,7 +4561,7 @@ func (s *TimerLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType s
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByTypePage(c, jobType, offset, limit)
|
||||
@@ -4577,7 +4577,7 @@ func (s *TimerLayerJobStore) GetAllByTypePage(c *request.Context, jobType string
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByTypesPage(c, jobTypes, offset, limit)
|
||||
@@ -7487,7 +7487,7 @@ func (s *TimerLayerSessionStore) Get(c request.CTX, sessionIDOrToken string) (*m
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSessionStore) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (s *TimerLayerSessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SessionStore.GetSessions(c, userID)
|
||||
|
||||
@@ -687,7 +687,7 @@ func closeBody(r *http.Response) {
|
||||
type MattermostTestProvider struct {
|
||||
}
|
||||
|
||||
func (m *MattermostTestProvider) GetUserFromJSON(_ *request.Context, data io.Reader, tokenUser *model.User) (*model.User, error) {
|
||||
func (m *MattermostTestProvider) GetUserFromJSON(_ request.CTX, data io.Reader, tokenUser *model.User) (*model.User, error) {
|
||||
var user model.User
|
||||
if err := json.NewDecoder(data).Decode(&user); err != nil {
|
||||
return nil, err
|
||||
@@ -696,15 +696,15 @@ func (m *MattermostTestProvider) GetUserFromJSON(_ *request.Context, data io.Rea
|
||||
return &user, nil
|
||||
}
|
||||
|
||||
func (m *MattermostTestProvider) GetSSOSettings(_ *request.Context, config *model.Config, service string) (*model.SSOSettings, error) {
|
||||
func (m *MattermostTestProvider) GetSSOSettings(_ request.CTX, config *model.Config, service string) (*model.SSOSettings, error) {
|
||||
return &config.GitLabSettings, nil
|
||||
}
|
||||
|
||||
func (m *MattermostTestProvider) GetUserFromIdToken(_ *request.Context, token string) (*model.User, error) {
|
||||
func (m *MattermostTestProvider) GetUserFromIdToken(_ request.CTX, token string) (*model.User, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MattermostTestProvider) IsSameUser(_ *request.Context, dbUser, oauthUser *model.User) bool {
|
||||
func (m *MattermostTestProvider) IsSameUser(_ request.CTX, dbUser, oauthUser *model.User) bool {
|
||||
return dbUser.AuthData == oauthUser.AuthData
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ type SystemBrowser struct {
|
||||
MakeDefaultString string
|
||||
}
|
||||
|
||||
func renderUnsupportedBrowser(ctx *request.Context, r *http.Request) templates.Data {
|
||||
func renderUnsupportedBrowser(ctx request.CTX, r *http.Request) templates.Data {
|
||||
data := templates.Data{
|
||||
Props: map[string]any{
|
||||
"DownloadAppOrUpgradeBrowserString": ctx.T("web.error.unsupported_browser.download_app_or_upgrade_browser"),
|
||||
@@ -90,7 +90,7 @@ func renderUnsupportedBrowser(ctx *request.Context, r *http.Request) templates.D
|
||||
return data
|
||||
}
|
||||
|
||||
func renderMattermostAppMac(ctx *request.Context) MattermostApp {
|
||||
func renderMattermostAppMac(ctx request.CTX) MattermostApp {
|
||||
return MattermostApp{
|
||||
"/static/images/browser-icons/mac.png",
|
||||
ctx.T("web.error.unsupported_browser.download_the_app"),
|
||||
@@ -102,7 +102,7 @@ func renderMattermostAppMac(ctx *request.Context) MattermostApp {
|
||||
}
|
||||
}
|
||||
|
||||
func renderMattermostAppWindows(ctx *request.Context) MattermostApp {
|
||||
func renderMattermostAppWindows(ctx request.CTX) MattermostApp {
|
||||
return MattermostApp{
|
||||
"/static/images/browser-icons/windows.svg",
|
||||
ctx.T("web.error.unsupported_browser.download_the_app"),
|
||||
@@ -114,7 +114,7 @@ func renderMattermostAppWindows(ctx *request.Context) MattermostApp {
|
||||
}
|
||||
}
|
||||
|
||||
func renderBrowserChrome(ctx *request.Context) Browser {
|
||||
func renderBrowserChrome(ctx request.CTX) Browser {
|
||||
return Browser{
|
||||
"/static/images/browser-icons/chrome.svg",
|
||||
ctx.T("web.error.unsupported_browser.browser_title.chrome"),
|
||||
@@ -124,7 +124,7 @@ func renderBrowserChrome(ctx *request.Context) Browser {
|
||||
}
|
||||
}
|
||||
|
||||
func renderBrowserFirefox(ctx *request.Context) Browser {
|
||||
func renderBrowserFirefox(ctx request.CTX) Browser {
|
||||
return Browser{
|
||||
"/static/images/browser-icons/firefox.svg",
|
||||
ctx.T("web.error.unsupported_browser.browser_title.firefox"),
|
||||
@@ -134,7 +134,7 @@ func renderBrowserFirefox(ctx *request.Context) Browser {
|
||||
}
|
||||
}
|
||||
|
||||
func renderBrowserSafari(ctx *request.Context) Browser {
|
||||
func renderBrowserSafari(ctx request.CTX) Browser {
|
||||
return Browser{
|
||||
"/static/images/browser-icons/safari.svg",
|
||||
ctx.T("web.error.unsupported_browser.browser_title.safari"),
|
||||
@@ -144,7 +144,7 @@ func renderBrowserSafari(ctx *request.Context) Browser {
|
||||
}
|
||||
}
|
||||
|
||||
func renderSystemBrowserEdge(ctx *request.Context, r *http.Request) SystemBrowser {
|
||||
func renderSystemBrowserEdge(ctx request.CTX, r *http.Request) SystemBrowser {
|
||||
return SystemBrowser{
|
||||
"/static/images/browser-icons/edge.svg",
|
||||
ctx.T("web.error.unsupported_browser.browser_title.edge"),
|
||||
|
||||
@@ -9,6 +9,6 @@ import (
|
||||
)
|
||||
|
||||
type AccountMigrationInterface interface {
|
||||
MigrateToLdap(c *request.Context, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError
|
||||
MigrateToSaml(c *request.Context, fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError
|
||||
MigrateToLdap(c request.CTX, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError
|
||||
MigrateToSaml(c request.CTX, fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError
|
||||
}
|
||||
|
||||
@@ -13,5 +13,5 @@ import (
|
||||
type Scheduler interface {
|
||||
Enabled(cfg *model.Config) bool
|
||||
NextScheduleTime(cfg *model.Config, now time.Time, pendingJobs bool, lastSuccessfulJob *model.Job) *time.Time
|
||||
ScheduleJob(c *request.Context, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError)
|
||||
ScheduleJob(c request.CTX, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError)
|
||||
}
|
||||
|
||||
@@ -9,22 +9,22 @@ import (
|
||||
)
|
||||
|
||||
type LdapInterface interface {
|
||||
DoLogin(c *request.Context, id string, password string) (*model.User, *model.AppError)
|
||||
GetUser(c *request.Context, id string) (*model.User, *model.AppError)
|
||||
DoLogin(c request.CTX, id string, password string) (*model.User, *model.AppError)
|
||||
GetUser(c request.CTX, id string) (*model.User, *model.AppError)
|
||||
GetUserAttributes(id string, attributes []string) (map[string]string, *model.AppError)
|
||||
CheckPassword(c *request.Context, id string, password string) *model.AppError
|
||||
CheckPasswordAuthData(c *request.Context, authData string, password string) *model.AppError
|
||||
CheckProviderAttributes(c *request.Context, LS *model.LdapSettings, ouser *model.User, patch *model.UserPatch) string
|
||||
SwitchToLdap(c *request.Context, userID, ldapID, ldapPassword string) *model.AppError
|
||||
StartSynchronizeJob(c *request.Context, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError)
|
||||
CheckPassword(c request.CTX, id string, password string) *model.AppError
|
||||
CheckPasswordAuthData(c request.CTX, authData string, password string) *model.AppError
|
||||
CheckProviderAttributes(c request.CTX, LS *model.LdapSettings, ouser *model.User, patch *model.UserPatch) string
|
||||
SwitchToLdap(c request.CTX, userID, ldapID, ldapPassword string) *model.AppError
|
||||
StartSynchronizeJob(c request.CTX, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError)
|
||||
RunTest() *model.AppError
|
||||
GetAllLdapUsers(c *request.Context) ([]*model.User, *model.AppError)
|
||||
MigrateIDAttribute(c *request.Context, toAttribute string) error
|
||||
GetAllLdapUsers(c request.CTX) ([]*model.User, *model.AppError)
|
||||
MigrateIDAttribute(c request.CTX, toAttribute string) error
|
||||
GetGroup(groupUID string) (*model.Group, *model.AppError)
|
||||
GetAllGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError)
|
||||
FirstLoginSync(c *request.Context, user *model.User, userAuthService, userAuthData, email string) *model.AppError
|
||||
UpdateProfilePictureIfNecessary(*request.Context, model.User, model.Session)
|
||||
GetADLdapIdFromSAMLId(c *request.Context, authData string) string
|
||||
GetSAMLIdFromADLdapId(c *request.Context, authData string) string
|
||||
FirstLoginSync(c request.CTX, user *model.User, userAuthService, userAuthData, email string) *model.AppError
|
||||
UpdateProfilePictureIfNecessary(request.CTX, model.User, model.Session)
|
||||
GetADLdapIdFromSAMLId(c request.CTX, authData string) string
|
||||
GetSAMLIdFromADLdapId(c request.CTX, authData string) string
|
||||
GetVendorNameAndVendorVersion() (string, string)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ import (
|
||||
)
|
||||
|
||||
type MessageExportInterface interface {
|
||||
StartSynchronizeJob(c *request.Context, exportFromTimestamp int64) (*model.Job, *model.AppError)
|
||||
RunExport(c *request.Context, format string, since int64, limit int) (int64, *model.AppError)
|
||||
StartSynchronizeJob(c request.CTX, exportFromTimestamp int64) (*model.Job, *model.AppError)
|
||||
RunExport(c request.CTX, format string, since int64, limit int) (int64, *model.AppError)
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ type AccountMigrationInterface struct {
|
||||
}
|
||||
|
||||
// MigrateToLdap provides a mock function with given fields: c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun
|
||||
func (_m *AccountMigrationInterface) MigrateToLdap(c *request.Context, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||
func (_m *AccountMigrationInterface) MigrateToLdap(c request.CTX, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||
ret := _m.Called(c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string, bool, bool) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, bool, bool) *model.AppError); ok {
|
||||
r0 = rf(c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -32,11 +32,11 @@ func (_m *AccountMigrationInterface) MigrateToLdap(c *request.Context, fromAuthS
|
||||
}
|
||||
|
||||
// MigrateToSaml provides a mock function with given fields: c, fromAuthService, usersMap, auto, dryRun
|
||||
func (_m *AccountMigrationInterface) MigrateToSaml(c *request.Context, fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError {
|
||||
func (_m *AccountMigrationInterface) MigrateToSaml(c request.CTX, fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError {
|
||||
ret := _m.Called(c, fromAuthService, usersMap, auto, dryRun)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, map[string]string, bool, bool) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string, bool, bool) *model.AppError); ok {
|
||||
r0 = rf(c, fromAuthService, usersMap, auto, dryRun)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
|
||||
@@ -16,11 +16,11 @@ type LdapInterface struct {
|
||||
}
|
||||
|
||||
// CheckPassword provides a mock function with given fields: c, id, password
|
||||
func (_m *LdapInterface) CheckPassword(c *request.Context, id string, password string) *model.AppError {
|
||||
func (_m *LdapInterface) CheckPassword(c request.CTX, id string, password string) *model.AppError {
|
||||
ret := _m.Called(c, id, password)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.AppError); ok {
|
||||
r0 = rf(c, id, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -32,11 +32,11 @@ func (_m *LdapInterface) CheckPassword(c *request.Context, id string, password s
|
||||
}
|
||||
|
||||
// CheckPasswordAuthData provides a mock function with given fields: c, authData, password
|
||||
func (_m *LdapInterface) CheckPasswordAuthData(c *request.Context, authData string, password string) *model.AppError {
|
||||
func (_m *LdapInterface) CheckPasswordAuthData(c request.CTX, authData string, password string) *model.AppError {
|
||||
ret := _m.Called(c, authData, password)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.AppError); ok {
|
||||
r0 = rf(c, authData, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -48,11 +48,11 @@ func (_m *LdapInterface) CheckPasswordAuthData(c *request.Context, authData stri
|
||||
}
|
||||
|
||||
// CheckProviderAttributes provides a mock function with given fields: c, LS, ouser, patch
|
||||
func (_m *LdapInterface) CheckProviderAttributes(c *request.Context, LS *model.LdapSettings, ouser *model.User, patch *model.UserPatch) string {
|
||||
func (_m *LdapInterface) CheckProviderAttributes(c request.CTX, LS *model.LdapSettings, ouser *model.User, patch *model.UserPatch) string {
|
||||
ret := _m.Called(c, LS, ouser, patch)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.LdapSettings, *model.User, *model.UserPatch) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.LdapSettings, *model.User, *model.UserPatch) string); ok {
|
||||
r0 = rf(c, LS, ouser, patch)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
@@ -62,15 +62,15 @@ func (_m *LdapInterface) CheckProviderAttributes(c *request.Context, LS *model.L
|
||||
}
|
||||
|
||||
// DoLogin provides a mock function with given fields: c, id, password
|
||||
func (_m *LdapInterface) DoLogin(c *request.Context, id string, password string) (*model.User, *model.AppError) {
|
||||
func (_m *LdapInterface) DoLogin(c request.CTX, id string, password string) (*model.User, *model.AppError) {
|
||||
ret := _m.Called(c, id, password)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) (*model.User, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.User, *model.AppError)); ok {
|
||||
return rf(c, id, password)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.User); ok {
|
||||
r0 = rf(c, id, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -78,7 +78,7 @@ func (_m *LdapInterface) DoLogin(c *request.Context, id string, password string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok {
|
||||
r1 = rf(c, id, password)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -90,11 +90,11 @@ func (_m *LdapInterface) DoLogin(c *request.Context, id string, password string)
|
||||
}
|
||||
|
||||
// FirstLoginSync provides a mock function with given fields: c, user, userAuthService, userAuthData, email
|
||||
func (_m *LdapInterface) FirstLoginSync(c *request.Context, user *model.User, userAuthService string, userAuthData string, email string) *model.AppError {
|
||||
func (_m *LdapInterface) FirstLoginSync(c request.CTX, user *model.User, userAuthService string, userAuthData string, email string) *model.AppError {
|
||||
ret := _m.Called(c, user, userAuthService, userAuthData, email)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.User, string, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, string, string, string) *model.AppError); ok {
|
||||
r0 = rf(c, user, userAuthService, userAuthData, email)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -106,11 +106,11 @@ func (_m *LdapInterface) FirstLoginSync(c *request.Context, user *model.User, us
|
||||
}
|
||||
|
||||
// GetADLdapIdFromSAMLId provides a mock function with given fields: c, authData
|
||||
func (_m *LdapInterface) GetADLdapIdFromSAMLId(c *request.Context, authData string) string {
|
||||
func (_m *LdapInterface) GetADLdapIdFromSAMLId(c request.CTX, authData string) string {
|
||||
ret := _m.Called(c, authData)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) string); ok {
|
||||
r0 = rf(c, authData)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
@@ -155,15 +155,15 @@ func (_m *LdapInterface) GetAllGroupsPage(page int, perPage int, opts model.Ldap
|
||||
}
|
||||
|
||||
// GetAllLdapUsers provides a mock function with given fields: c
|
||||
func (_m *LdapInterface) GetAllLdapUsers(c *request.Context) ([]*model.User, *model.AppError) {
|
||||
func (_m *LdapInterface) GetAllLdapUsers(c request.CTX) ([]*model.User, *model.AppError) {
|
||||
ret := _m.Called(c)
|
||||
|
||||
var r0 []*model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) ([]*model.User, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) ([]*model.User, *model.AppError)); ok {
|
||||
return rf(c)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) []*model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) []*model.User); ok {
|
||||
r0 = rf(c)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -171,7 +171,7 @@ func (_m *LdapInterface) GetAllLdapUsers(c *request.Context) ([]*model.User, *mo
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX) *model.AppError); ok {
|
||||
r1 = rf(c)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -211,11 +211,11 @@ func (_m *LdapInterface) GetGroup(groupUID string) (*model.Group, *model.AppErro
|
||||
}
|
||||
|
||||
// GetSAMLIdFromADLdapId provides a mock function with given fields: c, authData
|
||||
func (_m *LdapInterface) GetSAMLIdFromADLdapId(c *request.Context, authData string) string {
|
||||
func (_m *LdapInterface) GetSAMLIdFromADLdapId(c request.CTX, authData string) string {
|
||||
ret := _m.Called(c, authData)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) string); ok {
|
||||
r0 = rf(c, authData)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
@@ -225,15 +225,15 @@ func (_m *LdapInterface) GetSAMLIdFromADLdapId(c *request.Context, authData stri
|
||||
}
|
||||
|
||||
// GetUser provides a mock function with given fields: c, id
|
||||
func (_m *LdapInterface) GetUser(c *request.Context, id string) (*model.User, *model.AppError) {
|
||||
func (_m *LdapInterface) GetUser(c request.CTX, id string) (*model.User, *model.AppError) {
|
||||
ret := _m.Called(c, id)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) (*model.User, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.User, *model.AppError)); ok {
|
||||
return rf(c, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.User); ok {
|
||||
r0 = rf(c, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -241,7 +241,7 @@ func (_m *LdapInterface) GetUser(c *request.Context, id string) (*model.User, *m
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) *model.AppError); ok {
|
||||
r1 = rf(c, id)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -305,11 +305,11 @@ func (_m *LdapInterface) GetVendorNameAndVendorVersion() (string, string) {
|
||||
}
|
||||
|
||||
// MigrateIDAttribute provides a mock function with given fields: c, toAttribute
|
||||
func (_m *LdapInterface) MigrateIDAttribute(c *request.Context, toAttribute string) error {
|
||||
func (_m *LdapInterface) MigrateIDAttribute(c request.CTX, toAttribute string) error {
|
||||
ret := _m.Called(c, toAttribute)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(c, toAttribute)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
@@ -335,15 +335,15 @@ func (_m *LdapInterface) RunTest() *model.AppError {
|
||||
}
|
||||
|
||||
// StartSynchronizeJob provides a mock function with given fields: c, waitForJobToFinish, includeRemovedMembers
|
||||
func (_m *LdapInterface) StartSynchronizeJob(c *request.Context, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError) {
|
||||
func (_m *LdapInterface) StartSynchronizeJob(c request.CTX, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(c, waitForJobToFinish, includeRemovedMembers)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, bool, bool) (*model.Job, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, bool, bool) (*model.Job, *model.AppError)); ok {
|
||||
return rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, bool, bool) *model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, bool, bool) *model.Job); ok {
|
||||
r0 = rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -351,7 +351,7 @@ func (_m *LdapInterface) StartSynchronizeJob(c *request.Context, waitForJobToFin
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, bool, bool) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, bool, bool) *model.AppError); ok {
|
||||
r1 = rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -363,11 +363,11 @@ func (_m *LdapInterface) StartSynchronizeJob(c *request.Context, waitForJobToFin
|
||||
}
|
||||
|
||||
// SwitchToLdap provides a mock function with given fields: c, userID, ldapID, ldapPassword
|
||||
func (_m *LdapInterface) SwitchToLdap(c *request.Context, userID string, ldapID string, ldapPassword string) *model.AppError {
|
||||
func (_m *LdapInterface) SwitchToLdap(c request.CTX, userID string, ldapID string, ldapPassword string) *model.AppError {
|
||||
ret := _m.Called(c, userID, ldapID, ldapPassword)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string) *model.AppError); ok {
|
||||
r0 = rf(c, userID, ldapID, ldapPassword)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -379,7 +379,7 @@ func (_m *LdapInterface) SwitchToLdap(c *request.Context, userID string, ldapID
|
||||
}
|
||||
|
||||
// UpdateProfilePictureIfNecessary provides a mock function with given fields: _a0, _a1, _a2
|
||||
func (_m *LdapInterface) UpdateProfilePictureIfNecessary(_a0 *request.Context, _a1 model.User, _a2 model.Session) {
|
||||
func (_m *LdapInterface) UpdateProfilePictureIfNecessary(_a0 request.CTX, _a1 model.User, _a2 model.Session) {
|
||||
_m.Called(_a0, _a1, _a2)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,21 +16,21 @@ type MessageExportInterface struct {
|
||||
}
|
||||
|
||||
// RunExport provides a mock function with given fields: c, format, since, limit
|
||||
func (_m *MessageExportInterface) RunExport(c *request.Context, format string, since int64, limit int) (int64, *model.AppError) {
|
||||
func (_m *MessageExportInterface) RunExport(c request.CTX, format string, since int64, limit int) (int64, *model.AppError) {
|
||||
ret := _m.Called(c, format, since, limit)
|
||||
|
||||
var r0 int64
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, int64, int) (int64, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int64, int) (int64, *model.AppError)); ok {
|
||||
return rf(c, format, since, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, int64, int) int64); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int64, int) int64); ok {
|
||||
r0 = rf(c, format, since, limit)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, int64, int) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, int64, int) *model.AppError); ok {
|
||||
r1 = rf(c, format, since, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -42,15 +42,15 @@ func (_m *MessageExportInterface) RunExport(c *request.Context, format string, s
|
||||
}
|
||||
|
||||
// StartSynchronizeJob provides a mock function with given fields: c, exportFromTimestamp
|
||||
func (_m *MessageExportInterface) StartSynchronizeJob(c *request.Context, exportFromTimestamp int64) (*model.Job, *model.AppError) {
|
||||
func (_m *MessageExportInterface) StartSynchronizeJob(c request.CTX, exportFromTimestamp int64) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(c, exportFromTimestamp)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, int64) (*model.Job, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64) (*model.Job, *model.AppError)); ok {
|
||||
return rf(c, exportFromTimestamp)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, int64) *model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64) *model.Job); ok {
|
||||
r0 = rf(c, exportFromTimestamp)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -58,7 +58,7 @@ func (_m *MessageExportInterface) StartSynchronizeJob(c *request.Context, export
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, int64) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, int64) *model.AppError); ok {
|
||||
r1 = rf(c, exportFromTimestamp)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
|
||||
@@ -32,15 +32,15 @@ func (_m *NotificationInterface) CheckLicense() *model.AppError {
|
||||
}
|
||||
|
||||
// GetNotificationMessage provides a mock function with given fields: c, ack, userID
|
||||
func (_m *NotificationInterface) GetNotificationMessage(c *request.Context, ack *model.PushNotificationAck, userID string) (*model.PushNotification, *model.AppError) {
|
||||
func (_m *NotificationInterface) GetNotificationMessage(c request.CTX, ack *model.PushNotificationAck, userID string) (*model.PushNotification, *model.AppError) {
|
||||
ret := _m.Called(c, ack, userID)
|
||||
|
||||
var r0 *model.PushNotification
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.PushNotificationAck, string) (*model.PushNotification, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.PushNotificationAck, string) (*model.PushNotification, *model.AppError)); ok {
|
||||
return rf(c, ack, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.PushNotificationAck, string) *model.PushNotification); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.PushNotificationAck, string) *model.PushNotification); ok {
|
||||
r0 = rf(c, ack, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -48,7 +48,7 @@ func (_m *NotificationInterface) GetNotificationMessage(c *request.Context, ack
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, *model.PushNotificationAck, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.PushNotificationAck, string) *model.AppError); ok {
|
||||
r1 = rf(c, ack, userID)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
|
||||
@@ -19,15 +19,15 @@ type OAuthProvider struct {
|
||||
}
|
||||
|
||||
// GetSSOSettings provides a mock function with given fields: c, config, service
|
||||
func (_m *OAuthProvider) GetSSOSettings(c *request.Context, config *model.Config, service string) (*model.SSOSettings, error) {
|
||||
func (_m *OAuthProvider) GetSSOSettings(c request.CTX, config *model.Config, service string) (*model.SSOSettings, error) {
|
||||
ret := _m.Called(c, config, service)
|
||||
|
||||
var r0 *model.SSOSettings
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Config, string) (*model.SSOSettings, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config, string) (*model.SSOSettings, error)); ok {
|
||||
return rf(c, config, service)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Config, string) *model.SSOSettings); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config, string) *model.SSOSettings); ok {
|
||||
r0 = rf(c, config, service)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -35,7 +35,7 @@ func (_m *OAuthProvider) GetSSOSettings(c *request.Context, config *model.Config
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, *model.Config, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.Config, string) error); ok {
|
||||
r1 = rf(c, config, service)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -45,15 +45,15 @@ func (_m *OAuthProvider) GetSSOSettings(c *request.Context, config *model.Config
|
||||
}
|
||||
|
||||
// GetUserFromIdToken provides a mock function with given fields: c, idToken
|
||||
func (_m *OAuthProvider) GetUserFromIdToken(c *request.Context, idToken string) (*model.User, error) {
|
||||
func (_m *OAuthProvider) GetUserFromIdToken(c request.CTX, idToken string) (*model.User, error) {
|
||||
ret := _m.Called(c, idToken)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) (*model.User, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.User, error)); ok {
|
||||
return rf(c, idToken)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.User); ok {
|
||||
r0 = rf(c, idToken)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -61,7 +61,7 @@ func (_m *OAuthProvider) GetUserFromIdToken(c *request.Context, idToken string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, idToken)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -71,15 +71,15 @@ func (_m *OAuthProvider) GetUserFromIdToken(c *request.Context, idToken string)
|
||||
}
|
||||
|
||||
// GetUserFromJSON provides a mock function with given fields: c, data, tokenUser
|
||||
func (_m *OAuthProvider) GetUserFromJSON(c *request.Context, data io.Reader, tokenUser *model.User) (*model.User, error) {
|
||||
func (_m *OAuthProvider) GetUserFromJSON(c request.CTX, data io.Reader, tokenUser *model.User) (*model.User, error) {
|
||||
ret := _m.Called(c, data, tokenUser)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, io.Reader, *model.User) (*model.User, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, io.Reader, *model.User) (*model.User, error)); ok {
|
||||
return rf(c, data, tokenUser)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, io.Reader, *model.User) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, io.Reader, *model.User) *model.User); ok {
|
||||
r0 = rf(c, data, tokenUser)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -87,7 +87,7 @@ func (_m *OAuthProvider) GetUserFromJSON(c *request.Context, data io.Reader, tok
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, io.Reader, *model.User) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, io.Reader, *model.User) error); ok {
|
||||
r1 = rf(c, data, tokenUser)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -97,11 +97,11 @@ func (_m *OAuthProvider) GetUserFromJSON(c *request.Context, data io.Reader, tok
|
||||
}
|
||||
|
||||
// IsSameUser provides a mock function with given fields: c, dbUser, oAuthUser
|
||||
func (_m *OAuthProvider) IsSameUser(c *request.Context, dbUser *model.User, oAuthUser *model.User) bool {
|
||||
func (_m *OAuthProvider) IsSameUser(c request.CTX, dbUser *model.User, oAuthUser *model.User) bool {
|
||||
ret := _m.Called(c, dbUser, oAuthUser)
|
||||
|
||||
var r0 bool
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.User, *model.User) bool); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.User) bool); ok {
|
||||
r0 = rf(c, dbUser, oAuthUser)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
|
||||
@@ -16,15 +16,15 @@ type SamlInterface struct {
|
||||
}
|
||||
|
||||
// BuildRequest provides a mock function with given fields: c, relayState
|
||||
func (_m *SamlInterface) BuildRequest(c *request.Context, relayState string) (*model.SamlAuthRequest, *model.AppError) {
|
||||
func (_m *SamlInterface) BuildRequest(c request.CTX, relayState string) (*model.SamlAuthRequest, *model.AppError) {
|
||||
ret := _m.Called(c, relayState)
|
||||
|
||||
var r0 *model.SamlAuthRequest
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) (*model.SamlAuthRequest, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.SamlAuthRequest, *model.AppError)); ok {
|
||||
return rf(c, relayState)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) *model.SamlAuthRequest); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.SamlAuthRequest); ok {
|
||||
r0 = rf(c, relayState)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -32,7 +32,7 @@ func (_m *SamlInterface) BuildRequest(c *request.Context, relayState string) (*m
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) *model.AppError); ok {
|
||||
r1 = rf(c, relayState)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -44,11 +44,11 @@ func (_m *SamlInterface) BuildRequest(c *request.Context, relayState string) (*m
|
||||
}
|
||||
|
||||
// CheckProviderAttributes provides a mock function with given fields: c, SS, ouser, patch
|
||||
func (_m *SamlInterface) CheckProviderAttributes(c *request.Context, SS *model.SamlSettings, ouser *model.User, patch *model.UserPatch) string {
|
||||
func (_m *SamlInterface) CheckProviderAttributes(c request.CTX, SS *model.SamlSettings, ouser *model.User, patch *model.UserPatch) string {
|
||||
ret := _m.Called(c, SS, ouser, patch)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.SamlSettings, *model.User, *model.UserPatch) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.SamlSettings, *model.User, *model.UserPatch) string); ok {
|
||||
r0 = rf(c, SS, ouser, patch)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
@@ -58,11 +58,11 @@ func (_m *SamlInterface) CheckProviderAttributes(c *request.Context, SS *model.S
|
||||
}
|
||||
|
||||
// ConfigureSP provides a mock function with given fields: c
|
||||
func (_m *SamlInterface) ConfigureSP(c *request.Context) error {
|
||||
func (_m *SamlInterface) ConfigureSP(c request.CTX) error {
|
||||
ret := _m.Called(c)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) error); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) error); ok {
|
||||
r0 = rf(c)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
@@ -72,15 +72,15 @@ func (_m *SamlInterface) ConfigureSP(c *request.Context) error {
|
||||
}
|
||||
|
||||
// DoLogin provides a mock function with given fields: c, encodedXML, relayState
|
||||
func (_m *SamlInterface) DoLogin(c *request.Context, encodedXML string, relayState map[string]string) (*model.User, *model.AppError) {
|
||||
func (_m *SamlInterface) DoLogin(c request.CTX, encodedXML string, relayState map[string]string) (*model.User, *model.AppError) {
|
||||
ret := _m.Called(c, encodedXML, relayState)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, map[string]string) (*model.User, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string) (*model.User, *model.AppError)); ok {
|
||||
return rf(c, encodedXML, relayState)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, map[string]string) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string) *model.User); ok {
|
||||
r0 = rf(c, encodedXML, relayState)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -88,7 +88,7 @@ func (_m *SamlInterface) DoLogin(c *request.Context, encodedXML string, relaySta
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, map[string]string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, map[string]string) *model.AppError); ok {
|
||||
r1 = rf(c, encodedXML, relayState)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -100,21 +100,21 @@ func (_m *SamlInterface) DoLogin(c *request.Context, encodedXML string, relaySta
|
||||
}
|
||||
|
||||
// GetMetadata provides a mock function with given fields: c
|
||||
func (_m *SamlInterface) GetMetadata(c *request.Context) (string, *model.AppError) {
|
||||
func (_m *SamlInterface) GetMetadata(c request.CTX) (string, *model.AppError) {
|
||||
ret := _m.Called(c)
|
||||
|
||||
var r0 string
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) (string, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) (string, *model.AppError)); ok {
|
||||
return rf(c)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) string); ok {
|
||||
r0 = rf(c)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX) *model.AppError); ok {
|
||||
r1 = rf(c)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
|
||||
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Ссылка в новой задаче
Block a user