Documentation
¶
Index ¶
- Variables
- func AddProfileEndpoints(e *echo.Echo)
- func ArtifactMiddleware(repository shared.ArtifactRepository) func(next echo.HandlerFunc) echo.HandlerFunc
- func AssetAccessControl(obj shared.Object, act shared.Action) shared.MiddlewareFunc
- func AssetNameMiddleware() shared.MiddlewareFunc
- func AssetVersionMiddleware(repository shared.AssetVersionRepository) func(next echo.HandlerFunc) echo.HandlerFunc
- func BlockHandler() echo.HandlerFunc
- func CmdlineHandler() echo.HandlerFunc
- func CsafMiddleware(orgLevel bool, orgRepository shared.OrganizationRepository, ...) echo.MiddlewareFunc
- func DisallowPublicRequests(next echo.HandlerFunc) echo.HandlerFunc
- func EventMiddleware(repository shared.VulnEventRepository) func(next echo.HandlerFunc) echo.HandlerFunc
- func ExternalEntityProviderOrgSyncMiddleware(externalEntityProviderService shared.ExternalEntityProviderService) shared.MiddlewareFunc
- func ExternalEntityProviderRefreshMiddleware(externalEntityProviderService shared.ExternalEntityProviderService) shared.MiddlewareFunc
- func GoroutineHandler() echo.HandlerFunc
- func GoroutineSafeContext(c shared.Context) shared.Context
- func HeapHandler() echo.HandlerFunc
- func IndexHandler() echo.HandlerFunc
- func InstanceAdminMiddleware(pat shared.PersonalAccessTokenService) echo.MiddlewareFunc
- func InstanceSettings(configService shared.ConfigService, ...) echo.MiddlewareFunc
- func MultiOrganizationMiddlewareRBAC() shared.MiddlewareFunc
- func MutexHandler() echo.HandlerFunc
- func NeededScope(NeededScopes []string) shared.MiddlewareFunc
- func OrganizationAccessControlMiddleware(obj shared.Object, act shared.Action) echo.MiddlewareFunc
- func ProfileHandler() echo.HandlerFunc
- func ProjectAccessControl(obj shared.Object, act shared.Action) shared.MiddlewareFunc
- func ProviderIDMiddleware(gitlabIntegrations map[string]*gitlabint.GitlabOauth2Config) shared.MiddlewareFunc
- func ResourceFetchMiddleware(rbacProvider shared.RBACProvider, organizationService shared.OrgService, ...) echo.MiddlewareFunc
- func ScanMiddleware(assetVersionRepository shared.AssetVersionRepository) func(next echo.HandlerFunc) echo.HandlerFunc
- func Server() *echo.Echo
- func SessionMiddleware(oryAPIClient shared.PublicClient, configService shared.ConfigService, ...) echo.MiddlewareFunc
- func ShareMiddleware(orgRepository shared.OrganizationRepository, ...) echo.MiddlewareFunc
- func SymbolHandler() echo.HandlerFunc
- func ThreadCreateHandler() echo.HandlerFunc
- func TraceHandler() echo.HandlerFunc
- func WrapGroup(prefix string, g *echo.Group)
Constants ¶
This section is empty.
Variables ¶
var E *echo.Echo
Functions ¶
func AddProfileEndpoints ¶
AddProfileEndpoints adds several routes from package `net/http/pprof` to *echo.Echo object.
func ArtifactMiddleware ¶
func ArtifactMiddleware(repository shared.ArtifactRepository) func(next echo.HandlerFunc) echo.HandlerFunc
func AssetAccessControl ¶ added in v1.11.0
AssetAccessControl assumes ResourceFetchMiddleware has already resolved the asset (and org/project) into the context - it never fetches anything itself, it only checks the pre-resolved entity against the session/actor scope. It has no captured dependency, so it's a plain shared.RBACMiddleware value, not a factory that needs constructing.
func AssetNameMiddleware ¶
func AssetNameMiddleware() shared.MiddlewareFunc
this middleware is used to set the project slug parameter based on an X-Asset-ID header. it is useful for reusing the projectAccessControl middleware and rely on the rbac to determine if the user has access to an specific asset
func AssetVersionMiddleware ¶
func AssetVersionMiddleware(repository shared.AssetVersionRepository) func(next echo.HandlerFunc) echo.HandlerFunc
func BlockHandler ¶
func BlockHandler() echo.HandlerFunc
BlockHandler will pass the call from /debug/pprof/block to pprof.
func CmdlineHandler ¶
func CmdlineHandler() echo.HandlerFunc
CmdlineHandler will pass the call from /debug/pprof/cmdline to pprof.
func CsafMiddleware ¶
func CsafMiddleware(orgLevel bool, orgRepository shared.OrganizationRepository, projectRepository shared.ProjectRepository, assetRepository shared.AssetRepository, assetVersionRepository shared.AssetVersionRepository, artifactRepository shared.ArtifactRepository) echo.MiddlewareFunc
func DisallowPublicRequests ¶ added in v1.4.2
func DisallowPublicRequests(next echo.HandlerFunc) echo.HandlerFunc
func EventMiddleware ¶
func EventMiddleware(repository shared.VulnEventRepository) func(next echo.HandlerFunc) echo.HandlerFunc
func ExternalEntityProviderOrgSyncMiddleware ¶
func ExternalEntityProviderOrgSyncMiddleware(externalEntityProviderService shared.ExternalEntityProviderService) shared.MiddlewareFunc
ExternalEntityProviderOrgSyncMiddleware returns a middleware that triggers a background org sync for external entity providers. It rate-limits per session owner so the sync runs at most once every 15 minutes.
func ExternalEntityProviderRefreshMiddleware ¶
func ExternalEntityProviderRefreshMiddleware(externalEntityProviderService shared.ExternalEntityProviderService) shared.MiddlewareFunc
ExternalEntityProviderRefreshMiddleware returns a middleware that refreshes external-entity-provider projects for orgs that are external entities. It rate-limits per org+user combination to once every 15 minutes.
func GoroutineHandler ¶
func GoroutineHandler() echo.HandlerFunc
GoroutineHandler will pass the call from /debug/pprof/goroutine to pprof.
func HeapHandler ¶
func HeapHandler() echo.HandlerFunc
HeapHandler will pass the call from /debug/pprof/heap to pprof.
func IndexHandler ¶
func IndexHandler() echo.HandlerFunc
IndexHandler will pass the call from /debug/pprof to pprof.
func InstanceAdminMiddleware ¶ added in v1.6.1
func InstanceAdminMiddleware(pat shared.PersonalAccessTokenService) echo.MiddlewareFunc
func InstanceSettings ¶ added in v1.4.0
func InstanceSettings(configService shared.ConfigService, disabled func(shared.InstanceSettings) bool) echo.MiddlewareFunc
func MultiOrganizationMiddlewareRBAC ¶
func MultiOrganizationMiddlewareRBAC() shared.MiddlewareFunc
MultiOrganizationMiddlewareRBAC assumes ResourceFetchMiddleware has already resolved the org, the domain RBAC and the actor scope into the context - it never fetches anything itself, it only checks organization membership.
func MutexHandler ¶
func MutexHandler() echo.HandlerFunc
MutexHandler will pass the call from /debug/pprof/mutex to pprof.
func NeededScope ¶
func NeededScope(NeededScopes []string) shared.MiddlewareFunc
func ProfileHandler ¶
func ProfileHandler() echo.HandlerFunc
ProfileHandler will pass the call from /debug/pprof/profile to pprof.
func ProjectAccessControl ¶ added in v1.11.0
ProjectAccessControl assumes ResourceFetchMiddleware has already resolved the project (and org) into the context - it never fetches anything itself, it only checks the pre-resolved entity against the session/actor scope. It has no captured dependency, so it's a plain shared.RBACMiddleware value, not a factory that needs constructing.
func ProviderIDMiddleware ¶ added in v1.8.0
func ProviderIDMiddleware(gitlabIntegrations map[string]*gitlabint.GitlabOauth2Config) shared.MiddlewareFunc
ProviderIDMiddleware extracts the :providerID URL param, normalizes it, stores it in the context, and rejects IDs that collide with a configured GitLab integration.
func ResourceFetchMiddleware ¶ added in v1.11.0
func ResourceFetchMiddleware(rbacProvider shared.RBACProvider, organizationService shared.OrgService, projectRepository shared.ProjectRepository, assetRepository shared.AssetRepository) echo.MiddlewareFunc
ResourceFetchMiddleware is the single place that resolves every entity a request needs, once each: the organization (always, by URL slug), the project/asset (when the matched route carries :projectSlug/:assetSlug, by URL slug - the authoritative resolution), and the session's own scoped entity (by owner ID, when the session is a project- or asset-scoped access token), reusing the path-resolved entity when it's the very same row. No other middleware or AccessControl method fetches anything itself.
func ScanMiddleware ¶
func ScanMiddleware(assetVersionRepository shared.AssetVersionRepository) func(next echo.HandlerFunc) echo.HandlerFunc
func SessionMiddleware ¶
func SessionMiddleware(oryAPIClient shared.PublicClient, configService shared.ConfigService, verifier shared.Verifier) echo.MiddlewareFunc
try to authenticate request using (in order) kratos session cookie, bearer token or request signature if one of these methods fail the verification we set "no session" and skip the others
func ShareMiddleware ¶
func ShareMiddleware(orgRepository shared.OrganizationRepository, projectRepository shared.ProjectRepository, assetRepository shared.AssetRepository, assetVersionRepository shared.AssetVersionRepository, artifactRepository shared.ArtifactRepository) echo.MiddlewareFunc
func SymbolHandler ¶
func SymbolHandler() echo.HandlerFunc
SymbolHandler will pass the call from /debug/pprof/symbol to pprof.
func ThreadCreateHandler ¶
func ThreadCreateHandler() echo.HandlerFunc
ThreadCreateHandler will pass the call from /debug/pprof/threadcreate to pprof.
func TraceHandler ¶
func TraceHandler() echo.HandlerFunc
TraceHandler will pass the call from /debug/pprof/trace to pprof.
Types ¶
This section is empty.