rpcserver+macaroons: extract RawMacaroonFromContext

We'll re-use the code for extracting a macaroon from a request context
later on so we extract it into its own exported function.
This commit is contained in:
Oliver Gugger
2021-08-12 16:07:15 +02:00
parent 29a8661517
commit 96ea4bf05e
2 changed files with 30 additions and 20 deletions

View File

@ -6995,8 +6995,7 @@ func (r *rpcServer) CheckMacaroonPermissions(ctx context.Context,
}
err := r.macService.CheckMacAuth(
ctx, hex.EncodeToString(req.Macaroon), permissions,
req.FullMethod,
ctx, req.Macaroon, permissions, req.FullMethod,
)
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())