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 13, 2024
1 parent 34291b4 commit b5f27da
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/api/kv1/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@ pub struct SetSecretRequest {
#[derive(Builder, Debug, Endpoint)]
#[endpoint(
path = "{self.mount}/{self.path}",
method = "LIST",
builder = "true",
response = "ListSecretResponse"
response = "ListSecretResponse",
)]
#[builder(setter(into))]
pub struct ListSecretRequest {
#[endpoint(skip)]
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 b5f27da

Please sign in to comment.