fleet/server/platform/endpointer
Scott Gress 647612345c
Deprecate URLs with "team" and "query" terminology (#40520)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #40519

# Details

This PR adds a new system for registering deprecated URLs separately
from the main URLs (i.e. not clogging up `handler.go` with a bunch of
`.WithAltPaths()` or similar. It uses a registry that's shared between
all the different endpointer, which is then iterated over and a new
handler is created for the deprecated endpoint which stores info about
the deprecation (the old and new URLs) in the context. A new middleware
looks for that context info and, if found, logs a deprecation warning
(if the topic is enabled).

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [ ] 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/guides/committing-changes.md#changes-files)
for more information.
no need for a changelog as we are not logging the warnings by default

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually

* Verified that going to `/teams` with
`--logging_enable_topics=deprecated-field-names` got me this log:
```
deprecated_path=/api/_version_/fleet/teams deprecation_warning="API `/api/_version_/fleet/teams` is deprecated, use `/api/_version_/fleet/fleets` instead
```
* Going to `/fleets` with that flag enabled resulted in no deprecation
log
* Going to `/teams` _without_ the flag enabled resulted in no
deprecation log
2026-02-25 22:20:35 -06:00
..
clientip.go Implement trusted proxies config (#38471) 2026-01-19 22:13:37 -06:00
clientip_test.go Implement trusted proxies config (#38471) 2026-01-19 22:13:37 -06:00
endpoint_utils.go Deprecate URLs with "team" and "query" terminology (#40520) 2026-02-25 22:20:35 -06:00
endpoint_utils_test.go Deprecate URLs with "team" and "query" terminology (#40520) 2026-02-25 22:20:35 -06:00
extract_alias_rules_test.go Deprecate "team" and "query" API params (#39873) 2026-02-19 13:53:32 -06:00
json_key_duplicator.go Deprecate "team" and "query" API params (#39873) 2026-02-19 13:53:32 -06:00
json_key_duplicator_test.go Deprecate "team" and "query" API params (#39873) 2026-02-19 13:53:32 -06:00
json_key_rewriter.go Add more deprecation logs and mute by default (#40305) 2026-02-23 23:09:08 -06:00
json_key_rewriter_test.go Deprecate "team" and "query" API params (#39873) 2026-02-19 13:53:32 -06:00
transport_error.go Fixed client-side errors being incorrectly reported as server errors in OTEL telemetry (#40051) 2026-02-19 16:06:00 -06:00
transport_error_test.go Fixed client-side errors being incorrectly reported as server errors in OTEL telemetry (#40051) 2026-02-19 16:06:00 -06:00