Files
aperture/auth/mock_test.go
Wilmer Paulino 38cd0e7847 auth: integrate proper macaroon creation and verification
We move the proxy from using its placeholder macaroon creation and
verification to instead use the agreed upon macaroon design. Much of
this is solely a refactor, but some new functionality has also been
introduced as part of integrating the LSAT mint:

1. A request's target service is now verified to ensure its attached
   LSAT is authorized.

2. The preimage is now checked against the token's committed payment
   hash to ensure it has been paid for.
2019-11-26 11:13:19 -08:00

26 lines
483 B
Go

package auth_test
import (
"context"
"github.com/lightninglabs/kirin/auth"
"github.com/lightninglabs/kirin/mint"
"github.com/lightninglabs/loop/lsat"
"gopkg.in/macaroon.v2"
)
type mockMint struct {
}
var _ auth.Minter = (*mockMint)(nil)
func (m *mockMint) MintLSAT(_ context.Context,
services ...lsat.Service) (*macaroon.Macaroon, string, error) {
return nil, "", nil
}
func (m *mockMint) VerifyLSAT(_ context.Context, p *mint.VerificationParams) error {
return nil
}