pub struct HelloPayload {
pub token: Option<String>,
pub api_key: Option<String>,
pub client_name: Option<String>,
pub version: i64,
}Expand description
HELLO request payload.
At least one of token / api_key should be populated when the server has
auth enabled: those credentials travel in the connection handshake, so
passing them to RpcClient::hello is what authenticates the session.
When the server runs in single-user mode (auth.enabled: false) the
listener is open, credentials are accepted-but-ignored, and the connection
runs as the implicit local admin.
Fields§
§token: Option<String>Bearer JWT (same shape REST /auth/login returns).
api_key: Option<String>API key.
client_name: Option<String>User-Agent-style identifier surfaced in server-side tracing.
version: i64Wire spec protocol version; defaults to 1.
Implementations§
Source§impl HelloPayload
impl HelloPayload
Sourcepub fn new(client_name: impl Into<String>) -> Self
pub fn new(client_name: impl Into<String>) -> Self
Build a minimal HELLO payload identifying the client by name.
No credentials — works against a server running in single-user
mode (auth.enabled: false).
Sourcepub fn with_token(self, token: impl Into<String>) -> Self
pub fn with_token(self, token: impl Into<String>) -> Self
Attach a JWT bearer token. Replaces any previously set token/api_key.
Sourcepub fn with_api_key(self, api_key: impl Into<String>) -> Self
pub fn with_api_key(self, api_key: impl Into<String>) -> Self
Attach an API key. Replaces any previously set token/api_key.