mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 08:59:31 -05:00
f9cbea3d6b
Was facing issues while writing unit tests for federation code. Mocks weren't catching all network calls, because was being out of scope of the mocking infra. Plus, I think we can have more granular tests. This PR puts the client behind an interface, that can be retrieved from `ctx`. Context doesn't require initialization, as it defaults to the implementation available in-tree. It may be overridden when required (like testing). ## Mechanism 1. Get client factory from `ctx` (factory contains network and crypto parameters that are needed) 2. Initialize client with sender's keys and the receiver's public key 3. Use client as before. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4853 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net> Co-committed-by: Aravinth Manivannan <realaravinth@batsense.net>
295 lines
5.6 KiB
Text
295 lines
5.6 KiB
Text
code.gitea.io/gitea/cmd
|
|
NoMainListener
|
|
|
|
code.gitea.io/gitea/cmd/forgejo
|
|
ContextSetNoInit
|
|
ContextSetNoExit
|
|
ContextSetStderr
|
|
ContextGetStderr
|
|
ContextSetStdout
|
|
ContextSetStdin
|
|
|
|
code.gitea.io/gitea/models
|
|
IsErrUpdateTaskNotExist
|
|
ErrUpdateTaskNotExist.Error
|
|
ErrUpdateTaskNotExist.Unwrap
|
|
IsErrSHANotFound
|
|
IsErrMergeDivergingFastForwardOnly
|
|
GetYamlFixturesAccess
|
|
|
|
code.gitea.io/gitea/models/actions
|
|
ScheduleList.GetUserIDs
|
|
ScheduleList.GetRepoIDs
|
|
ScheduleList.LoadTriggerUser
|
|
ScheduleList.LoadRepos
|
|
|
|
code.gitea.io/gitea/models/asymkey
|
|
ErrGPGKeyAccessDenied.Error
|
|
ErrGPGKeyAccessDenied.Unwrap
|
|
HasDeployKey
|
|
|
|
code.gitea.io/gitea/models/auth
|
|
GetSourceByName
|
|
WebAuthnCredentials
|
|
|
|
code.gitea.io/gitea/models/db
|
|
TruncateBeans
|
|
InTransaction
|
|
DumpTables
|
|
|
|
code.gitea.io/gitea/models/dbfs
|
|
file.renameTo
|
|
Create
|
|
Rename
|
|
|
|
code.gitea.io/gitea/models/forgefed
|
|
GetFederationHost
|
|
|
|
code.gitea.io/gitea/models/forgejo/semver
|
|
GetVersion
|
|
SetVersionString
|
|
SetVersion
|
|
|
|
code.gitea.io/gitea/models/git
|
|
RemoveDeletedBranchByID
|
|
|
|
code.gitea.io/gitea/models/issues
|
|
IsErrUnknownDependencyType
|
|
ErrNewIssueInsert.Error
|
|
IsErrIssueWasClosed
|
|
ChangeMilestoneStatus
|
|
|
|
code.gitea.io/gitea/models/organization
|
|
GetTeamNamesByID
|
|
UpdateTeamUnits
|
|
SearchMembersOptions.ToConds
|
|
UsersInTeamsCount
|
|
|
|
code.gitea.io/gitea/models/perm/access
|
|
GetRepoWriters
|
|
|
|
code.gitea.io/gitea/models/project
|
|
UpdateColumnSorting
|
|
ChangeProjectStatus
|
|
|
|
code.gitea.io/gitea/models/repo
|
|
DeleteAttachmentsByIssue
|
|
FindReposMapByIDs
|
|
IsErrTopicNotExist
|
|
ErrTopicNotExist.Error
|
|
ErrTopicNotExist.Unwrap
|
|
GetTopicByName
|
|
WatchRepoMode
|
|
|
|
code.gitea.io/gitea/models/user
|
|
ErrUserInactive.Error
|
|
ErrUserInactive.Unwrap
|
|
IsErrExternalLoginUserAlreadyExist
|
|
IsErrExternalLoginUserNotExist
|
|
NewFederatedUser
|
|
IsErrUserSettingIsNotExist
|
|
GetUserAllSettings
|
|
DeleteUserSetting
|
|
GetUserEmailsByNames
|
|
GetUserNamesByIDs
|
|
|
|
code.gitea.io/gitea/modules/activitypub
|
|
NewContext
|
|
Context.APClientFactory
|
|
|
|
code.gitea.io/gitea/modules/assetfs
|
|
Bindata
|
|
|
|
code.gitea.io/gitea/modules/auth/password/hash
|
|
DummyHasher.HashWithSaltBytes
|
|
NewDummyHasher
|
|
|
|
code.gitea.io/gitea/modules/auth/password/pwn
|
|
WithHTTP
|
|
|
|
code.gitea.io/gitea/modules/base
|
|
SetupGiteaRoot
|
|
|
|
code.gitea.io/gitea/modules/cache
|
|
GetInt
|
|
WithNoCacheContext
|
|
RemoveContextData
|
|
|
|
code.gitea.io/gitea/modules/charset
|
|
BreakWriter.Write
|
|
|
|
code.gitea.io/gitea/modules/emoji
|
|
ReplaceCodes
|
|
|
|
code.gitea.io/gitea/modules/eventsource
|
|
Event.String
|
|
|
|
code.gitea.io/gitea/modules/forgefed
|
|
GetItemByType
|
|
JSONUnmarshalerFn
|
|
NotEmpty
|
|
ToRepository
|
|
OnRepository
|
|
|
|
code.gitea.io/gitea/modules/git
|
|
AllowLFSFiltersArgs
|
|
AddChanges
|
|
AddChangesWithArgs
|
|
CommitChanges
|
|
CommitChangesWithArgs
|
|
IsErrExecTimeout
|
|
ErrExecTimeout.Error
|
|
ErrUnsupportedVersion.Error
|
|
SetUpdateHook
|
|
openRepositoryWithDefaultContext
|
|
IsTagExist
|
|
ToEntryMode
|
|
LimitedReaderCloser.Read
|
|
LimitedReaderCloser.Close
|
|
|
|
code.gitea.io/gitea/modules/gitgraph
|
|
Parser.Reset
|
|
|
|
code.gitea.io/gitea/modules/gitrepo
|
|
GetBranchCommitID
|
|
GetWikiDefaultBranch
|
|
|
|
code.gitea.io/gitea/modules/graceful
|
|
Manager.TerminateContext
|
|
Manager.Err
|
|
Manager.Value
|
|
Manager.Deadline
|
|
|
|
code.gitea.io/gitea/modules/hcaptcha
|
|
WithHTTP
|
|
|
|
code.gitea.io/gitea/modules/json
|
|
StdJSON.Marshal
|
|
StdJSON.Unmarshal
|
|
StdJSON.NewEncoder
|
|
StdJSON.NewDecoder
|
|
StdJSON.Indent
|
|
|
|
code.gitea.io/gitea/modules/markup
|
|
GetRendererByType
|
|
RenderString
|
|
IsMarkupFile
|
|
|
|
code.gitea.io/gitea/modules/markup/console
|
|
Render
|
|
RenderString
|
|
|
|
code.gitea.io/gitea/modules/markup/markdown
|
|
IsDetails
|
|
IsSummary
|
|
IsTaskCheckBoxListItem
|
|
IsIcon
|
|
RenderRawString
|
|
|
|
code.gitea.io/gitea/modules/markup/markdown/math
|
|
WithInlineDollarParser
|
|
WithBlockDollarParser
|
|
|
|
code.gitea.io/gitea/modules/markup/mdstripper
|
|
stripRenderer.AddOptions
|
|
StripMarkdown
|
|
|
|
code.gitea.io/gitea/modules/markup/orgmode
|
|
RenderString
|
|
|
|
code.gitea.io/gitea/modules/private
|
|
ActionsRunnerRegister
|
|
|
|
code.gitea.io/gitea/modules/process
|
|
Manager.ExecTimeout
|
|
|
|
code.gitea.io/gitea/modules/queue
|
|
newBaseChannelSimple
|
|
newBaseChannelUnique
|
|
newBaseRedisSimple
|
|
newBaseRedisUnique
|
|
testStateRecorder.Records
|
|
testStateRecorder.Reset
|
|
newWorkerPoolQueueForTest
|
|
|
|
code.gitea.io/gitea/modules/queue/lqinternal
|
|
QueueItemIDBytes
|
|
QueueItemKeyBytes
|
|
ListLevelQueueKeys
|
|
|
|
code.gitea.io/gitea/modules/setting
|
|
NewConfigProviderFromData
|
|
GitConfigType.GetOption
|
|
InitLoggersForTest
|
|
|
|
code.gitea.io/gitea/modules/storage
|
|
ErrInvalidConfiguration.Error
|
|
IsErrInvalidConfiguration
|
|
|
|
code.gitea.io/gitea/modules/structs
|
|
ParseCreateHook
|
|
ParsePushHook
|
|
|
|
code.gitea.io/gitea/modules/sync
|
|
StatusTable.Start
|
|
StatusTable.IsRunning
|
|
|
|
code.gitea.io/gitea/modules/timeutil
|
|
GetExecutableModTime
|
|
MockSet
|
|
MockUnset
|
|
|
|
code.gitea.io/gitea/modules/translation
|
|
MockLocale.Language
|
|
MockLocale.TrString
|
|
MockLocale.Tr
|
|
MockLocale.TrN
|
|
MockLocale.TrSize
|
|
MockLocale.PrettyNumber
|
|
|
|
code.gitea.io/gitea/modules/util/filebuffer
|
|
CreateFromReader
|
|
|
|
code.gitea.io/gitea/modules/validation
|
|
IsErrNotValid
|
|
|
|
code.gitea.io/gitea/modules/web
|
|
RouteMock
|
|
RouteMockReset
|
|
|
|
code.gitea.io/gitea/modules/web/middleware
|
|
DeleteLocaleCookie
|
|
|
|
code.gitea.io/gitea/routers/web
|
|
NotFound
|
|
|
|
code.gitea.io/gitea/routers/web/org
|
|
MustEnableProjects
|
|
|
|
code.gitea.io/gitea/services/context
|
|
GetPrivateContext
|
|
|
|
code.gitea.io/gitea/services/convert
|
|
ToSecret
|
|
|
|
code.gitea.io/gitea/services/forms
|
|
DeadlineForm.Validate
|
|
|
|
code.gitea.io/gitea/services/pull
|
|
IsCommitStatusContextSuccess
|
|
|
|
code.gitea.io/gitea/services/repository
|
|
IsErrForkAlreadyExist
|
|
|
|
code.gitea.io/gitea/services/repository/archiver
|
|
ArchiveRepository
|
|
|
|
code.gitea.io/gitea/services/repository/files
|
|
ContentType.String
|
|
GetFileResponseFromCommit
|
|
TemporaryUploadRepository.GetLastCommit
|
|
TemporaryUploadRepository.GetLastCommitByRef
|
|
|
|
code.gitea.io/gitea/services/webhook
|
|
NewNotifier
|
|
|