Returns the 'Bearer' credential as a header for calling the V1 agent API if the `authToken` is presented, or empty otherwise. TODO(chhsiao): Currently we assume the JWT authenticator is used for the agent operator API.
| 50 | // TODO(chhsiao): Currently we assume the JWT authenticator is used for |
| 51 | // the agent operator API. |
| 52 | static inline http::Headers getAuthHeader(const Option<string>& authToken) |
| 53 | { |
| 54 | http::Headers headers; |
| 55 | |
| 56 | if (authToken.isSome()) { |
| 57 | headers["Authorization"] = "Bearer " + authToken.get(); |
| 58 | } |
| 59 | |
| 60 | return headers; |
| 61 | } |
| 62 | |
| 63 | |
| 64 | ContainerDaemonProcess::ContainerDaemonProcess( |
no test coverage detected