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:
2 files changed
+30
-20
No files matched your search
+1
-2
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user