Send workshop machine ID with workshopctl requests - #962
Conversation
Read and trim the machine identifier injected into each workshop. Return a sentinel error when the file is missing or empty, and add unit coverage for valid, empty, and missing machine ID files.
Attach the workshop machine ID to outgoing HTTP requests. Warn when the ID is unavailable, and prevent requests when it cannot otherwise be read.
Apply an optional round tripper wrapper after constructing the client transport, and verify wrapped requests reach the server as expected.
Configure workshopctl to decorate its API transport with the workshop machine ID, and include received machine IDs in daemon debug request logs.
|
just FYI from
I don't think the socket necessarily counts as the "network," but it seems like a good idea regardless. |
Description
Forward the LXD-provided workshop machine ID from workshopctl to workshopd in the workshop-machine-id HTTP header.
This enables follow-up secrets work: workshopctl and workshopd need a shared workshop identity to communicate and validate the workshop from which a secret request originates. The daemon records the received ID in debug request logs to support diagnosis.
This PR intentionally only transports the identifier. It does not validate the ID or authorise secret access; those checks will be added in follow-up secrets PRs.
Self-review quick check
Docs