Build a client authenticated with `token` (when `Some`). The CLI resolves the effective token at construction time, so callers downstream (the uploader, the executor's env injection, every GraphQL caller) just consume it from the client through [`Self::token`] and don't have to thread the token separately.
(token: Option<String>, api_url: String)
| 27 | /// every GraphQL caller) just consume it from the client through |
| 28 | /// [`Self::token`] and don't have to thread the token separately. |
| 29 | pub fn new(token: Option<String>, api_url: String) -> Self { |
| 30 | Self { |
| 31 | gql_client: build_gql_api_client(token.as_deref(), api_url.clone()), |
| 32 | unauthenticated_gql_client: build_gql_api_client(None, api_url.clone()), |
| 33 | api_url, |
| 34 | token, |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | /// Returns a client that uses `token` for authentication, regardless of |
| 39 | /// the token this client was built with. |
nothing calls this directly
no test coverage detected