Add nested AL tests + change IsAccessListMember behaviour#60271
Merged
Add nested AL tests + change IsAccessListMember behaviour#60271
Conversation
smallinsky
approved these changes
Oct 16, 2025
smallinsky
approved these changes
Oct 16, 2025
kopiczko
approved these changes
Oct 16, 2025
|
|
||
| ownershipType, err := IsAccessListOwner(ctx, stubUserNoRequires, acl4, accessListAndMembersGetter, nil, clock) | ||
| require.Error(t, err) | ||
| require.ErrorIs(t, err, trace.AccessDenied("User '%s' does not meet the membership requirements for Access List '%s'", member1, acl1.Spec.Title)) |
Contributor
There was a problem hiding this comment.
Why not verify those error messages?
Contributor
Author
There was a problem hiding this comment.
Because they will change with the visitor PR (it doesn't traverse the graph the same way and cannot produce the same errors). I want the tests to pass for both implementations, without changes
|
|
||
| typ, err := IsAccessListMember(ctx, user, firstList, aclGetter, locks, clock) | ||
| require.NoError(t, err) | ||
| require.Equal(t, accesslistv1.AccessListUserAssignmentType_ACCESS_LIST_USER_ASSIGNMENT_TYPE_INHERITED, typ) |
Contributor
There was a problem hiding this comment.
I think it wouldn't hurt to check IsAccessListMember for all lists in the cycle. Same for the test above.
Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com>
Contributor
Author
smallinsky
pushed a commit
that referenced
this pull request
Oct 23, 2025
* Add nested AL tests + change IsAccessListMember signature * address marek's feedback * fixup! address marek's feedback * Apply suggestions from code review Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com> * address pawel's feedback --------- Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com>
mmcallister
pushed a commit
that referenced
this pull request
Nov 6, 2025
* Add nested AL tests + change IsAccessListMember signature * address marek's feedback * fixup! address marek's feedback * Apply suggestions from code review Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com> * address pawel's feedback --------- Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com>
mmcallister
pushed a commit
that referenced
this pull request
Nov 19, 2025
* Add nested AL tests + change IsAccessListMember signature * address marek's feedback * fixup! address marek's feedback * Apply suggestions from code review Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com> * address pawel's feedback --------- Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com>
hugoShaka
added a commit
that referenced
this pull request
Nov 20, 2025
* Add nested AL tests + change IsAccessListMember signature * address marek's feedback * fixup! address marek's feedback * Apply suggestions from code review Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com> * address pawel's feedback --------- Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com>
mmcallister
pushed a commit
that referenced
this pull request
Nov 20, 2025
* Add nested AL tests + change IsAccessListMember signature * address marek's feedback * fixup! address marek's feedback * Apply suggestions from code review Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com> * address pawel's feedback --------- Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 21, 2025
…61623) * Add nested AL tests + change IsAccessListMember signature * address marek's feedback * fixup! address marek's feedback * Apply suggestions from code review * address pawel's feedback --------- Co-authored-by: Pawel Kopiczko <pawel.kopiczko@goteleport.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR upstreams some part of #60034 to reduce the size of the PR.
It contains:
IsAccessListMemberbehaviour change to always return an error if the user is not a member (reduced footgun risk)IsAccessListOwnerbehaviour change to always return an error if the user is not an owner (reduced footgun risk)The related e PR is :https://github.com/gravitational/teleport.e/pull/7423
This change slightly affects the semantics of returned errors. This doesn't affect the code in the OSS repo but one function in
ehad to be adapted. The semantic change will also be required for the visitor PR.