Conversation
67b1d70 to
9020ad5
Compare
9020ad5 to
0d3fa5d
Compare
There was a problem hiding this comment.
Could you rise a PR with the alignment of design change in terms of access list cycles functionality to the https://github.com/gravitational/teleport/blob/ff91dc086596669fb9e1f1e972b1b13def2f0c9c/rfd/0170-nested-accesslists.md#cycles ?
b0fc532 to
75b8217
Compare
lib/accesslists/visitor.go
Outdated
| return visitor{ | ||
| getter: getter, | ||
| seen: make(map[string]struct{}), | ||
| stack: []*accesslist.AccessList{accessList}, | ||
| ctx: ctx, | ||
| }.iterate |
There was a problem hiding this comment.
I'm still not a fan of this visitor struct because we pass the context as a field. I understand this is just a fancy way to pass parameters and avoid single indentation level. I guess you can reduce indentation by extracting visitMember/processMember.
There was a problem hiding this comment.
I was planning to reuse the visitor and add another function to collect owners, hence the dedicated struct. I can get rid of this if this is a blocker.
There was a problem hiding this comment.
If it's supposed to be expanded I'm OK with keeping but, but let's not store the context inside the struct, because it creates a potential for it to escape the function call stack.
7424980 to
b9d28bf
Compare
|
I updated the PR based on your feedback:
Things that I will do that are non-blocking for the review:
Note: this PR changes the |
smallinsky
left a comment
There was a problem hiding this comment.
Can we do https://github.com/gravitational/teleport/pull/60034/files#r2419292154
I don't see this as a blocker but for sure it will help the reviewer to understand the behavior change.
Tests and signature change are already in their own PR waiting your review:
Once those are merged I will rebase the current PR so the test changes will not show up in the diff. |
cabcf84 to
7eeba0c
Compare
7eeba0c to
cd9bc23
Compare
cd9bc23 to
bfe13f6
Compare
r0mant
left a comment
There was a problem hiding this comment.
First pass, nothing major from my side so far.
bfe13f6 to
9ca8132
Compare
kopiczko
left a comment
There was a problem hiding this comment.
I'm thinking the rage function is not a good fit here and the flow suffers because we introduce some patters that are not typical in Go stdlib. But I'm approving regardless because I don't want to get you stuck and visitor is private which means we can rework it without a big penalty.
Having said that, thank you for being patient with the explanations and addressing the comments.
kopiczko
left a comment
There was a problem hiding this comment.
Some more minor comments about the visitor internals
|
@kopiczko I sent 2 more commits addressing your remaining feedback:
Can you take another look? |
d2af26c to
62fafc0
Compare
kopiczko
left a comment
There was a problem hiding this comment.
Thanks for taking the time to rewrite it. To me it looks way easier to follow now.
I left a bunch of comments, but they mostly circle around the same thing.
62fafc0 to
658c389
Compare
658c389 to
1404659
Compare
* Make IsAccessListMember cycle-proof * Address final comments * Lint and error reporting
This PR:
walkfunction that can be used to traverse the accesslist graphwalkinIsAccessListMemberto make it cycle-proofhierarchy_test.go