mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-19 12:01:27 +02:00
macaroons: reject unknown macaroon versions
We've only ever made macaroons with the v2 versions, so we should explicitly reject those that aren't actually v2. We add a basic test along the way, and also add a similar check for the version encoded in the macaroon ID.
This commit is contained in:
@@ -65,7 +65,7 @@ func testMacaroonAuthentication(ht *lntest.HarnessTest) {
|
||||
defer cleanup()
|
||||
_, err := client.GetInfo(ctxt, infoReq)
|
||||
require.Error(t, err)
|
||||
require.Contains(t, err.Error(), "cannot get macaroon")
|
||||
require.Contains(t, err.Error(), "invalid ID")
|
||||
},
|
||||
}, {
|
||||
// Third test: Try to access a write method with read-only
|
||||
|
Reference in New Issue
Block a user