macaroons: refresh the package README #11203
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.50) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 381 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #11203"
general
weight: 0.35
Lrifton92
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 (#11127).Protector constraint. Documents
ProtectorConstraintfrom #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/.go for 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.