Skip to content

Add capabilities headers to aid with backwards compat between Fleet, Orbit and Fleet Desktop #7929

@roperzh

Description

@roperzh

Goal

This solution is trying to solve the following problems:

  • We have three independent processes communicating with each other (Fleet Desktop, Orbit and Fleet Server). Each process can be updated independently, and therefore we need a way for each process to know what features are supported by its peers.
  • We originally implemented a dedicated API endpoint in the server that returned a list of the capabilities (or "features") enabled, we found this, and any other server-only solution (like API versioning) to be insufficient because:
    • There are cases in which the server also needs to know which features are supported by its clients
    • Clients needed to poll for changes to detect if the capabilities supported by the server change, by sending the capabilities on each request we have a much cleaner way to handling different responses.
  • We are also introducing an unauthenticated endpoint to get the server features, this gives us flexibility if we need to implement different authentication mechanisms, and was one of the pitfalls of the first implementation.

How?

The general idea is to always send a custom header of the form:

fleet-capabilities-header = "X-Fleet-Capabilities:" capabilities
capabilities              = capability * (,)
capability                = string

Both from the server to the clients (Orbit, Fleet Desktop) and vice-versa. For an example, see: 8c0bbdd

Also, the following applies:

  • Backwards compat: if the header is not present, assume that orbit/fleet doesn't have the capability
  • The current capabilities endpoint will be removed

Metadata

Metadata

Assignees

Labels

#legacy-platform-groupLegacy: platform group~agentRelated to Fleet's osquery runtime and agent autoupdater (Orbit)~backendBackend-related issue.

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions