TomSecretsClient class final

A client of the Tom Secrets Manager's secrets service.

One connection, opened by the first call (or open); after not_running or a dropped connection the next call connects again. Calls may overlap. A Dart isolate has its own client; there is no fork to guard against. The library logs nothing: no value, token or payload.

Constructors

TomSecretsClient({String? clientName, String? clientToken, Map<String, String>? environment, String? operatingSystem, Duration connectTimeout = const Duration(seconds: 10)})
A client that connects on its first call.

Properties

clientName → String
The name hello gives the program.
final
clientToken → String?
The client token sent in every hello, when the program has one.
final
connectTimeout → Duration
How long connecting and the welcome may take.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
welcome → TomSecretsWelcome?
The welcome of the current connection, or null when not connected.
no setter

Methods

close() → Future<void>
Closes the connection; a later call connects again.
get(String reference, {String? field, Map<String, String>? dimensions, bool wait = true, Duration? timeout, bool wantClientToken = false, TomSecretsProgressCallback? onProgress, bool waitOnRateLimit = false}) → Future<TomSecretValue>
Reads one secret.
getFile(String reference, {String? field, Map<String, String>? dimensions, bool wait = true, Duration? timeout, TomSecretsProgressCallback? onProgress}) → Future<TomSecretFile>
B Reads an attachment or a typed key as bytes, over binary frames. Fails as unsupported when the service does not offer the features binary and getFile.
getMany(List<TomSecretRequest> requests, {bool wait = true, Duration? timeout, TomSecretsProgressCallback? onProgress, bool waitOnRateLimit = false}) → Future<List<TomSecretResult>>
Reads several secrets under one approval prompt (1 to 256); the results come in request order, each a value or an error. Every reference is parsed locally first.
match(String url, {String? frameUrl, String? userName, bool pick = false, bool wait = true, Duration? timeout, TomSecretsProgressCallback? onProgress}) → Future<List<TomSecretsLoginCandidate>>
B The login entries of the web page url (a login form in a frame: frameUrl) that this client's grants cover, never a value (protocol.md 5.5 match): the exact host first, then the last used. Answered only for the browser host and the developer-tool helpers; any other client gets denied (reason not_allowed_op). Fails as unsupported when the service does not offer match.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() → Future<void>
Connects, unless a connection is open.
propose({required String url, required String userName, required String password, String? title}) → Future<bool>
B Proposes a login for the user to save in the manager app (protocol.md 5.5 propose): the service passes it to the attached app and keeps nothing. Only for the browser host and the helpers with a grant; with no app attached unavailable (reason no_app). Fails as unsupported when the service does not offer propose. Answers whether the vaults hold the credential already (a helper's, which is then not proposed, DP-52).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

shared → TomSecretsClient
The process's shared client, created on first use with the defaults.
no setter

Static Methods

connect({String? clientName, String? clientToken, Map<String, String>? environment, String? operatingSystem, Duration connectTimeout = const Duration(seconds: 10)}) → Future<TomSecretsClient>
Creates a client and connects it, so a missing service shows at once (not_running).