mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
For #27035 # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#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] If database migrations are included, checked table schema to confirm autoupdate - For database migrations: - [x] Checked schema for all modified table for columns that will auto-update timestamps during migration. - [x] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects. - [x] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`). - [ ] Added/updated automated tests - [x] A detailed QA plan exists on the associated ticket (if it isn't there, work with the product group's QA engineer to add it) - [x] Manual QA for all new/changed functionality ## Details This PR adds an `author_id` column to the `labels` table, and adds the associated properties to the `Label` and `LabelSpec` types. When a new label is created via the UI or API, an author ID is set on the label if one can be inferred from the context. Otherwise, the author ID is set to `null`. ## Authz and Automated testing Additional backend authorization logic is introduced in a follow-on PR, https://github.com/fleetdm/fleet/pull/27089, because rconciling all of the test updates between this PR and https://github.com/fleetdm/fleet/pull/27038 was getting complicated. ## Manual Testing * Tested in the UI by creating a new label on the Hosts page * Tested via Gitops by merging this branch with https://github.com/fleetdm/fleet/pull/27038 and doing `fleetctl gitops` with a global config with `labels:` in it. |
||
|---|---|---|
| .. | ||
| testdata | ||
| api.go | ||
| api_test.go | ||
| apply.go | ||
| apply_test.go | ||
| config.go | ||
| config_test.go | ||
| convert.go | ||
| convert_test.go | ||
| debug.go | ||
| debug_test.go | ||
| delete.go | ||
| delete_test.go | ||
| flags.go | ||
| fleetctl.go | ||
| generate.go | ||
| generate_test.go | ||
| get.go | ||
| get_test.go | ||
| gitops.go | ||
| gitops_enterprise_integration_test.go | ||
| gitops_integration_test.go | ||
| gitops_test.go | ||
| goquery.go | ||
| hosts.go | ||
| hosts_test.go | ||
| kill_process.go | ||
| kill_process_windows.go | ||
| login.go | ||
| logout.go | ||
| logout_test.go | ||
| mdm.go | ||
| mdm_test.go | ||
| package.go | ||
| package_test.go | ||
| preview.go | ||
| preview_test.go | ||
| query.go | ||
| query_output.go | ||
| query_test.go | ||
| scripts.go | ||
| scripts_test.go | ||
| session_test.go | ||
| setup.go | ||
| testing_utils.go | ||
| trigger.go | ||
| trigger_test.go | ||
| upgrade_packs.go | ||
| upgrade_packs_test.go | ||
| user.go | ||
| users_test.go | ||
| vulnerability_data_stream.go | ||
| vulnerability_data_stream_test.go | ||