Align Windows client auth defaults
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
This commit is contained in:
+8
-7
@@ -5,10 +5,11 @@ use anyhow::{Context, Result, bail};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
/// Generate a name for an implicit, ephemeral terminal session — the kind
|
||||
/// created by `dosh host` with no `--session`. Single source of truth shared by
|
||||
/// the client (which generates it) and the server (which recognizes it via
|
||||
/// [`is_implicit_session_name`] to decide a session is NOT worth persisting).
|
||||
/// Generate a name for an implicit terminal session: the kind created by
|
||||
/// `dosh host` with no `--session`. Single source of truth shared by the client
|
||||
/// (which generates it) and the server (which recognizes it via
|
||||
/// [`is_implicit_session_name`] to apply shorter cleanup grace than named
|
||||
/// sessions).
|
||||
pub fn generate_implicit_session_name() -> String {
|
||||
let millis = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
@@ -18,9 +19,9 @@ pub fn generate_implicit_session_name() -> String {
|
||||
}
|
||||
|
||||
/// Whether `name` is a client-generated implicit session name
|
||||
/// (`term-<digits>-<digits>`). Such sessions are ephemeral: the user can never
|
||||
/// reattach by name, so the server must not persist them across restarts.
|
||||
/// Explicitly-named (`--session work`) and prewarmed sessions are not implicit.
|
||||
/// (`term-<digits>-<digits>`). Such sessions are update-survivable while the
|
||||
/// original client can reconnect with its ticket, but they are reaped sooner
|
||||
/// than explicitly-named sessions once no clients remain.
|
||||
pub fn is_implicit_session_name(name: &str) -> bool {
|
||||
let Some(rest) = name.strip_prefix("term-") else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user