pub enum SecretCommand {
Set {
entity: String,
field: String,
generate: bool,
recipe: RecipeArgs,
},
Copy {
entity: String,
field: String,
clear_after: u64,
},
Generate {
recipe: RecipeArgs,
},
Code {
entity: String,
field: Option<String>,
},
Show {
entity: String,
field: String,
},
History {
entity: String,
field: String,
},
Clear {
entity: String,
field: String,
},
Purge {
entity: String,
field: String,
yes: bool,
},
Ask {
from: String,
},
Give {
device: String,
},
FromCopy,
Save {
file: String,
path: Option<PathBuf>,
},
}Expand description
What nib secret can do, in the personal space. The entity is found by its ID, a prefix
of its ID, or its name.
Variants§
Set
Sets a secret field of an entity, asking for the value.
It replaces the values the field has: asks for the value twice, without showing it, or with –generate, makes a new password. The library’s first secret sets up its secrets, with a passphrase of their own. The secret of one-time codes, std.one-time-code, is taken as a site shows it: as base32 text, or as the otpauth:// link of its QR code.
Fields
recipe: RecipeArgsWhat a generated password is made of.
Copy
Copies a secret value to the clipboard, and clears it after a while.
The value of a secret field of an entity is marked so that clipboard histories leave it out, and clears it after a while, unless something else was copied since. nib waits until then; Ctrl+C clears it at once. Of values that compete, it copies the first.
Fields
Generate
Prints a new random password, which nothing keeps.
For nib secret set, there is –generate.
Fields
recipe: RecipeArgsWhat the password is made of.
Code
Shows the one-time code of an entity now.
It says how many seconds the code lasts, made from the secret in a field: std.one-time-code, unless another is given.
Fields
Show
Shows the values of a secret field of an entity.
History
Shows every value a secret field of an entity has had.
It shows them as nib history does.
Clear
Clears a secret field of an entity, keeping its history.
It shows no value from now on, and its history keeps those it had.
Purge
Purges one value of a secret field for good, everywhere.
The value of the entity’s field, current or past, is asked for without showing it. Without –yes, it says what it would purge, and purges nothing.
Fields
Ask
Asks another of your devices for the library’s secrets.
The device that holds them is named by its name, or one copy of the library on it, by its ID, as nib device list shows them: sets up the secrets here, with a passphrase of their own, asked for twice, and never the library’s. That device gives them, with nib secret give; they arrive with the next sync, and this device takes them when its secrets are next unlocked. It takes them from that device alone. A device that asked already asks another this way, without a passphrase. nib protect –secrets moves them to the keystore. With –space naming a shared space, asks another member’s device there for that space’s secrets, by its name, or its ID as nib space show –json shows it; this device’s secrets must be set up, and your other devices take the space’s from it by themselves.
Give
Gives the library’s secrets to a device of yours that asked.
The device is named by its name, or one copy of the library on it, by its ID, as nib device list shows them. Asks for the passphrase of the secrets here; they reach it with the next sync. An AI agent never gets them. With –space naming a shared space, gives that space’s secrets to another member’s device there that asked this one, by its name or ID; your own devices get them by themselves.
FromCopy
Takes the secrets from a copy of the library beside this one.
The copy is beside this device’s, which a backup, a program that syncs folders or a person brought from another device: only the keys that the copy’s device was given. Asks for the passphrase of the copy’s secrets, unless this computer’s keystore holds their key, and for a passphrase of the secrets here, twice. Take them before revoking the copy’s device, if it alone held them.
Save
Saves a plain copy of a secret file, which nothing records.
NibKeep neither protects it, nor keeps track of it, nor deletes it if the file is purged. Into a folder, under the file’s name, or as a new file; without either, into the current folder. It replaces nothing.
Trait Implementations§
Source§impl Debug for SecretCommand
impl Debug for SecretCommand
Source§impl FromArgMatches for SecretCommand
impl FromArgMatches for SecretCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for SecretCommand
impl Subcommand for SecretCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Forget for SecretCommand
impl Freeze for SecretCommand
impl Move for SecretCommand
impl RefUnwindSafe for SecretCommand
impl Send for SecretCommand
impl Sync for SecretCommand
impl Unpin for SecretCommand
impl UnsafeUnpin for SecretCommand
impl UnwindSafe for SecretCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.