Help us shape the future of Go! Take the 2026 Go Developer Survey

botcheckapi

package
v1.149.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package botcheckapi is the admin REST surface for the bot check public endpoints require (#2173): which provider checks, its site key and the stored secret its key is in, the proof of work's difficulty and how a flood raises it, and the override that lets a public endpoint run with no check.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(mux *http.ServeMux, wrap func(http.Handler) http.Handler, cfg Config)

Register mounts the routes, each behind wrap, the admin API's authentication.

Types

type Config

type Config struct {
	Settings botcheck.SettingsStore
	// KeyAvailable is whether the deployment can sign a proof-of-work
	// challenge (auth.browser_session.signing_key).
	KeyAvailable bool
	// Secret reads the stored secret a provider's key is in, refusing one
	// the bot check may not use (botcheck.SecretUse).
	Secret func(ctx context.Context, name string) (string, error)
	// Author resolves the acting admin.
	Author func(*http.Request) string
}

Config carries the settings and what checks them.

type View

type View struct {
	botcheck.View
	// KeyAvailable is whether a proof-of-work challenge can be signed: a
	// deployment with no browser-session signing key cannot.
	KeyAvailable bool `json:"key_available"`
	// PublicAllowed is whether a public endpoint can be bound and answered
	// under these settings.
	PublicAllowed bool `json:"public_allowed"`
}

View is the settings as the page reads them.

Jump to

Keyboard shortcuts

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