mirror of
https://github.com/lightninglabs/aperture.git
synced 2025-12-17 09:04:19 +01:00
auth: create invoice request with closure, add challenger
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
package auth
|
||||
|
||||
import "net/http"
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
)
|
||||
|
||||
// Authenticator is the generic interface for validating client headers and
|
||||
// returning new challenge headers.
|
||||
type Authenticator interface {
|
||||
// Accept returns whether or not the header successfully authenticates the user
|
||||
// to a given backend service.
|
||||
// Accept returns whether or not the header successfully authenticates
|
||||
// the user to a given backend service.
|
||||
Accept(*http.Header) bool
|
||||
|
||||
// FreshChallengeHeader returns a header containing a challenge for the user to
|
||||
// complete.
|
||||
// FreshChallengeHeader returns a header containing a challenge for the
|
||||
// user to complete.
|
||||
FreshChallengeHeader(r *http.Request) (http.Header, error)
|
||||
}
|
||||
|
||||
// Challenger is an interface for generating new payment challenges.
|
||||
type Challenger interface {
|
||||
// NewChallenge creates a new LSAT payment challenge, returning a
|
||||
// payment request (invoice) and the corresponding payment hash.
|
||||
NewChallenge() (string, lntypes.Hash, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user