-
Notifications
You must be signed in to change notification settings - Fork 271
Bed 6420 etac #2021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
stephanieslamb
wants to merge
15
commits into
main
Choose a base branch
from
BED-6420-etac
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+389
−34
Draft
Bed 6420 etac #2021
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2bc3f12
started new branch. handlers updated, unit tests working, still work…
stephanieslamb 6fa906e
BED-6420 reworked ETAC logic, started working on unit tests
mvlipka ea86c8e
working on additional unit tests
stephanieslamb 48ea175
added comparing node counts to members/counts endpoint HS tests. wor…
stephanieslamb 2b28d78
applying additional filters in graph query. stubbing out HS tests
stephanieslamb aa8ba9c
Merge branch 'main' into BED-6420-etac
stephanieslamb 0b8e038
pfc
stephanieslamb 41ef145
fixing unit test
stephanieslamb 10790b9
fixed broken unit tests
stephanieslamb f9c7018
updated graph query
stephanieslamb b779d6a
missed log
stephanieslamb 8aa1456
updates from peer review. moving some logic out of for loop
stephanieslamb 01ab874
clean up
stephanieslamb 4e088d5
rabbit suggestion
stephanieslamb 79c3220
moved building filters into check for consistency
stephanieslamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent ETAC handling when user has no environment access.
When ETAC is enabled,
user.AllEnvironmentsis false, andaccessListis empty, this endpoint doesn't append any ETAC filter. This differs fromGetAssetGroupTags(lines 158-165), which explicitly sets counts to 0 and skips querying whenaccessListis empty.The current implementation allows users with no ETAC access to see counts for any environments they specify via the
environmentsquery parameter, potentially bypassing ETAC restrictions. WhenaccessListis empty, no ETAC filter is added, so only theenvironmentIdsfilter (lines 626-631) applies, allowing users to query arbitrary environments.Consider applying the same defensive pattern as
GetAssetGroupTags:if etacFlag.Enabled && !user.AllEnvironments { accessList := ExtractEnvironmentIDsFromUser(&user) + if len(accessList) == 0 { + // User has no environment access, return zero counts + data := GetAssetGroupTagMemberCountsResponse{ + Counts: map[string]int{}, + } + api.WriteBasicResponse(request.Context(), data, http.StatusOK, response) + return + } + - if len(accessList) > 0 { - filters = append(filters, - query.Or( - query.In(query.NodeProperty(ad.DomainSID.String()), accessList), - query.In(query.NodeProperty(azure.TenantID.String()), accessList), - ), - ) - } + filters = append(filters, + query.Or( + query.In(query.NodeProperty(ad.DomainSID.String()), accessList), + query.In(query.NodeProperty(azure.TenantID.String()), accessList), + ), + ) }📝 Committable suggestion
🤖 Prompt for AI Agents