CredentialStore class

On-disk store of Hub logins, keyed by Hub URL, with a remembered default.

Persisted to <home>/.omnyshell/credentials.json (file mode 600). The home directory resolves from OMNYSHELL_HOME, then HOME, then USERPROFILE.

Constructors

CredentialStore({String? defaultHub, Map<String, StoredSession>? sessions})

Properties

defaultHub ↔ String?
The Hub URL used when a command does not specify --hub.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hubs → List<String>
The saved Hub URLs, sorted, so listings and pickers are stable.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessions → Map<String, StoredSession>
Saved sessions keyed by Hub URL.
final

Methods

matchHubs(String hub) → List<String>
Every saved Hub URL that hub could refer to, sorted.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveHub(String hub) → String?
The single saved Hub URL hub refers to, or null when it matches none or is ambiguous — matchHubs tells the two apart.
save({String? home}) → Future<void>
Persists the store, creating ~/.omnyshell (mode 700) and writing the file with mode 600 on POSIX systems.
selectDefaultHub(String hub) → String?
Points defaultHub at the saved session hub refers to.
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

load({String? home}) → Future<CredentialStore>
Loads the store, returning an empty one when no file exists yet.
path({String? home}) → String
Resolves the credentials file path under home, defaulting to the home directory from OMNYSHELL_HOME, then HOME, then USERPROFILE.