mirror of
https://github.com/lightninglabs/aperture.git
synced 2026-01-02 17:04:25 +01:00
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.
26 lines
483 B
Go
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
|
|
}
|