Skip to main content

Module http_credential

Module http_credential 

Source
Expand description

The client-side credential for the daemon’s transient HTTP listener (#5439, relocated in #6637).

Why its own module: it used to sit in tui_client::discovery, which #6637 deleted along with the rest of the HTTP client. session::connector’s TcodeConnector still speaks HTTP until PR 2 moves the webview bridge into trusty-code-gui, so the credential half outlives the discovery half. What: TCODE_DAEMON_TOKEN and the loopback-gated resolver. Test: http_credential::http_credential_tests. The client-side credential for the daemon’s HTTP listener (#5439, #6637).

Why this is its own module now: it used to live in crate::tui_client::discovery, alongside the TCODE_DAEMON_URL lookup the TUI used to find a daemon. #6637 moved the TUI onto the daemon’s Unix socket, where the peer-uid check replaces the token outright, and deleted that module. crate::session::connector::TcodeConnector still speaks HTTP, so the credential half outlives the discovery half and moves here rather than being deleted with it.

This retires with the TCP listener in PR 2 — trusty-code-gui serves its own webview then, and no client in this crate dials HTTP.

What: DAEMON_TOKEN_ENV and daemon_credential_for, unchanged.

Test: http_credential_tests.

Constants§

DAEMON_TOKEN_ENV
Environment variable naming the daemon credential directly, ahead of the token file (#5439).

Functions§

daemon_credential_for
The credential to send to base_url, or None when there is none to send or none that may be sent.