httpapi

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateBearer

func AuthenticateBearer(authenticator authn.Authenticator, next http.Handler) http.Handler

func AuthenticateBearerWithChallenge

func AuthenticateBearerWithChallenge(authenticator authn.Authenticator, challenge BearerChallenge, next http.Handler) http.Handler

AuthenticateBearerWithChallenge is AuthenticateBearer with an optional OAuth discovery challenge on every 401 (RFC 9728 §5.1), so MCP clients learn where to obtain a token.

func AuthenticateRequest

func AuthenticateRequest(authenticator authn.RequestAuthenticator, next http.Handler) http.Handler

func DecodeRepositoryCursor

func DecodeRepositoryCursor(value string) (string, bool)

DecodeRepositoryCursor returns the full name a repository page cursor points past; an empty cursor is valid and means the first page.

func EncodeRepositoryCursor

func EncodeRepositoryCursor(name string) string

EncodeRepositoryCursor builds the opaque cursor that resumes after name.

func GuardSCIMV2

func GuardSCIMV2(next http.Handler, authenticator authn.ProvisioningAuthenticator, service *scim.Service) http.Handler

func PageRepositoriesAfter

func PageRepositoriesAfter(repositories []api.RepositorySummary, after string) []api.RepositorySummary

PageRepositoriesAfter orders the authorized repositories by full name and drops those at or before the cursor. The authorized set is already bounded by the principal's grants, so paging in memory costs nothing extra.

func PrincipalFromContext

func PrincipalFromContext(ctx context.Context) authn.Principal

func RegisterAccount

func RegisterAccount(mux *http.ServeMux, authenticator authn.RequestAuthenticator, service *account.Service, maxRequestBytes, maxResponseBytes int64)

func RegisterAdmin

func RegisterAdmin(mux *http.ServeMux, authenticator authn.RequestAuthenticator, service *admin.Service, maxItems int, maxRequestBytes, maxResponseBytes int64)

func RegisterAuth

func RegisterAuth(mux *http.ServeMux, tokenLogin, breakGlass, fileReads bool, providers []sso.Provider, authenticator authn.RequestAuthenticator, sessions sessionRevoker, metrics *observability.Metrics)

func RegisterFileReads

func RegisterFileReads(mux *http.ServeMux, authenticator authn.RequestAuthenticator, service *repository.Service, maxRequestBytes int64, maxResponseBytes int64)

func RegisterGitHubWebhook

func RegisterGitHubWebhook(mux *http.ServeMux, secret []byte, maxBytes int64, processor webhook.Processor)

func RegisterGraphIngestion

func RegisterGraphIngestion(mux *http.ServeMux, authenticator authn.Authenticator, service *graphingest.Service, maxUploadBytes, maxResponseBytes int64)

func RegisterGraphQueries

func RegisterGraphQueries(mux *http.ServeMux, authenticator authn.Authenticator, service *graphservice.Service, maxRequestBytes, maxResponseBytes int64)

func RegisterLocalAuth

func RegisterLocalAuth(mux *http.ServeMux, publicOrigin string, authenticator *authn.LocalAuthenticator, credentials passwordCredentialSetter)

func RegisterRepositories

func RegisterRepositories(mux *http.ServeMux, authenticator authn.RequestAuthenticator, service *repository.Service, maxRequestBytes int64, maxResults int, maxResponseBytes int64)

func RegisterRepositoryInventory

func RegisterRepositoryInventory(mux *http.ServeMux, authenticator authn.RequestAuthenticator, service *repository.Service, maxResults int, maxResponseBytes int64)

func RegisterSCIP

func RegisterSCIP(mux *http.ServeMux, authenticator authn.RequestAuthenticator, service *scipgraph.Service, maxRequestBytes, maxUploadBytes, maxResponseBytes int64)

func RegisterSearch

func RegisterSearch(mux *http.ServeMux, authenticator authn.RequestAuthenticator, service *search.Service, maxRequestBytes, maxResponseBytes int64)

func RegisterSystem

func RegisterSystem(mux *http.ServeMux, checker ReadyChecker, metrics http.Handler)

func RepositoryErrorMessage

func RepositoryErrorMessage(err error) string

func RequestIDs

func RequestIDs(random io.Reader, next http.Handler) http.Handler

func SCIPErrorMessage

func SCIPErrorMessage(err error) string

Types

type BearerChallenge

type BearerChallenge func(writer http.ResponseWriter, invalidToken bool)

BearerChallenge decorates a 401 with a WWW-Authenticate header. invalidToken is true when a credential was presented and rejected, false when none was.

type ReadyChecker

type ReadyChecker interface {
	Health(context.Context) error
}

Jump to

Keyboard shortcuts

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