Repository navigation
Conversation
55aa838 to
18f68a2
Compare
|
@Lrifton92 thanks for checking the claims against the code rather than just the prose. You are right that the sentence read too broadly, and looking into it turned up a mistake of my own, so both are fixed in the latest push:
|
🟢 PR Severity: LOW
🟢 Low (1 file)
AnalysisThe only file changed is To override, add a |
|
@Lrifton92: review reminder |
1 similar comment
|
@Lrifton92: review reminder |
18f68a2 to
8c9d798
Compare
|
@Lrifton92: review reminder |
1 similar comment
|
@Lrifton92: review reminder |
The README documented only the three macaroons baked at startup and two constraints. Document the sub server macaroons and `--stateless_init`, add the missing `onchain:read` op to the invoice permission example, and rewrite the constraints section to cover the IP range and custom caveat constraints, how a constraint is applied and which checkers validate the conditions. Also drop the upgrade section for versions older than v0.9.0-beta.
8c9d798 to
681a365
Compare
Change Description
Depends on #11117. The
ProtectorConstraintbullet below documents the constraint that PR adds, so this one should be merged after it.macaroons/README.mdhas drifted from the code. This refreshes it. No code changes, documentation only.Macaroons baked at startup. The README described only
admin.macaroon,invoice.macaroonandreadonly.macaroon. Five sub servers also bake one of their own on first startup when they are compiled in (router, signer, walletkit, chainnotifier, invoices), and four of those files can be pointed elsewhere with a command line option. They are now listed with the permissions they carry, along with what --stateless_init means for them: no file is written, and only the admin macaroon comes back over RPC.Permission example. The
invoice.macaroonexample was missingonchain:read. It now matchesinvoicePermissionsinrpcserver.go.Constraints. The section stated that "there are currently two constraints implemented" and covered
TimeoutConstraintandIPLockConstraintonly.IPRangeLockConstraintandCustomConstrainthave been around for several releases. The section now says what a constraint is (a first party caveat, which anyone holding the macaroon can append offline and which can only narrow what the macaroon allows), lists every one of them with the caveat condition it encodes, and points atconfig_builder.go, where the checkers for thelndspecific conditions are registered.How constraints are applied. Adds examples for both
bakemacaroonandconstrainmacaroon, notes that--macaroontimeoutis applied to everylnclicall with a 60 second default as a basic anti-replay measure, and records thatIPRangeLockConstraintis currently reachable only from Go code, since neither command registers a flag for it ([bug]:lncli --ip_rangeis unreachable and its implementation calls the wrong constraint #11127).Protector constraint. Documents
ProtectorConstraintfrom macaroons+rpcperms: add protector caveats to restrict RPC request fields #11117 alongside the other four constraints, including that only the profile name travels in the macaroon while the rules are compiled intolnd, and points atdocs/macaroons.mdfor the available profiles.Obsolete section. Drops "Upgrading from v0.8.0-beta or earlier", which is about upgrades to a release that is now many years old.
Fixes
gPRCin passing.Steps to Test
Documentation only, so there is nothing to run. The claims can be checked against the code:
grep -rn "MacPath\|MacFilename" --include=*.go lnrpc/ | grep -v _testfor the sub server macaroon files and their path flags.grep -n -A 25 "invoicePermissions = " rpcserver.gofor the permission example.ls macaroons/constraints.goandgrep -n "func.*Constraint" macaroons/*.gofor the four constraints.grep -n "Checker" config_builder.gofor where the checkers are registered.The
ProtectorConstraintbullet can only be checked against the #11117 branch, where the constraint lives inmacaroons/protector.goand its checker is registered inconfig_builder.gonext to the other three.