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. |
Machine IDs are stable host identifiers that should be treated as confidential and not exposed in logs. Keep the value in the private workshopctl-to-workshopd request path for future host-side validation, but do not retain it in daemon debug output.
|
@jonathan-conder good spot. I looked into the available options. For Workshop LXD containers, In this request path,
A client-side fixed HMAC key also does not add an authentication boundary: I am inclined to retain the raw value for this private host/container |
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