Documentation
¶
Index ¶
- Constants
- type AIHandler
- type AdminAIHandler
- type AdminAuditHandler
- type AdminGPGHandler
- type AdminGroupsHandler
- type AdminPermissionsHandler
- type AdminSSOHandler
- type AdminStorageHandler
- type AdminTokensHandler
- type AdminUsersHandler
- type AuthHandler
- type BackupHandler
- type BundlesHandler
- type CleanupHandler
- type DebUploadHandler
- type DeltaHandler
- type ErrorResponse
- type HTTPServer
- func (s *HTTPServer) AddMiddleware(middleware func(http.Handler) http.Handler)
- func (s *HTTPServer) GetRouter() chi.Router
- func (s *HTTPServer) RegisterHandler(handler Handler) error
- func (s *HTTPServer) SetTimeouts(readTimeout, writeTimeout, readHeaderTimeout time.Duration)
- func (s *HTTPServer) Start(ctx context.Context) error
- func (s *HTTPServer) Stop(ctx context.Context) error
- type Handler
- type LicenseHandler
- type MavenUploadHandler
- type NPMUploadHandler
- type OIDCHandler
- type OpenAPIHandler
- type OrgsHandler
- type PropertiesHandler
- type QuotasHandler
- type RPMUploadHandler
- type RepositoriesHandler
- type Response
- type SAMLHandler
- type SBOMHandler
- type SecretsHandler
- type SelfTokensHandler
- type Server
- type SystemInfoHandler
- type VulnHandler
- type WebhooksHandler
Constants ¶
const MaxMavenUploadBytes int64 = 1 << 30 // 1 GiB
const MaxNPMUploadBytes int64 = 200 << 20
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIHandler ¶
type AIHandler struct {
// contains filtered or unexported fields
}
AIHandler handles AI analysis REST endpoints.
type AdminAIHandler ¶
type AdminAIHandler struct {
// contains filtered or unexported fields
}
func NewAdminAIHandler ¶
func (*AdminAIHandler) Register ¶
func (h *AdminAIHandler) Register(r chi.Router)
type AdminAuditHandler ¶
type AdminAuditHandler struct {
// contains filtered or unexported fields
}
func NewAdminAuditHandler ¶
func (*AdminAuditHandler) Register ¶
func (h *AdminAuditHandler) Register(r chi.Router)
type AdminGPGHandler ¶
type AdminGPGHandler struct {
// contains filtered or unexported fields
}
func NewAdminGPGHandler ¶
func (*AdminGPGHandler) Register ¶
func (h *AdminGPGHandler) Register(r chi.Router)
type AdminGroupsHandler ¶
type AdminGroupsHandler struct {
// contains filtered or unexported fields
}
func NewAdminGroupsHandler ¶
func (*AdminGroupsHandler) Register ¶
func (h *AdminGroupsHandler) Register(r chi.Router)
type AdminPermissionsHandler ¶
type AdminPermissionsHandler struct {
// contains filtered or unexported fields
}
func (*AdminPermissionsHandler) Register ¶
func (h *AdminPermissionsHandler) Register(r chi.Router)
type AdminSSOHandler ¶
type AdminSSOHandler struct {
// contains filtered or unexported fields
}
func NewAdminSSOHandler ¶
func (*AdminSSOHandler) RegisterAuthed ¶
func (h *AdminSSOHandler) RegisterAuthed(authed chi.Router)
func (*AdminSSOHandler) RegisterPublic ¶
func (h *AdminSSOHandler) RegisterPublic(r chi.Router)
type AdminStorageHandler ¶
type AdminStorageHandler struct {
// contains filtered or unexported fields
}
func NewAdminStorageHandler ¶
func (*AdminStorageHandler) Register ¶
func (h *AdminStorageHandler) Register(r chi.Router)
type AdminTokensHandler ¶
type AdminTokensHandler struct {
// contains filtered or unexported fields
}
func NewAdminTokensHandler ¶
func (*AdminTokensHandler) Register ¶
func (h *AdminTokensHandler) Register(r chi.Router)
type AdminUsersHandler ¶
type AdminUsersHandler struct {
// contains filtered or unexported fields
}
func NewAdminUsersHandler ¶
func (*AdminUsersHandler) Register ¶
func (h *AdminUsersHandler) Register(r chi.Router)
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func NewAuthHandler ¶
func NewAuthHandler(db database.Database, log *logger.Logger, evaluator *auth.Evaluator, trustedProxies *middleware.TrustedProxies) *AuthHandler
func (*AuthHandler) RegisterAuthed ¶
func (h *AuthHandler) RegisterAuthed(r chi.Router)
func (*AuthHandler) RegisterPublic ¶
func (h *AuthHandler) RegisterPublic(r chi.Router)
type BackupHandler ¶
type BackupHandler struct {
// contains filtered or unexported fields
}
func NewBackupHandler ¶
func (*BackupHandler) RegisterAuthed ¶
func (h *BackupHandler) RegisterAuthed(r chi.Router)
type BundlesHandler ¶
type BundlesHandler struct {
// contains filtered or unexported fields
}
func NewBundlesHandler ¶
func (*BundlesHandler) RegisterAuthed ¶
func (h *BundlesHandler) RegisterAuthed(r chi.Router)
type CleanupHandler ¶
type CleanupHandler struct {
// contains filtered or unexported fields
}
func NewCleanupHandler ¶
func (*CleanupHandler) RegisterAuthed ¶
func (h *CleanupHandler) RegisterAuthed(r chi.Router)
type DebUploadHandler ¶
type DebUploadHandler struct {
// contains filtered or unexported fields
}
func NewDebUploadHandler ¶
func (*DebUploadHandler) Register ¶
func (h *DebUploadHandler) Register(router chi.Router)
func (*DebUploadHandler) SetDebWorker ¶
func (h *DebUploadHandler) SetDebWorker(w *worker.DebMetadataWorker)
type DeltaHandler ¶
type DeltaHandler struct {
// contains filtered or unexported fields
}
DeltaHandler handles package delta requests.
func NewDeltaHandler ¶
func NewDeltaHandler(log *logger.Logger, db database.Database, blobStore storage.BlobStore) *DeltaHandler
NewDeltaHandler creates a new DeltaHandler.
func (*DeltaHandler) Register ¶
func (h *DeltaHandler) Register(router chi.Router)
Register registers the delta routes on the given router.
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
Code string `json:"code"`
Details string `json:"details,omitempty"`
}
ErrorResponse represents an error response.
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer implements the Server interface.
func NewHTTPServer ¶
func NewHTTPServer(addr string, log *logger.Logger) *HTTPServer
NewHTTPServer creates a new HTTP server. Defaults favor never truncating large artifact transfers: no read/write timeout, with only header reads bounded (slowloris mitigation) until SetTimeouts overrides them from config.
func (*HTTPServer) AddMiddleware ¶
func (s *HTTPServer) AddMiddleware(middleware func(http.Handler) http.Handler)
AddMiddleware adds a middleware to the server.
func (*HTTPServer) GetRouter ¶
func (s *HTTPServer) GetRouter() chi.Router
GetRouter returns the underlying chi router.
func (*HTTPServer) RegisterHandler ¶
func (s *HTTPServer) RegisterHandler(handler Handler) error
RegisterHandler registers an API handler.
func (*HTTPServer) SetTimeouts ¶
func (s *HTTPServer) SetTimeouts(readTimeout, writeTimeout, readHeaderTimeout time.Duration)
SetTimeouts configures read, write, and read-header timeouts on the HTTP server. readTimeout/writeTimeout of 0 mean "no limit" (relevant for large artifact transfers); readHeaderTimeout should stay non-zero regardless — it bounds only the header-read phase, so it never truncates a body.
type Handler ¶
type Handler interface {
// Register registers the handler's routes
Register(router chi.Router)
// Name returns the handler name
Name() string
}
Handler defines the interface for API handlers.
type LicenseHandler ¶
type LicenseHandler struct {
// contains filtered or unexported fields
}
func NewLicenseHandler ¶
func (*LicenseHandler) RegisterRoutes ¶
func (h *LicenseHandler) RegisterRoutes(authedRouter chi.Router)
type MavenUploadHandler ¶
type MavenUploadHandler struct {
// contains filtered or unexported fields
}
func NewMavenUploadHandler ¶
func (*MavenUploadHandler) Register ¶
func (h *MavenUploadHandler) Register(router chi.Router)
Register mounts PUT/DELETE using a true chi wildcard ("/*"), not a regexp param: chi's {name:regexp} params never span "/" (the tail delimiter defaults to '/', so the regexp is only ever tested against a single path segment), so {path:.*} can never match a multi-segment GAV path and silently 404s every real upload/delete.
func (*MavenUploadHandler) SetMavenWorker ¶
func (h *MavenUploadHandler) SetMavenWorker(w *worker.MavenMetadataWorker)
SetMavenWorker wires the debounced maven-metadata.xml regeneration worker. Call NotifyStale(repoID, groupID, artifactID) after each successful upload.
type NPMUploadHandler ¶
type NPMUploadHandler struct {
// contains filtered or unexported fields
}
func NewNPMUploadHandler ¶
func (*NPMUploadHandler) Register ¶
func (h *NPMUploadHandler) Register(router chi.Router)
func (*NPMUploadHandler) SetNPMWorker ¶
func (h *NPMUploadHandler) SetNPMWorker(w *worker.NPMMetadataWorker)
SetNPMWorker wires the debounced npm packument regeneration worker. Call NotifyStale(packageID) after each successful publish.
type OIDCHandler ¶
type OIDCHandler struct {
// contains filtered or unexported fields
}
func NewOIDCHandler ¶
func (*OIDCHandler) RegisterPublic ¶
func (h *OIDCHandler) RegisterPublic(public chi.Router)
type OpenAPIHandler ¶
type OpenAPIHandler struct{}
func NewOpenAPIHandler ¶
func NewOpenAPIHandler() *OpenAPIHandler
func (*OpenAPIHandler) RegisterRoutes ¶
func (h *OpenAPIHandler) RegisterRoutes(router chi.Router)
type OrgsHandler ¶
type OrgsHandler struct {
// contains filtered or unexported fields
}
func NewOrgsHandler ¶
func NewOrgsHandler(db database.Database, log *logger.Logger) *OrgsHandler
func (*OrgsHandler) RegisterRoutes ¶
func (h *OrgsHandler) RegisterRoutes(r chi.Router)
type PropertiesHandler ¶
type PropertiesHandler struct {
// contains filtered or unexported fields
}
func NewPropertiesHandler ¶
func NewPropertiesHandler(log *logger.Logger, db database.Database) *PropertiesHandler
func (*PropertiesHandler) RegisterRoutes ¶
func (h *PropertiesHandler) RegisterRoutes(r chi.Router, pathPrefix string)
type QuotasHandler ¶
type QuotasHandler struct {
// contains filtered or unexported fields
}
func NewQuotasHandler ¶
func NewQuotasHandler(log *logger.Logger, db database.Database) *QuotasHandler
func (*QuotasHandler) RegisterRoutes ¶
func (h *QuotasHandler) RegisterRoutes(r chi.Router, pathPrefix string)
type RPMUploadHandler ¶
type RPMUploadHandler struct {
// contains filtered or unexported fields
}
func NewRPMUploadHandler ¶
func (*RPMUploadHandler) Register ¶
func (h *RPMUploadHandler) Register(router chi.Router)
func (*RPMUploadHandler) SetDebWorker ¶
func (h *RPMUploadHandler) SetDebWorker(w *worker.DebMetadataWorker)
func (*RPMUploadHandler) SetRPMWorker ¶
func (h *RPMUploadHandler) SetRPMWorker(w *worker.RPMetadataWorker)
type RepositoriesHandler ¶
type RepositoriesHandler struct {
// contains filtered or unexported fields
}
func NewRepositoriesHandler ¶
func (*RepositoriesHandler) RegisterAuthed ¶
func (h *RepositoriesHandler) RegisterAuthed(r chi.Router)
type Response ¶
type Response struct {
Success bool `json:"success"`
Data any `json:"data,omitempty"`
Error string `json:"error,omitempty"`
Code string `json:"code,omitempty"`
}
Response represents a standard API response.
type SAMLHandler ¶
type SAMLHandler struct {
// contains filtered or unexported fields
}
func NewSAMLHandler ¶
func (*SAMLHandler) RegisterPublic ¶
func (h *SAMLHandler) RegisterPublic(public chi.Router)
type SBOMHandler ¶
type SBOMHandler struct {
// contains filtered or unexported fields
}
func NewSBOMHandler ¶
func (*SBOMHandler) RegisterAuthed ¶
func (h *SBOMHandler) RegisterAuthed(r chi.Router)
type SecretsHandler ¶
type SecretsHandler struct {
// contains filtered or unexported fields
}
func NewSecretsHandler ¶
func (*SecretsHandler) RegisterRoutes ¶
func (h *SecretsHandler) RegisterRoutes(authedRouter chi.Router, pathPrefix string)
type SelfTokensHandler ¶
type SelfTokensHandler struct {
// contains filtered or unexported fields
}
func NewSelfTokensHandler ¶
func (*SelfTokensHandler) Register ¶
func (h *SelfTokensHandler) Register(r chi.Router)
type Server ¶
type Server interface {
// Start starts the server
Start(ctx context.Context) error
// Stop gracefully stops the server
Stop(ctx context.Context) error
// RegisterHandler registers an API handler
RegisterHandler(handler Handler) error
// GetRouter returns the underlying router
GetRouter() chi.Router
}
Server defines the interface for the HTTP server.
type SystemInfoHandler ¶
type SystemInfoHandler struct {
// contains filtered or unexported fields
}
func NewSystemInfoHandler ¶
func (*SystemInfoHandler) RegisterPublic ¶
func (h *SystemInfoHandler) RegisterPublic(r chi.Router)
func (*SystemInfoHandler) ServeHTTP ¶
func (h *SystemInfoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type VulnHandler ¶
type VulnHandler struct {
// contains filtered or unexported fields
}
VulnHandler handles vulnerability scanning endpoints.
func NewVulnHandler ¶
func NewVulnHandler(db database.Database, log *logger.Logger) *VulnHandler
NewVulnHandler creates a new vulnerability handler.
func (*VulnHandler) RegisterRoutes ¶
func (h *VulnHandler) RegisterRoutes(authedRouter chi.Router, pathPrefix string)
RegisterRoutes registers vulnerability scanning routes.
type WebhooksHandler ¶
type WebhooksHandler struct {
// contains filtered or unexported fields
}
func NewWebhooksHandler ¶
func NewWebhooksHandler(db database.Database, log *logger.Logger, evaluator *auth.Evaluator, dispatcher *webhook.Dispatcher) *WebhooksHandler
func (*WebhooksHandler) RegisterAuthed ¶
func (h *WebhooksHandler) RegisterAuthed(r chi.Router)
Source Files
¶
- admin_ai.go
- admin_audit.go
- admin_gpg.go
- admin_groups.go
- admin_permissions.go
- admin_sso.go
- admin_storage.go
- admin_tokens.go
- admin_users.go
- ai.go
- auth_handlers.go
- auth_helpers.go
- backup.go
- bundles.go
- cleanup.go
- cookie.go
- delta.go
- interfaces.go
- license.go
- openapi.go
- orgs.go
- properties.go
- quotas.go
- repositories.go
- sbom.go
- secrets.go
- self_tokens.go
- server.go
- sso_oidc_handlers.go
- sso_saml_handlers.go
- system_info.go
- upload_deb.go
- upload_maven.go
- upload_npm.go
- upload_rpm.go
- vuln.go
- webhooks.go