pvsecret: Improve documentation for duplicated secret IDs

Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Tested-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2025-04-23 11:24:29 +02:00
committed by Jan Höppner
parent 1fefdecbe7
commit 6d7cdb9e10
4 changed files with 19 additions and 8 deletions

View File

@@ -526,8 +526,11 @@ Retrieve a secret from the UV secret store (s390x only)
<ul>
Specify the secret ID to be retrieved. Input type depends on '--inform'. If
`yaml` (default) is specified, it must be a yaml created by the create
subcommand of this tool. If `hex` is specified, it must be a hex 32-byte
unsigned big endian number string. Leading zeros are required.
subcommand of this tool. If `hex` is specified, it must be a 32 byte handle
encodes in hexadecimal. Leading zeros are required. If there are multiple
secrets in the store with the same Id there are no guarantees on which specific
secret is retrieved. Use --inform=idx to make sure a specific secret is
retrieved.
</ul>
@@ -548,6 +551,7 @@ Define input type for the Secret ID.
- **yaml**: Use a yaml file.
- **hex**: Use a hex string.
- **name**: Use a name-string. Will hash it if no secret with the name found.
- **idx**: Use the secret-index (base 10) instead of the secret-ID.
</ul>

View File

@@ -3,7 +3,7 @@
.\" it under the terms of the MIT license. See LICENSE for details.
.\"
.TH "PVSECRET-RETRIEVE" "1" "2025-03-07" "s390-tools" "UV-Secret Manual"
.TH "PVSECRET-RETRIEVE" "1" "2025-04-17" "s390-tools" "UV-Secret Manual"
.nh
.ad l
.SH NAME
@@ -28,8 +28,11 @@ keys the PEM name \fBIBM PROTECTED KEY\fP is used.
.RS 4
Specify the secret ID to be retrieved. Input type depends on \fB\-\-inform\fR.
If `yaml` (default) is specified, it must be a yaml created by the create
subcommand of this tool. If `hex` is specified, it must be a hex 32\-byte
unsigned big endian number string. Leading zeros are required.
subcommand of this tool. If `hex` is specified, it must be a 32 byte handle
encodes in hexadecimal. Leading zeros are required. If there are multiple
secrets in the store with the same Id there are no guarantees on which specific
secret is retrieved. Use \-\-inform=idx to make sure a specific secret is
retrieved.
.RE
.RE
@@ -54,6 +57,8 @@ Possible values:
\- \fBname\fP: Use a name-string. Will hash it if no secret with the name found.
\- \fBidx\fP: Use the secret-index (base 10) instead of the secret-ID.
.RE
.RE
.PP

View File

@@ -320,8 +320,10 @@ pub struct RetrSecretOptions {
/// Specify the secret ID to be retrieved.
///
/// Input type depends on '--inform'. If `yaml` (default) is specified, it must be a yaml
/// created by the create subcommand of this tool. If `hex` is specified, it must be a hex
/// 32-byte unsigned big endian number string. Leading zeros are required.
/// created by the create subcommand of this tool. If `hex` is specified, it must be a 32 byte
/// handle encodes in hexadecimal. Leading zeros are required. If there are multiple secrets in
/// the store with the same Id there are no guarantees on which specific secret is retrieved.
/// Use --inform=idx to make sure a specific secret is retrieved.
#[cfg(target_arch = "s390x")]
#[arg(value_name = "ID", value_hint = ValueHint::FilePath)]
pub input: String,

View File

@@ -19,7 +19,7 @@ pub fn add(opt: &AddSecretOpt) -> Result<()> {
AddCmd::new(&mut rd_in).context(format!("Processing input file {}", opt.input))?;
if let Some(id) = AddSecretRequest::bin_id(cmd.data().unwrap())? {
if !list_uvc(&uv)?.iter().any(|e| e.id() == id.as_ref()) {
if list_uvc(&uv)?.iter().any(|e| e.id() == id.as_ref()) {
warn!("There is already a secret in the secret store with that id. Adding the secret anyways.");
}
}