Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ResultStop Stop testing other challenges and return ResultStop = Result(iota) // ResultContinue Test next ResultContinue // ResultPass passed, return and proxy ResultPass )
View Source
const ( VerifyResultNONE = VerifyResult(iota) VerifyResultFAIL VerifyResultSKIP // VerifyResultPASS Client just passed this challenge VerifyResultPASS VerifyResultOK VerifyResultBRIEF VerifyResultFULL )
Variables ¶
View Source
var ErrVerifyKeyMismatch = errors.New("verify: key mismatch")
View Source
var ErrVerifyVerifyMismatch = errors.New("verify: verification mismatch")
Functions ¶
This section is empty.
Types ¶
type Challenge ¶
type Challenge struct {
Id Id
Program cel.Program
Name string
Path string
Verify func(key []byte, result string, r *http.Request) (bool, error)
VerifyProbability float64
ServeStatic http.Handler
ServeChallenge func(w http.ResponseWriter, r *http.Request, key []byte, expiry time.Time) Result
ServeScript http.Handler
ServeScriptPath string
ServeMakeChallenge http.Handler
ServeVerifyChallenge http.Handler
}
func (Challenge) IssueChallengeToken ¶
func (Challenge) VerifyChallengeToken ¶
type Token ¶
type Token struct {
Name string `json:"name"`
Key []byte `json:"key"`
Result []byte `json:"result,omitempty"`
Expiry *jwt.NumericDate `json:"exp,omitempty"`
NotBefore *jwt.NumericDate `json:"nbf,omitempty"`
IssuedAt *jwt.NumericDate `json:"iat,omitempty"`
}
type VerifyResult ¶
type VerifyResult int
func (VerifyResult) Ok ¶
func (r VerifyResult) Ok() bool
func (VerifyResult) String ¶
func (r VerifyResult) String() string
Click to show internal directories.
Click to hide internal directories.