multi: add AddActionReq MacaroonId helper func

Add helper method to `AddActionReq` returns the 4 byte macaroon ID that
is derived from the MacaroonRootKeyID. Using the helper removes some
code repetition at call sites, and makes the intended usage clearer.
This commit is contained in:
Viktor Torstensson 2025-10-03 11:35:45 +02:00
parent 01bc36ca41
commit bd59605516
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4
4 changed files with 15 additions and 13 deletions

View file

@ -817,10 +817,7 @@ func (s *sessionRpcServer) ListActions(ctx context.Context,
sessionID = id
})
var macID [4]byte
a.MacaroonRootKeyID.WhenSome(func(rootID uint64) {
macID = session.IDFromMacRootKeyID(rootID)
})
macID := a.MacaroonId()
resp[i] = &litrpc.Action{
SessionId: sessionID[:],