Skip to content

Commit

Permalink
Add list secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
exvuma committed Jan 27, 2020
1 parent 6f7da91 commit 31b83af
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cloudflare/src/endpoints/workers/list_secrets.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use super::WorkersRoute;

use crate::framework::endpoint::{Endpoint, Method};

/// List Secrets
/// Lists all secrets mappings for a given script
/// https://api.cloudflare.com/#worker-secrets-list-secrets
pub struct ListSecrets<'a> {
pub account_identifier: &'a str,
pub script_name: &'a str,
}

impl<'a> Endpoint<Vec<WorkersRoute>> for ListSecrets<'a> {
fn method(&self) -> Method {
Method::Get
}
fn path(&self) -> String {
format!(
"accounts/{}/workers/scripts/{}/secrets",
self.account_identifier, self.script_name
)
}
}
2 changes: 2 additions & 0 deletions cloudflare/src/endpoints/workers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ mod create_secret;
mod delete_route;
mod delete_secret;
mod list_routes;
mod list_secrets;

pub use create_route::{CreateRoute, CreateRouteParams};
pub use create_secret::{CreateSecret, CreateSecretParams};
pub use delete_route::DeleteRoute;
pub use delete_secret::DeleteSecret;
pub use list_routes::ListRoutes;
pub use list_secrets::ListSecrets;

/// Workers KV Route
/// Routes are basic patterns used to enable or disable workers that match requests.
Expand Down

0 comments on commit 31b83af

Please sign in to comment.