Documentation
¶
Index ¶
- func AuthenticateBearer(authenticator authn.Authenticator, next http.Handler) http.Handler
- func AuthenticateBearerWithChallenge(authenticator authn.Authenticator, challenge BearerChallenge, ...) http.Handler
- func AuthenticateRequest(authenticator authn.RequestAuthenticator, next http.Handler) http.Handler
- func DecodeRepositoryCursor(value string) (string, bool)
- func EncodeRepositoryCursor(name string) string
- func GuardSCIMV2(next http.Handler, authenticator authn.ProvisioningAuthenticator, ...) http.Handler
- func PageRepositoriesAfter(repositories []api.RepositorySummary, after string) []api.RepositorySummary
- func PrincipalFromContext(ctx context.Context) authn.Principal
- func RegisterAccount(mux *http.ServeMux, authenticator authn.RequestAuthenticator, ...)
- func RegisterAdmin(mux *http.ServeMux, authenticator authn.RequestAuthenticator, ...)
- func RegisterAuth(mux *http.ServeMux, tokenLogin, breakGlass, fileReads bool, ...)
- func RegisterFileReads(mux *http.ServeMux, authenticator authn.RequestAuthenticator, ...)
- func RegisterGitHubWebhook(mux *http.ServeMux, secret []byte, maxBytes int64, processor webhook.Processor)
- func RegisterGraphIngestion(mux *http.ServeMux, authenticator authn.Authenticator, ...)
- func RegisterGraphQueries(mux *http.ServeMux, authenticator authn.Authenticator, ...)
- func RegisterLocalAuth(mux *http.ServeMux, publicOrigin string, ...)
- func RegisterRepositories(mux *http.ServeMux, authenticator authn.RequestAuthenticator, ...)
- func RegisterRepositoryInventory(mux *http.ServeMux, authenticator authn.RequestAuthenticator, ...)
- func RegisterSCIP(mux *http.ServeMux, authenticator authn.RequestAuthenticator, ...)
- func RegisterSearch(mux *http.ServeMux, authenticator authn.RequestAuthenticator, ...)
- func RegisterSystem(mux *http.ServeMux, checker ReadyChecker, metrics http.Handler)
- func RepositoryErrorMessage(err error) string
- func RequestIDs(random io.Reader, next http.Handler) http.Handler
- func SCIPErrorMessage(err error) string
- type BearerChallenge
- type ReadyChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateBearer ¶
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 DecodeRepositoryCursor ¶
DecodeRepositoryCursor returns the full name a repository page cursor points past; an empty cursor is valid and means the first page.
func EncodeRepositoryCursor ¶
EncodeRepositoryCursor builds the opaque cursor that resumes after name.
func GuardSCIMV2 ¶
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 RegisterAccount ¶
func RegisterAdmin ¶
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 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 RegisterSearch ¶
func RegisterSystem ¶
func RegisterSystem(mux *http.ServeMux, checker ReadyChecker, metrics http.Handler)
func RepositoryErrorMessage ¶
func SCIPErrorMessage ¶
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.