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 committed 2021-09-20 13:05:33 +02:00
1 parent 29a8661517
commit 96ea4bf05e
2 files changed
+30 -20

No files matched your search

+1 -2
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())