Documentation
¶
Overview ¶
Package caphttp is the compatibility facade for the target-oriented HTTP adapter.
Deprecated: use github.com/faustbrian/go-capability/v2/adapters/http. This package remains supported through the documented compatibility interval.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GrantFromContext ¶
func GrantFromContext(ctx context.Context) (capability.Grant, bool)
GrantFromContext returns the verified grant carried by Middleware.
func SignRequest ¶
func SignRequest( ctx context.Context, request *http.Request, payload capability.Payload, profile capability.URLProfile, signer capability.Signer, limits capability.Limits, bodyDigest []byte, ) error
SignRequest signs request.URL after complete successful issuance.
Types ¶
type BodyDigest ¶
BodyDigest obtains an already computed SHA-256 digest. It must not consume a request body unless it also restores it for the application.
type ErrorHandler ¶
type ErrorHandler func(http.ResponseWriter, *http.Request, error)
ErrorHandler writes a secret-safe verification failure response.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier preserves the released compatibility-path type identity while delegating all behavior to the canonical adapter.
func NewVerifier ¶
func NewVerifier(options VerifierOptions) (*Verifier, error)
NewVerifier validates an HTTP integration.
func (*Verifier) Middleware ¶
Middleware verifies and carries a Grant. The next handler remains responsible for authorization, consumption, and protected side-effect ordering.
func (*Verifier) VerifyRequest ¶
VerifyRequest verifies a request but does not authorize or consume its grant.
type VerifierOptions ¶
type VerifierOptions struct {
// Issuer is the required trusted namespace, never inferred from the request.
Issuer string
Profile capability.URLProfile
Resolver capability.Resolver
Origin string
Clock Clock
Skew time.Duration
Limits capability.Limits
Revocations capability.RevocationChecker
BodyDigest BodyDigest
ErrorHandler ErrorHandler
}
VerifierOptions configures signed-URL verification for one immutable profile.