Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFailed = errors.New("challenge: user failed challenge") ErrMissingField = errors.New("challenge: missing field") ErrInvalidFormat = errors.New("challenge: field has invalid format") )
View Source
var TimeTaken = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "anubis_time_taken", Help: "The time taken for a browser to generate a response (milliseconds)", Buckets: prometheus.ExponentialBucketsRange(1, math.Pow(2, 20), 20), }, []string{"method"})
Functions ¶
Types ¶
type Challenge ¶ added in v1.21.0
type Challenge struct {
IssuedAt time.Time `json:"issuedAt"`
Metadata map[string]string `json:"metadata"`
ID string `json:"id"`
Method string `json:"method"`
RandomData string `json:"randomData"`
PolicyRuleHash string `json:"policyRuleHash,omitempty"`
Difficulty int `json:"difficulty,omitempty"`
Spent bool `json:"spent"`
}
Challenge is the metadata about a single challenge issuance.
type Impl ¶
type Impl interface {
// Setup registers any additional routes with the Impl for assets or API routes.
Setup(mux *http.ServeMux)
// Issue a new challenge to the user, called by the Anubis.
Issue(w http.ResponseWriter, r *http.Request, lg *slog.Logger, in *IssueInput) (templ.Component, error)
// Validate a challenge, making sure that it passes muster.
Validate(r *http.Request, lg *slog.Logger, in *ValidateInput) error
}
type IssueInput ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
templ: version: v0.3.960
|
templ: version: v0.3.960 |
|
templ: version: v0.3.960
|
templ: version: v0.3.960 |
|
templ: version: v0.3.960
|
templ: version: v0.3.960 |
Click to show internal directories.
Click to hide internal directories.