Skip to content

Commit

Permalink
Make LIST requests use ?list=true for kv1/kv2
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Nov 20, 2024
1 parent 4c48122 commit bebeb3f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/api/kv1/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ pub struct SetSecretRequest {
#[derive(Builder, Debug, Endpoint)]
#[endpoint(
path = "{self.mount}/{self.path}",
method = "LIST",
builder = "true",
response = "ListSecretResponse"
)]
Expand All @@ -68,6 +67,8 @@ pub struct ListSecretRequest {
pub mount: String,
#[endpoint(skip)]
pub path: String,
#[endpoint(query)]
pub list: bool,
}

/// ## Delete secret
Expand Down
3 changes: 2 additions & 1 deletion src/api/kv2/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ pub struct DestroySecretVersionsRequest {
#[endpoint(
path = "{self.mount}/metadata/{self.path}",
response = "ListSecretsResponse",
method = "LIST",
builder = "true"
)]
#[builder(setter(into))]
Expand All @@ -210,6 +209,8 @@ pub struct ListSecretsRequest {
pub mount: String,
#[endpoint(skip)]
pub path: String,
#[endpoint(query)]
pub list: bool,
}

/// ## Read Secret Metadata
Expand Down
1 change: 1 addition & 0 deletions src/kv1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pub async fn list(
let endpoint = ListSecretRequest::builder()
.mount(mount)
.path(path)
.list(true)
.build()
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions src/kv2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub async fn list(
let endpoint = ListSecretsRequest::builder()
.mount(mount)
.path(path)
.list(true)
.build()
.unwrap();
Ok(api::exec_with_result(client, endpoint).await?.keys)
Expand Down

0 comments on commit bebeb3f

Please sign in to comment.