mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-08 17:48:44 +00:00
Previously Anubis constructed challenge strings from request metadata. This was a good idea in spirit, but has turned out to be a very bad idea in practice. This new flow reuses the Store facility to dynamically create challenge values with completely random data. This is a fairly big rewrite of how Anubis processes challenges. Right now it defaults to using the in-memory storage backend, but on-disk (boltdb) and valkey-based adaptors will come soon. Signed-off-by: Xe Iaso <me@xeiaso.net>
12 lines
487 B
Go
12 lines
487 B
Go
package challenge
|
|
|
|
import "time"
|
|
|
|
// Challenge is the metadata about a single challenge issuance.
|
|
type Challenge struct {
|
|
ID string `json:"id"` // UUID identifying the challenge
|
|
RandomData string `json:"randomData"` // The random data the client processes
|
|
IssuedAt time.Time `json:"issuedAt"` // When the challenge was issued
|
|
Metadata map[string]string `json:"metadata"` // Challenge metadata such as IP address and user agent
|
|
}
|