middlewares

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddProfileEndpoints

func AddProfileEndpoints(e *echo.Echo)

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 AssetAccessControlFactory

func AssetAccessControlFactory(assetRepository shared.AssetRepository) shared.RBACMiddleware

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 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 user 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 GoroutineSafeContext

func GoroutineSafeContext(c shared.Context) shared.Context

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 MultiOrganizationMiddlewareRBAC

func MultiOrganizationMiddlewareRBAC(rbacProvider shared.RBACProvider, organizationService shared.OrgService, oauth2Config map[string]*gitlabint.GitlabOauth2Config) shared.MiddlewareFunc

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 OrganizationAccessControlMiddleware

func OrganizationAccessControlMiddleware(obj shared.Object, act shared.Action) echo.MiddlewareFunc

func ProfileHandler

func ProfileHandler() echo.HandlerFunc

ProfileHandler will pass the call from /debug/pprof/profile to pprof.

func ProjectAccessControlFactory

func ProjectAccessControlFactory(projectRepository shared.ProjectRepository) shared.RBACMiddleware

func ScanMiddleware

func ScanMiddleware(assetVersionRepository shared.AssetVersionRepository) func(next echo.HandlerFunc) echo.HandlerFunc

func Server

func Server() *echo.Echo

func SessionMiddleware

func SessionMiddleware(oryAPIClient shared.PublicClient, verifier shared.Verifier) echo.MiddlewareFunc

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.

func WrapGroup

func WrapGroup(prefix string, g *echo.Group)

WrapGroup adds several routes from package `net/http/pprof` to *echo.Group object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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