botcheckapi

package
v1.169.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 7 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

Overview

Package botcheckapi is the admin REST surface for the named bot checks a bot_check endpoint picks from (#2173, #2259): each check's provider, its site key and the stored secret its key is in, and the proof of work's difficulty and how a flood raises it.

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 {
	Checks botcheck.Store
	// 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 checks and what verifies them.

type List added in v1.152.0

type List struct {
	Checks []View `json:"checks"`
	// 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"`
}

List is the list route's answer.

type View

type View struct {
	botcheck.Check
	// UsedBy is the endpoints that name the check; a check any endpoint names
	// cannot be deleted.
	UsedBy []string `json:"used_by"`
	// Usable is false for a proof of work on a deployment that cannot sign
	// one, which no endpoint can be bound to.
	Usable bool `json:"usable"`
}

View is one check as the settings page reads it.

Jump to

Keyboard shortcuts

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