TomSecretsRuntime class final
The runtime directory of this OS user.
Constructors
- TomSecretsRuntime(String directory, {required TomSecretsTransport transport, String? separator})
-
The runtime directory at
directory, its endpoints offered overtransport; its files joined withseparator(default this platform's). -
TomSecretsRuntime.current({Map<
String, String> ? environment, String? operatingSystem}) -
The runtime directory protocol.md 3.1 names for this process (or
environmentandoperatingSystem); Unix sockets except on Windows.factory
Properties
- adminPortFile → String
-
admin.port.no setter - adminSocket → String
-
admin.sock.no setter - agentEndpoint → String
-
Where
sshfinds the agent on this runtime's OS: agentPipe on Windows, else agentSocket.no setter - agentSocket → String
-
agent.sock, the ssh-agent's Unix domain socket (Linux, macOS; phase B): whatSSH_AUTH_SOCKorIdentityAgentnames.no setter - clientPortFile → String
-
client.port.no setter - clientSocket → String
-
client.sock.no setter - clientTokenFile → String
-
client.token.no setter - directory → String
-
The directory.
final
-
endpointFiles
→ List<
String> -
The endpoint files of transport, every one a start writes.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- infoFile → String
-
service.json.no setter - lockFile → String
-
service.lock.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separator → String
-
The path separator its files are joined with.
final
- transport → TomSecretsTransport
-
How the endpoints are offered.
final
Methods
-
acquire(
) → Future< void> -
Takes the exclusive single-instance lock on
service.lock; the OS releases it when the process dies. Throws TomSecretsAlreadyRunning when another service (another process, or this one) holds it. -
check(
) → Future< void> - Checks owner and mode (see prepare).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prepare(
) → Future< void> - Makes the directory the user's alone when missing, then checks it: owned by this user with no access for anyone else (POSIX: mode 0700; Windows: the inheritance cut and only the user and SYSTEM granted). A directory of someone else, or one others can read, is refused.
-
readInfo(
) → Future< Map< String, Object?> ?> -
service.json, or null. -
release(
) → Future< void> - Releases the lock.
-
removeEndpoints(
) → Future< void> -
Deletes the endpoint files and
service.json(a stop). -
removeStaleEndpoints(
) → Future< void> - Deletes the endpoint files a dead instance left (only after acquire).
-
toString(
) → String -
A string representation of this object.
inherited
-
writeInfo(
{required int start, required Map< String, Object?> client, required Map<String, Object?> admin, Map<String, Object?> ? agent}) → Future<void> -
Writes
service.json: PID, start, protocol, the endpoints (the ssh-agent'sagent{socket}or{pipe}when it runs); no secret. -
writePort(
String path, int port) → Future< void> - Writes a port file.
-
writeToken(
String token) → Future< void> - Writes the client token.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited