macaroons: ip range constraint#9546
Conversation
|
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
0b78ea0 to
b6ecf4d
Compare
b6ecf4d to
ae12030
Compare
guggero
left a comment
There was a problem hiding this comment.
Very nice feature! LGTM 🎉
263d9db to
f36dc2d
Compare
|
Thanks for the review @guggero, I've addressed all your comments. |
f36dc2d to
dca2eb2
Compare
yyforyongyu
left a comment
There was a problem hiding this comment.
Looking good, just need to fix the linter.
| // check. | ||
| pr, ok := peer.FromContext(ctx) | ||
| if !ok { | ||
| return fmt.Errorf("unable to get peer info from " + |
There was a problem hiding this comment.
nit: use errors.New to avoid some bot-created PRs in the future to change it again 😂
|
|
||
| if !ipNet.Contains(net.ParseIP(peerAddr)) { | ||
| msg := "macaroon locked to different IP range" | ||
| return fmt.Errorf(msg) |
There was a problem hiding this comment.
nit: same here re errors.New
dca2eb2 to
bef0268
Compare
yyforyongyu
left a comment
There was a problem hiding this comment.
LGTM👍 Confirmed the CI failure is a flake fixed in #9600
Upon user request this PR aims to add an
ip_rangeflag tolncli constrainmacaroonsubcommand.The user intention is to constrain access to a resource to a certain IP range. Currently, only specific IPs can be tied to access resources via a macaroon.