17744 policies backend#18564
Merged
mostlikelee merged 7 commits into15605-merge-inherited-queries-and-policiesfrom Apr 30, 2024
Merged
17744 policies backend#18564mostlikelee merged 7 commits into15605-merge-inherited-queries-and-policiesfrom
mostlikelee merged 7 commits into15605-merge-inherited-queries-and-policiesfrom
Conversation
mostlikelee
commented
Apr 26, 2024
| s.lastActivityMatches(fleet.ActivityTypeEditedMacOSMinVersion{}.ActivityName(), `{"deadline":"2022-01-01", "minimum_version":"12.3.1", "team_id": null, "team_name": null}`, 0) | ||
| s.assertMacOSUpdatesDeclaration(nil, &fleet.MacOSUpdates{ | ||
| MinimumVersion: optjson.SetString("12.3.1"), Deadline: optjson.SetString("2022-01-01")}) | ||
| MinimumVersion: optjson.SetString("12.3.1"), Deadline: optjson.SetString("2022-01-01"), |
Contributor
Author
There was a problem hiding this comment.
unrelated gofmt
4 tasks
This reverts commit 7fd6d1e.
7b734e8 to
8d4ee1b
Compare
getvictor
approved these changes
Apr 29, 2024
Member
getvictor
left a comment
There was a problem hiding this comment.
What about the new query param:
fleet/docs/REST API/rest-api.md
Line 5942 in 76c051e
Is that needed? If so, it can be a separate PR.
Contributor
Author
Matchquery should be implemented in fleet/server/datastore/mysql/policies.go Line 587 in 46e723c |
mostlikelee
added a commit
that referenced
this pull request
May 1, 2024
#17744 This adds the `merged_inherited` query param to `/teams/:id/policies/count` related to #18564 - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [X] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [X] Added/updated tests - [X] Manual QA for all new/changed functionality --------- Co-authored-by: RachelElysia <rachel@fleetdm.com>
RachelElysia
added a commit
that referenced
this pull request
May 6, 2024
#17744 This change implements a new query parameter on `/teams/%d/policies` to merge inherited policies into the policies array instead of listing them separately. The frontend will key off the existing `team_id` field to mark policies as "inherited" in theUI. I opted for an additive approach in adding a datastore method rather than modifying the existing ListTeamPolicies to avoid a large test refactor. - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [X] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [X] Added/updated tests - [X] Manual QA for all new/changed functionality --------- Co-authored-by: RachelElysia <rachel@fleetdm.com>
RachelElysia
added a commit
that referenced
this pull request
May 6, 2024
#17744 This adds the `merged_inherited` query param to `/teams/:id/policies/count` related to #18564 - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [X] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [X] Added/updated tests - [X] Manual QA for all new/changed functionality --------- Co-authored-by: RachelElysia <rachel@fleetdm.com>
RachelElysia
added a commit
that referenced
this pull request
May 7, 2024
#17744 This change implements a new query parameter on `/teams/%d/policies` to merge inherited policies into the policies array instead of listing them separately. The frontend will key off the existing `team_id` field to mark policies as "inherited" in theUI. I opted for an additive approach in adding a datastore method rather than modifying the existing ListTeamPolicies to avoid a large test refactor. - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [X] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [X] Added/updated tests - [X] Manual QA for all new/changed functionality --------- Co-authored-by: RachelElysia <rachel@fleetdm.com>
RachelElysia
added a commit
that referenced
this pull request
May 7, 2024
#17744 This adds the `merged_inherited` query param to `/teams/:id/policies/count` related to #18564 - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [X] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [X] Added/updated tests - [X] Manual QA for all new/changed functionality --------- Co-authored-by: RachelElysia <rachel@fleetdm.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.
#17744
This change implements a new query parameter on
/teams/%d/policiesto merge inherited policies into the policies array instead of listing them separately. The frontend will key off the existingteam_idfield to mark policies as "inherited" in theUI.I opted for an additive approach in adding a datastore method rather than modifying the existing ListTeamPolicies to avoid a large test refactor.
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements)