diff --git a/CHANGELOG.md b/CHANGELOG.md index 3995292..e7cab16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,23 @@ and this project adheres to ## [Unreleased] +## [0.7.1] - 202-03-16 + +### Added + +- The `X-Vault-Request` Header to each request. +- Support for Client Certificate. +- Support custom metadata in KV2 secret engine. +- Support `expiration` field to `GenerateCertificateResponse`. +- Support for `AWS` secret engine. +- Partial support for `identity` secret engine (`entity`, `entity_alias`, `group` and `group_alias`). +### Fixed + +- Issue with the `native-tls` feature where it doesn't compile. +- Issue where a URL was encoded twice what leads to wrong paths. +- Wrong name for `derived` filed in `CreateKeyRequest`. +- RUSTSEC-2023-0052 by bumping aws modules to the latest version. + ## [0.7.0] - 2023-03-25 ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index faff81c..b3de4a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ configuring roles. This library leans heavily on [rustify](https://docs.rs/rustify/0.1.0/rustify/) in order to scaffold the Vault API endpoints. Hashicorp also has [extensive -documentation](https://www.vaultproject.io/api) available for all supported +documentation](https://developer.hashicorp.com/vault/api-docs) available for all supported endpoints. Vault uses the concepts of *secret engines* in order to categorize the functionality offered by the software. For exampele, there's a PKI engine, KV engine, SSH engine, various database engines, etc. This library takes @@ -45,7 +45,7 @@ crate root which provides the high level API functions for the engine. /// * Path: {self.mount}/root/generate/{self.cert_type} /// * Method: POST /// * Response: [Option"] description = "An asynchronous Rust client library for the Hashicorp Vault API." license = "MIT" diff --git a/README.md b/README.md index 309ac25..2417b89 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - + @@ -20,25 +20,26 @@ The following features are currently supported: - Auth - - [AppRole](https://www.vaultproject.io/docs/auth/approle) - - [AWS](https://www.vaultproject.io/docs/auth/aws) - - [JWT/OIDC](https://www.vaultproject.io/api-docs/auth/jwt) - - [Kubernetes](https://www.vaultproject.io/docs/auth/kubernetes) - - [Token](https://www.vaultproject.io/docs/auth/token) - - [Userpass](https://www.vaultproject.io/docs/auth/userpass) + - [AppRole](https://developer.hashicorp.com/vault/docs/auth/approle) + - [AWS](https://developer.hashicorp.com/vault/docs/auth/aws) + - [JWT/OIDC](https://developer.hashicorp.com/vault/api-docs/auth/jwt) + - [Kubernetes](https://developer.hashicorp.com/vault/docs/auth/kubernetes) + - [Token](https://developer.hashicorp.com/vault/docs/auth/token) + - [Certificate](https://developer.hashicorp.com/vault/docs/auth/cert) + - [Userpass](https://developer.hashicorp.com/vault/docs/auth/userpass) - Secrets - [AWS](https://developer.hashicorp.com/vault/docs/secrets/aws) - - [Databases](https://www.vaultproject.io/api-docs/secret/databases) - - [KV v1](https://www.vaultproject.io/docs/secrets/kv/kv-v1) - - [KV v2](https://www.vaultproject.io/docs/secrets/kv/kv-v2) - - [PKI](https://www.vaultproject.io/docs/secrets/pki) - - [SSH](https://www.vaultproject.io/docs/secrets/ssh) - - [Transit](https://www.vaultproject.io/api-docs/secret/transit) + - [Databases](https://developer.hashicorp.com/vault/api-docs/secret/databases) + - [KV v1](https://developer.hashicorp.com/vault/docs/secrets/kv/kv-v1) + - [KV v2](https://developer.hashicorp.com/vault/docs/secrets/kv/kv-v2) + - [PKI](https://developer.hashicorp.com/vault/docs/secrets/pki) + - [SSH](https://developer.hashicorp.com/vault/docs/secrets/ssh) + - [Transit](https://developer.hashicorp.com/vault/api-docs/secret/transit) - Sys - - [Health](https://www.vaultproject.io/api-docs/system/health) - - [Policies](https://www.vaultproject.io/api-docs/system/policy) - - [Sealing](https://www.vaultproject.io/api-docs/system/seal) - - [Wrapping](https://www.vaultproject.io/docs/concepts/response-wrapping) + - [Health](https://developer.hashicorp.com/vault/api-docs/system/health) + - [Policies](https://developer.hashicorp.com/vault/api-docs/system/policy) + - [Sealing](https://developer.hashicorp.com/vault/api-docs/system/seal) + - [Wrapping](https://developer.hashicorp.com/vault/docs/concepts/response-wrapping) See something missing? [Open an issue](https://github.com/jmgilman/vaultrs/issues/new). @@ -59,7 +60,7 @@ Then, add `vaultrs` as a dependency to your cargo.toml: ```toml [dependencies] -vaultrs = "0.7.0" +vaultrs = "0.7.1" ``` 2. To use [rust-native-tls](https://github.com/sfackler/rust-native-tls), which @@ -67,7 +68,7 @@ vaultrs = "0.7.0" ```toml [dependencies] -vaultrs = { version = "0.6.2", default-features = false, features = [ "native-tls" ] } +vaultrs = { version = "0.7.1", default-features = false, features = [ "native-tls" ] } ``` ## Usage @@ -98,30 +99,33 @@ let client = VaultClient::new( The library currently supports all operations available for the AWS Secret Engine. -See [tests/aws.rs](./tests/aws.rs) for more examples. +See [tests/aws.rs][4] for more examples. + +```rust,ignore +use vaultrs::sys::mount; +use vaultrs::aws; +use vaultrs::api::aws::requests::{SetConfigurationRequest, CreateUpdateRoleRequest, GenerateCredentialsRequest}; -```rust // Mount AWS SE -server.mount_secret(client, path, "aws").await?; -let endpoint = AwsSecretEngineEndpoint { path: path } +mount::enable(&client, "aws_test", "aws", None).await?; // Configure AWS SE -aws::config::set(client, &endpoint.path, "access_key", "secret_key", Some(SetConfigurationRequest::builder() +aws::config::set(&client, "aws_test", "access_key", "secret_key", Some(SetConfigurationRequest::builder() .max_retries(3) .region("eu-central-1") -)).await?, +)).await?; // Create HVault role -aws::roles::create_update(client, &endpoint.path, "my_role", "assumed_role", Some(CreateUpdateRoleRequest::builder() - .role_arns( vec!["arn:aws:iam::123456789012:role/test_role"] ) -)).await? +aws::roles::create_update(&client, "aws_test", "my_role", "assumed_role", Some(CreateUpdateRoleRequest::builder() + .role_arns( vec!["arn:aws:iam::123456789012:role/test_role".to_string()] ) +)).await?; // Generate credentials -let res = aws::roles::credentials(client, &endpoint.path, "my_role", Some(GenerateCredentialsRequest::builder() +let res = aws::roles::credentials(&client, "aws_test", "my_role", Some(GenerateCredentialsRequest::builder() .ttl("3h") )).await?; -let creds = res.unwrap(); +let creds = res; // creds.access_key // creds.secret_key // creds.security_token @@ -132,7 +136,7 @@ let creds = res.unwrap(); The library currently supports all operations available for version 2 of the key/value store. -```rust +```rust,ignore use serde::{Deserialize, Serialize}; use vaultrs::kv2; @@ -163,23 +167,26 @@ println!("{}", secret.password); // "secret" The library currently supports all operations available for version 1 of the key/value store. -```rust +```rust,ignore +use vaultrs::kv1; +use std::collections::HashMap; + let my_secrets = HashMap::from([ ("key1".to_string(), "value1".to_string()), ("key2".to_string(), "value2".to_string()) ]); -kv1::set(&client, mount, "my/secrets", &my_secrets).await.unwrap(); +kv1::set(&client, "secret", "my/secrets", &my_secrets).await.unwrap(); -let read_secrets: HashMap = kv1::get(&client, &mount, "my/secrets").await.unwrap(); +let read_secrets: HashMap = kv1::get(&client, "secret", "my/secrets").await.unwrap(); println!("{:}", read_secrets.get("key1").unwrap()); // value1 -let list_secret = kv1::list(&client, &mount, "my").await.unwrap(); +let list_secret = kv1::list(&client, "secret", "my").await.unwrap(); println!("{:?}", list_secret.data.keys); // [ "secrets" ] -kv1::delete(&client, &mount, "my/secrets").await.unwrap(); +kv1::delete(&client, "secret", "my/secrets").await.unwrap(); ``` ### PKI @@ -187,7 +194,7 @@ kv1::delete(&client, &mount, "my/secrets").await.unwrap(); The library currently supports all operations available for the PKI secrets engine. -```rust +```rust,ignore use vaultrs::api::pki::requests::GenerateCertificateRequest; use vaultrs::pki::cert; @@ -204,12 +211,13 @@ println!("{}", cert.certificate) // "{PEM encoded certificate}" ### Transit The library supports most operations for the -[Transit](https://www.vaultproject.io/api-docs/secret/transit) secrets engine, +[Transit](https://developer.hashicorp.com/vault/api-docs/secret/transit) secrets engine, other than importing keys or `batch_input` parameters. -```rust +```rust,ignore use vaultrs::api::transit::requests::CreateKeyRequest; use vaultrs::api::transit::KeyType; +use vaultrs::transit::key; // Create an encryption key using the /transit backend key::create( @@ -226,10 +234,10 @@ key::create( ### Wrapping All requests implement the ability to be -[wrapped](https://www.vaultproject.io/docs/concepts/response-wrapping). These +[wrapped](https://developer.hashicorp.com/vault/docs/concepts/response-wrapping). These can be passed in your application internally before being unwrapped. -```rust +```rust,ignore use vaultrs::api::ResponseWrapper; use vaultrs::api::sys::requests::ListMountsRequest; @@ -260,7 +268,7 @@ attribute. ## Testing -See the the [tests](tests) directory for tests. Run tests with `cargo test`. +See the the [tests][3] directory for tests. Run tests with `cargo test`. **Note**: All tests rely on bringing up a local Vault development server using Docker. In order to run tests Docker must be running locally (Docker Desktop @@ -277,8 +285,11 @@ then: 4. Push to the branch (git push origin feature/fooBar) 5. Create a new Pull Request -See [CONTRIBUTING](CONTRIBUTING.md) for extensive documentation on the +See [CONTRIBUTING][5] for extensive documentation on the architecture of this library and how to add additional functionality to it. -[1]: https://www.vaultproject.io/ +[1]: https://developer.hashicorp.com/vault/ [2]: https://github.com/jmgilman/vaultrs/issues +[3]: https://github.com/jmgilman/vaultrs/tree/master/tests +[4]: https://github.com/jmgilman/vaultrs/tree/master/tests/aws.rs +[5]: https://github.com/jmgilman/vaultrs/tree/master/CONTRIBUTING.md diff --git a/src/api.rs b/src/api.rs index f11af6b..83c2718 100644 --- a/src/api.rs +++ b/src/api.rs @@ -74,12 +74,11 @@ pub struct AuthInfo { /// Represents an API response that has been wrapped by a unique token. /// -/// See [response wrapping][1] for details on how this works. This struct stores +/// See [response wrapping][] for details on how this works. This struct stores /// the unique token returned by the server as well as the original endpoint /// request that generated this token. The struct contains methods for /// interacting with the wrapped response. /// -// [1]: https://www.vaultproject.io/docs/concepts/response-wrapping pub struct WrappedResponse { pub info: WrapInfo, pub endpoint: rustify::endpoint::EndpointResult, diff --git a/src/api/auth/approle/requests.rs b/src/api/auth/approle/requests.rs index 8c7f01d..5781ae9 100644 --- a/src/api/auth/approle/requests.rs +++ b/src/api/auth/approle/requests.rs @@ -10,7 +10,7 @@ use rustify_derive::Endpoint; /// * Path: /auth/approle/login /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#login-with-approle +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")] #[builder(setter(into))] @@ -26,8 +26,8 @@ pub struct LoginWithApproleRequest { /// /// * Path: /auth/{self.mount}/role /// * Method: LIST -/// * Response: [ListRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#list-roles +/// * Response: [ListRolesResponse] +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role", @@ -47,7 +47,7 @@ pub struct ListRolesRequest { /// * Path: /auth/{self.mount}/role/{self.role_name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#create-update-approle +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}", @@ -82,7 +82,7 @@ pub struct SetAppRoleRequest { /// * Path: /auth/{self.mount}/role/{self.role_name} /// * Method: GET /// * Response: [ReadAppRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#read-approle +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}", @@ -103,7 +103,7 @@ pub struct ReadAppRoleRequest { /// * Path: /auth/{self.mount}/role/{self.role_name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#delete-approle +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}", @@ -124,7 +124,7 @@ pub struct DeleteAppRoleRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/role-id /// * Method: GET /// * Response: [ReadRoleIDResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#read-approle-role-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/role-id", @@ -145,7 +145,7 @@ pub struct ReadRoleIDRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/role-id /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#update-approle-role-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/role-id", @@ -167,7 +167,7 @@ pub struct UpdateRoleIDRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/secret-id /// * Method: POST /// * Response: [GenerateNewSecretIDResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#generate-new-secret-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/secret-id", @@ -192,7 +192,7 @@ pub struct GenerateNewSecretIDRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/secret-id /// * Method: LIST /// * Response: [ListSecretIDResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#list-secret-id-accessors +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/secret-id", @@ -214,7 +214,7 @@ pub struct ListSecretIDRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/secret-id/lookup /// * Method: POST /// * Response: [ReadSecretIDResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#read-approle-secret-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/secret-id/lookup", @@ -237,7 +237,7 @@ pub struct ReadSecretIDRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/secret-id/destroy /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#destroy-approle-secret-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/secret-id/destroy", @@ -259,7 +259,7 @@ pub struct DeleteSecretIDRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/secret-id-accessor/lookup /// * Method: POST /// * Response: [ReadSecretIDResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#read-approle-secret-id-accessor +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/secret-id-accessor/lookup", @@ -282,7 +282,7 @@ pub struct ReadSecretIDAccessorRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/secret-id-accessor/destroy /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#destroy-approle-secret-id-accessor +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/secret-id-accessor/destroy", @@ -304,7 +304,7 @@ pub struct DeleteSecretIDAccessorRequest { /// * Path: /auth/{self.mount}/role/{self.role_name}/custom-secret-id /// * Method: POST /// * Response: [CreateCustomSecretIDResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#create-custom-approle-secret-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role_name}/custom-secret-id", @@ -331,7 +331,7 @@ pub struct CreateCustomSecretIDRequest { /// * Path: /auth/{self.mount}/tidy/secret-id /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/approle#tidy-tokens +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/tidy/secret-id", diff --git a/src/api/auth/aws/requests.rs b/src/api/auth/aws/requests.rs index 1dd0f56..56f83e9 100644 --- a/src/api/auth/aws/requests.rs +++ b/src/api/auth/aws/requests.rs @@ -15,7 +15,7 @@ use serde::Serialize; /// * Path: /auth/{self.mount}/config/client /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#configure-client +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/client", @@ -42,8 +42,8 @@ pub struct ConfigureClientRequest { /// /// * Path: /auth/{self.mount}/config/client /// * Method: GET -/// * Response: [ReadConfigurationResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#read-config +/// * Response: [ReadClientConfigurationResponse] +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/client", @@ -62,7 +62,7 @@ pub struct ReadClientConfigurationRequest { /// * Path: /auth/{self.mount}/config/client /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#delete-config +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/client", @@ -81,7 +81,7 @@ pub struct DeleteClientConfigurationRequest { /// * Path: /auth/{self.mount}/config/rotate-root /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#rotate-root-credentials +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/rotate-root", @@ -101,7 +101,7 @@ pub struct RotateRootCredentialsRequest { /// * Path: /auth/{self.mount}/config/identity /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#configure-identity-integration +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/identity", @@ -124,7 +124,7 @@ pub struct ConfigureIdentityRequest { /// * Path: /auth/{self.mount}/config/identity /// * Method: GET /// * Response: [ReadIdentityConfigurationResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#read-identity-integration-configuration +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/identity", @@ -143,7 +143,7 @@ pub struct ReadIdentityConfigurationRequest { /// * Path: /auth/{self.mount}/config/certificate/{self.cert_name} /// * Method: GET /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#create-certificate-configuration +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint( path = "/auth/{self.mount}/config/certificate/{self.cert_name}", @@ -167,7 +167,7 @@ pub struct CreateCertificateConfigurationRequest { /// * Path: /auth/{self.mount}/config/certificate/{self.cert_name} /// * Method: GET /// * Response: [ReadCertificateConfigurationResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#read-certificate-configuration +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/certificate/{self.cert_name}", @@ -188,7 +188,7 @@ pub struct ReadCertificateConfigurationRequest { /// * Path: /auth/{self.mount}/config/certificate/{self.cert_name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#delete-certificate-configuration +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/certificate/{self.cert_name}", @@ -209,7 +209,7 @@ pub struct DeleteCertificateConfigurationRequest { /// * Path: /auth/{self.mount}/config/certificates /// * Method: LIST /// * Response: [ListCertificateConfigurationsResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#list-certificate-configuration +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/certificates", @@ -230,7 +230,7 @@ pub struct ListCertificateConfigurationsRequest { /// * Path: /auth/{self.mount}/config/sts/{self.account_id} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#create-sts-role +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/sts/{self.account_id}", @@ -252,7 +252,7 @@ pub struct CreateStsRoleRequest { /// * Path: /auth/{self.mount}/config/sts/{self.account_id} /// * Method: GET /// * Response: [ReadStsRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#read-sts-role +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/sts/{self.account_id}", @@ -273,7 +273,7 @@ pub struct ReadStsRoleRequest { /// * Path: /auth/{self.mount}/config/sts /// * Method: LIST /// * Response: [ListStsRolesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#list-sts-roles +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/sts", @@ -293,7 +293,7 @@ pub struct ListStsRolesRequest { /// * Path: /auth/{self.mount}/config/sts/{self.account_id} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#delete-sts-role +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/sts/{self.account_id}", @@ -314,7 +314,7 @@ pub struct DeleteStsRoleRequest { /// * Path: /auth/{self.mount}/config/tidy/identity-accesslist /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#configure-identity-access-list-tidy-operation +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/tidy/identity-accesslist", @@ -335,7 +335,7 @@ pub struct ConfigureIdentityAccessListTidyOperationRequest { /// * Path: /auth/{self.mount}/config/tidy/identity-accesslist /// * Method: GET /// * Response: ReadIdentityAccessListTidySettingsResponse -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#read-identity-access-list-tidy-settings +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/tidy/identity-accesslist", @@ -354,7 +354,7 @@ pub struct ReadIdentityAccessListTidySettingsRequest { /// * Path: /auth/{self.mount}/config/tidy/identity-accesslist /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#delete-identity-access-list-tidy-settings +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/tidy/identity-accesslist", @@ -373,7 +373,7 @@ pub struct DeleteIdentityAccessListTidySettingsRequest { /// * Path: /auth/{self.mount}/config/tidy/roletag-denylist /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#configure-role-tag-deny-list-tidy-operation +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/tidy/roletag-denylist", @@ -394,7 +394,7 @@ pub struct ConfigureRoleTagDenyListTidyOperationRequest { /// * Path: /auth/{self.mount}/config/tidy/roletag-denylist /// * Method: GET /// * Response: ReadRoleTagDebyListTidySettingsResponse -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#read-role-tag-deny-list-tidy-settings +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/tidy/roletag-denylist", @@ -413,7 +413,7 @@ pub struct ReadRoleTagDenyListTidySettingsRequest { /// * Path: /auth/{self.mount}/config/tidy/roletag-denylist /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#delete-role-tag-deny-list-tidy-settings +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config/tidy/roletag-denylist", @@ -432,7 +432,7 @@ pub struct DeleteRoleTagDenyListTidySettingsRequest { /// * Path: /auth/{self.mount}/role/{self.role} /// * Method: POST /// * Response: [N/A] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#create-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role}", @@ -478,7 +478,7 @@ pub struct CreateRoleRequest { /// * Path: /auth/{self.mount}/role/{self.role} /// * Method: GET /// * Response: [ReadRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#read-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role}", @@ -499,7 +499,7 @@ pub struct ReadRoleRequest { /// * Path: /auth/{self.mount}/roles /// * Method: LIST /// * Response: [ListRolesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#list-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/roles", @@ -519,7 +519,7 @@ pub struct ListRolesRequest { /// * Path: /auth/{self.mount}/role/{self.role} /// * Method: DELETE /// * Response: [N/A] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#delete-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role}", @@ -541,7 +541,7 @@ pub struct DeleteRoleRequest { /// * Path: /auth/{self.mount}/role/{self.role}/tag /// * Method: POST /// * Response: [CreateRoleTagResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#create-role-tags +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.role}/tag", @@ -568,7 +568,7 @@ pub struct CreateRoleTagRequest { /// * Path: /auth/{self.mount}/login /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#login +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -588,7 +588,7 @@ pub struct IamLoginRequest { /// * Path: /auth/{self.mount}/login /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#login +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -608,7 +608,7 @@ pub struct Ec2LoginRequest { /// * Path: /auth/{self.mount}/roletag-denylist/{self.tag_value} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#place-role-tags-in-deny-list +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/roletag-denylist/{self.tag_value}", @@ -628,8 +628,8 @@ pub struct PlaceRoleTagsInDenyListRequest { /// /// * Path: /auth/{self.mount}/roletag-denylist/{self.role_tag} /// * Method: GET -/// * Response: [PlaceRoleTagsInDenyListResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#read-role-tag-deny-list-information +/// * Response: [ReadRoleTagDenyListResponse] +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/roletag-denylist/{self.tag_value}", @@ -650,7 +650,7 @@ pub struct ReadRoleTagDenyListRequest { /// * Path: /auth/{self.mount}/roletag-denylist /// * Method: LIST /// * Response: [ListDenyListTagsResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#list-deny-list-tags +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/roletag-denylist", @@ -670,7 +670,7 @@ pub struct ListDenyListTagsRequest { /// * Path: /auth/{self.mount}/roletag-denylist/{self.role_tag} /// * Method: DELETE /// * Response: [N/A] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#delete-deny-list-tags +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/roletag-denylist/{self.tag_value}", @@ -691,7 +691,7 @@ pub struct DeleteDenyListTagsRequest { /// * Path: /auth/{self.mount}/tidy/roletag-denylist /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#tidy-deny-list-tags +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/tidy/roletag-denylist", @@ -711,7 +711,7 @@ pub struct TidyDenyListTagsRequest { /// * Path: /auth/{self.mount}/identity-accesslist/{self.instance_id} /// * Method: GET /// * Response: [ReadIdentityAccessListInformationResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#tidy-deny-list-tags +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/identity-accesslist/{self.instance_id}", @@ -732,7 +732,7 @@ pub struct ReadIdentityAccessListInformationRequest { /// * Path: /auth/{self.mount}/identity-accesslist /// * Method: LIST /// * Response: [ListIdentityAccessListEntriesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#list-identity-access-list-entries +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/identity-accesslist", @@ -752,7 +752,7 @@ pub struct ListIdentityAccessListEntriesRequest { /// * Path: /auth/{self.mount}/identity-accesslist/{self.instance_id} /// * Method: DELETE /// * Response: [N/A] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#delete-identity-access-list-entries +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/identity-accesslist/{self.instance_id}", @@ -773,7 +773,7 @@ pub struct DeleteIdentityAccessListEntriesRequest { /// * Path: /auth/{self.mount}/tidy/identity-accesslist /// * Method: POST /// * Response: [N/A] -/// * Reference: https://www.vaultproject.io/api-docs/auth/aws#tidy-identity-access-list-entries +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/tidy/identity-accesslist", diff --git a/src/api/auth/aws/responses.rs b/src/api/auth/aws/responses.rs index f96375a..cbbbdb4 100644 --- a/src/api/auth/aws/responses.rs +++ b/src/api/auth/aws/responses.rs @@ -41,7 +41,7 @@ pub struct ReadCertificateConfigurationResponse { } /// Response from executing -/// [ListCertificateConfigurationResponse][crate::api::auth::aws::requests::ListCertificateConfigurationResponse] +/// [ListCertificateConfigurationsRequest][crate::api::auth::aws::requests::ListCertificateConfigurationsRequest] #[derive(Deserialize, Debug, Serialize)] pub struct ListCertificateConfigurationsResponse { pub keys: Vec, @@ -124,7 +124,7 @@ pub struct CreateRoleTagResponse { } /// Response from executing -/// [ReadRoleTagDenyListRequest][crate::api::auth::aws::requests::ReadRoleTagDenyListResponse] +/// [ReadRoleTagDenyListRequest][crate::api::auth::aws::requests::ReadRoleTagDenyListRequest] #[derive(Deserialize, Debug, Serialize)] pub struct ReadRoleTagDenyListResponse { pub expiration_time: String, diff --git a/src/api/auth/cert/requests.rs b/src/api/auth/cert/requests.rs index c942829..6fc4a43 100644 --- a/src/api/auth/cert/requests.rs +++ b/src/api/auth/cert/requests.rs @@ -8,7 +8,7 @@ use super::responses::{ListCaCertificateRoleResponse, ReadCaCertificateRoleRespo /// * Path: /auth/{self.mount}/certs/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://developer.hashicorp.com/vault/api-docs/auth/cert#create-ca-certificate-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/certs/{self.name}", @@ -52,7 +52,7 @@ pub struct CreateCaCertificateRoleRequest { /// * Path: /auth/{self.mount}/certs/{self.name} /// * Method: GET /// * Response: [ReadCaCertificateRoleResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/auth/cert#read-ca-certificate-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/certs/{self.name}", @@ -73,7 +73,7 @@ pub struct ReadCaCertificateRoleRequest { /// * Path: /auth/{self.mount}/certs/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://developer.hashicorp.com/vault/api-docs/auth/cert#delete-certificate-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/certs/{self.name}", @@ -94,7 +94,7 @@ pub struct DeleteCaCertificateRoleRequest { /// * Path: /auth/{self.mount}/certs /// * Method: LIST /// * Response: [ListCaCertificateRoleResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/auth/cert#list-certificate-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/certs", @@ -115,7 +115,7 @@ pub struct ListCaCertificateRoleRequest { /// * Path: /auth/{self.mount}/login /// * Method: POST /// * Response: N/A -/// * Reference: https://developer.hashicorp.com/vault/api-docs/auth/cert#login-with-tls-certificate-method +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] diff --git a/src/api/auth/kubernetes/requests.rs b/src/api/auth/kubernetes/requests.rs index b258c7b..ccc6ed5 100644 --- a/src/api/auth/kubernetes/requests.rs +++ b/src/api/auth/kubernetes/requests.rs @@ -9,7 +9,7 @@ use rustify_derive::Endpoint; /// * Path: /auth/kubernetes/config /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/kubernetes#configure-method +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/{self.mount}/config", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -30,7 +30,7 @@ pub struct ConfigureKubernetesAuthRequest { /// * Path: /auth/kubernetes/config /// * Method: GET /// * Response: [ReadKubernetesAuthConfigResponse] -/// * Reference: https://www.vaultproject.io/api/auth/kubernetes#read-config +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config", @@ -50,7 +50,7 @@ pub struct ReadKubernetesAuthConfigRequest { /// * Path: /auth/kubernetes/login /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/auth/kubernetes#login +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")] #[builder(setter(into))] @@ -66,8 +66,8 @@ pub struct LoginWithKubernetesRequest { /// /// * Path: /auth/{self.mount}/role /// * Method: LIST -/// * Response: [ListRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/kubernetes#list-roles +/// * Response: [ListRolesResponse] +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role", @@ -87,7 +87,7 @@ pub struct ListRolesRequest { /// * Path: /auth/{self.mount}/role/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/auth/kubernetes#create-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.name}", @@ -120,7 +120,7 @@ pub struct CreateKubernetesRoleRequest { /// * Path: /auth/{self.mount}/role/{self.name} /// * Method: GET /// * Response: [ReadKubernetesRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/kubernetes#read-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.name}", @@ -141,7 +141,7 @@ pub struct ReadKubernetesRoleRequest { /// * Path: /auth/{self.mount}/role/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/kubernetes#delete-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.name}", diff --git a/src/api/auth/oidc/requests.rs b/src/api/auth/oidc/requests.rs index c5d0d98..40ca329 100644 --- a/src/api/auth/oidc/requests.rs +++ b/src/api/auth/oidc/requests.rs @@ -10,7 +10,7 @@ use std::{collections::HashMap, fmt::Debug}; /// * Path: /auth/jwt/config /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/auth/jwt#configure +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/{self.mount}/config", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -39,7 +39,7 @@ pub struct SetConfigurationRequest { /// * Path: /auth/{self.mount}/config /// * Method: GET /// * Response: [ReadConfigurationResponse] -/// * Reference: https://www.vaultproject.io/api/auth/jwt#read-config +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/config", @@ -58,7 +58,7 @@ pub struct ReadConfigurationRequest { /// * Path: /auth/{self.mount}/role/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/auth/jwt#create-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.name}", @@ -103,7 +103,7 @@ pub struct SetRoleRequest { /// * Path: /auth/{self.mount}/role/{self.name} /// * Method: GET /// * Response: [ReadRoleResponse] -/// * Reference: https://www.vaultproject.io/api/auth/jwt#read-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.name}", @@ -123,8 +123,8 @@ pub struct ReadRoleRequest { /// /// * Path: /auth/{self.mount}/role /// * Method: LIST -/// * Response: [ListRoleResponse] -/// * Reference: https://www.vaultproject.io/api/auth/jwt#list-roles +/// * Response: [ListRolesResponse] +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role", @@ -144,7 +144,7 @@ pub struct ListRolesRequest { /// * Path: /auth/{self.mount}/role/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/auth/jwt#delete-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/role/{self.name}", @@ -165,7 +165,7 @@ pub struct DeleteRoleRequest { /// * Path: /auth/{self.mount}/oidc/auth_url /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/auth/jwt#oidc-authorization-url-request +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/oidc/auth_url", @@ -187,7 +187,7 @@ pub struct OIDCAuthRequest { /// * Path: /auth/{self.mount}/oidc/callback /// * Method: GET /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/auth/jwt#oidc-callback +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/{self.mount}/oidc/callback", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -212,7 +212,7 @@ pub struct OIDCCallbackRequest { /// * Path: /auth/{self.mount}/login /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/auth/jwt#jwt-login +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] diff --git a/src/api/auth/userpass/requests.rs b/src/api/auth/userpass/requests.rs index d9559ea..15d29c7 100644 --- a/src/api/auth/userpass/requests.rs +++ b/src/api/auth/userpass/requests.rs @@ -7,7 +7,7 @@ use rustify_derive::Endpoint; /// * Path: /auth/{self.mount}/users/{self.username} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/userpass#create-update-user +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/users/{self.username}", @@ -38,7 +38,7 @@ pub struct CreateUserRequest { /// * Path: /auth/{self.mount}/users/{self.username} /// * Method: GET /// * Response: [ReadUserResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/userpass#read-user +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/users/{self.username}", @@ -59,7 +59,7 @@ pub struct ReadUserRequest { /// * Path: /auth/{self.mount}/users/{self.username} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/userpass#delete-user +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/users/{self.username}", @@ -80,7 +80,7 @@ pub struct DeleteUserRequest { /// * Path: /auth/{self.mount}/users/{self.username}/password /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/userpass#update-password-on-user +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/users/{self.username}/password", @@ -102,7 +102,7 @@ pub struct UpdatePasswordRequest { /// * Path: /auth/{self.mount}/users/{self.username}/policies /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/userpass#update-policies-on-user +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/users/{self.username}/policies", @@ -124,7 +124,7 @@ pub struct UpdatePoliciesRequest { /// * Path: /auth/{self.mount}/users /// * Method: LIST /// * Response: [ListUsersResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/userpass#list-users +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/users", @@ -144,7 +144,7 @@ pub struct ListUsersRequest { /// * Path: /auth/{self.mount}/login/{self.username} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/userpass#login +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/{self.mount}/login/{self.username}", diff --git a/src/api/aws/requests.rs b/src/api/aws/requests.rs index 8dc8b07..baace36 100644 --- a/src/api/aws/requests.rs +++ b/src/api/aws/requests.rs @@ -13,7 +13,7 @@ use super::responses::{ /// * Path: {self.mount}/config/root /// * Method: POST /// * Response: N/A -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#configure-root-iam-credentials +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/config/root", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -36,7 +36,7 @@ pub struct SetConfigurationRequest { /// * Path: {self.mount}/config/root /// * Method: GET /// * Response: [GetConfigurationResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#read-root-configuration +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/root", @@ -57,7 +57,7 @@ pub struct GetConfigurationRequest { /// * Path: {self.mount}/config/rotate-root /// * Method: GET /// * Response: [RotateRootCredentialsResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#rotate-root-iam-credentials +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/rotate-root", @@ -78,7 +78,7 @@ pub struct RotateRootCredentialsRequest { /// * Path: {self.mount}/config/lease /// * Method: POST /// * Response: N.A. -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#configure-lease +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/config/lease", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -97,7 +97,7 @@ pub struct ConfigureLeaseRequest { /// * Path: {self.mount}/config/lease /// * Method: GET /// * Response: [ReadLeaseResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#read-lease +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/lease", @@ -118,7 +118,7 @@ pub struct ReadLeaseRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: POST /// * Response: N.A. -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#create-update-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -153,7 +153,7 @@ pub struct CreateUpdateRoleRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: GET /// * Response: [ReadRoleResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#read-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -176,7 +176,7 @@ pub struct ReadRoleRequest { /// * Path: {self.mount}/roles /// * Method: LIST /// * Response: [ListRolesResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#list-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles", @@ -197,7 +197,7 @@ pub struct ListRolesRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: DELETE /// * Response: N.A. -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#delete-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -218,7 +218,7 @@ pub struct DeleteRoleRequest { /// * Path: {self.mount}/creds/{self.name} /// * Method: GET /// * Response: [GenerateCredentialsResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#generate-credentials +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/creds/{self.name}", @@ -243,7 +243,7 @@ pub struct GenerateCredentialsRequest { /// * Path: {self.mount}/sts/{self.name} /// * Method: POST /// * Response: [GenerateCredentialsResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/aws#generate-credentials +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/sts/{self.name}", diff --git a/src/api/database/requests.rs b/src/api/database/requests.rs index 96670f0..dbbe6f1 100644 --- a/src/api/database/requests.rs +++ b/src/api/database/requests.rs @@ -12,7 +12,7 @@ use std::fmt::Debug; /// * Path: {self.mount}/config/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/databases#configure-connection +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/{self.name}", @@ -45,7 +45,7 @@ pub struct PostgreSQLConnectionRequest { /// * Path: {self.mount}/config/{self.name} /// * Method: GET /// * Response: [ReadConnectionResponse]] -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#read-connection +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/{self.name}", @@ -66,7 +66,7 @@ pub struct ReadConnectionRequest { /// * Path: {self.mount}/config /// * Method: LIST /// * Response: [ListConnectionsResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#list-connections +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config", @@ -86,7 +86,7 @@ pub struct ListConnectionsRequest { /// * Path: {{self.mount}/config/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#delete-connection +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/{self.name}", @@ -108,7 +108,7 @@ pub struct DeleteConnectionRequest { /// * Path: {{self.mount}/reset/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#reset-connection +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/reset/{self.name}", @@ -130,7 +130,7 @@ pub struct ResetConnectionRequest { /// * Path: {{self.mount}/rotate-root/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#rotate-root-credentials +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/rotate-root/{self.name}", @@ -151,7 +151,7 @@ pub struct RotateRootRequest { /// * Path: {{self.mount}/roles/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#create-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -179,7 +179,7 @@ pub struct SetRoleRequest { /// * Path: {{self.mount}/roles/{self.name} /// * Method: GET /// * Response: [ReadRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#read-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -200,7 +200,7 @@ pub struct ReadRoleRequest { /// * Path: {self.mount}/roles /// * Method: LIST /// * Response: [ListRolesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#list-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles", @@ -220,7 +220,7 @@ pub struct ListRolesRequest { /// * Path: {{self.mount}/roles/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#delete-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -242,7 +242,7 @@ pub struct DeleteRoleRequest { /// * Path: {{self.mount}/creds/{self.name} /// * Method: GET /// * Response: [GenerateCredentialsResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#read-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/creds/{self.name}", @@ -263,7 +263,7 @@ pub struct GenerateCredentialsRequest { /// * Path: {{self.mount}/static-oles/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#create-static-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/static-roles/{self.name}", @@ -288,7 +288,7 @@ pub struct SetStaticRoleRequest { /// * Path: {{self.mount}/static-roles/{self.name} /// * Method: GET /// * Response: [ReadStaticRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#read-static-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/static-roles/{self.name}", @@ -309,7 +309,7 @@ pub struct ReadStaticRoleRequest { /// * Path: {self.mount}/static-roles /// * Method: LIST /// * Response: [ListStaticRolesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#list-static-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/static-roles", @@ -329,7 +329,7 @@ pub struct ListStaticRolesRequest { /// * Path: {{self.mount}/static-roles/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#delete-static-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/static-roles/{self.name}", @@ -350,7 +350,7 @@ pub struct DeleteStaticRoleRequest { /// * Path: {self.mount}/static-creds/{self.name} /// * Method: GET /// * Response: [GetStaticCredentialsResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#get-static-credentials +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/static-creds/{self.name}", @@ -372,7 +372,7 @@ pub struct GetStaticCredentialsRequest { /// * Path: {{self.mount}/rotate-role/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/databases#rotate-static-role-credentials +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/rotate-role/{self.name}", diff --git a/src/api/identity/entity/requests.rs b/src/api/identity/entity/requests.rs index 1ddafea..16d44ef 100644 --- a/src/api/identity/entity/requests.rs +++ b/src/api/identity/entity/requests.rs @@ -16,7 +16,7 @@ use super::responses::{ /// /// * Path: identity/entity /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#create-an-entity +/// * Reference: /// /// [`identity::entity::update_by_id`]: crate::identity::entity::update_by_id #[derive(Builder, Debug, Default, Endpoint)] @@ -45,7 +45,7 @@ pub struct CreateEntityRequest { /// * Path: identity/entity/id/{self.id} /// * Method: GET /// * Response: [ReadEntityByIdResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#read-entity-by-id +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "identity/entity/id/{self.id}", @@ -66,7 +66,7 @@ pub struct ReadEntityByIdRequest { /// /// * Path: identity/entity/id/{self.id} /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#update-entity-by-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/entity/id/{self.id}", @@ -94,7 +94,7 @@ pub struct UpdateEntityByIdRequest { /// /// * Path: identity/entity/id/{self.id} /// * Method: DELETE -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#delete-entity-by-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/entity/id/{self.id}", @@ -114,7 +114,7 @@ pub struct DeleteEntityByIdRequest { /// /// * Path: identity/entity/batch-delete /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#batch-delete-entities +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/entity/batch-delete", @@ -134,7 +134,7 @@ pub struct BatchDeleteRequest { /// * Path: identity/entity/id /// * Method: LIST /// * Response: [ListEntitiesByIdResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#list-entities-by-id +/// * Reference: #[derive(Builder, Debug, Endpoint, Default)] #[endpoint( path = "identity/entity/id", @@ -151,7 +151,7 @@ pub struct ListEntitiesByIdRequest {} /// /// * Path: identity/entity/name/{self.name} /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#create-update-entity-by-name +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/entity/name/{self.name}", @@ -177,7 +177,7 @@ pub struct CreateEntityByNameRequest { /// * Path: identity/entity/name/{self.name} /// * Method: GET /// * Response: [ReadEntityByNameResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#read-entity-by-name +/// * Reference: #[derive(Builder, Debug, Endpoint, Default)] #[endpoint( path = "identity/entity/name/{self.name}", @@ -198,7 +198,7 @@ pub struct ReadEntityByNameRequest { /// /// * Path: identity/entity/name/{self.name} /// * Method: DELETE -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#delete-entity-by-name +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/entity/name/{self.name}", @@ -219,7 +219,7 @@ pub struct DeleteEntityByNameRequest { /// * Path: identity/entity/name /// * Method: LIST /// * Response: [ListEntitiesByNameResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#list-entities-by-name +/// * Reference: #[derive(Builder, Debug, Endpoint, Default)] #[endpoint( path = "identity/entity/name", @@ -236,7 +236,7 @@ pub struct ListEntitiesByNameRequest {} /// /// * Path: identity/entity/merge /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity#merge-entities +/// * Reference: #[derive(Builder, Debug, Endpoint, Default)] #[endpoint(path = "identity/entity/merge", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] diff --git a/src/api/identity/entity_alias/requests.rs b/src/api/identity/entity_alias/requests.rs index d0e57d6..ed1e4c8 100644 --- a/src/api/identity/entity_alias/requests.rs +++ b/src/api/identity/entity_alias/requests.rs @@ -11,8 +11,8 @@ use std::{collections::HashMap, fmt::Debug}; /// /// * Path: identity/entity-alias /// * Method: POST -/// * Response: [Option] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity-alias#create-an-entity-alias +/// * Response: [`Option`] +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/entity-alias", @@ -44,7 +44,7 @@ pub struct CreateEntityAliasRequest { /// * Path: identity/entity-alias/id/{self.id} /// * Method: GET /// * Response: [ReadEntityAliasByIdResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity-alias#read-entity-alias-by-id +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "identity/entity-alias/id/{self.id}", @@ -65,7 +65,7 @@ pub struct ReadEntityAliasByIdRequest { /// /// * Path: identity/entity-alias/id/{self.id} /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity-alias#update-entity-alias-by-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/entity-alias/id/{self.id}", @@ -95,7 +95,7 @@ pub struct UpdateEntityAliasByIdRequest { /// /// * Path: identity/entity-alias/id/{self.id} /// * Method: DELETE -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity-alias#delete-entity-alias-by-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/entity-alias/id/{self.id}", @@ -116,7 +116,7 @@ pub struct DeleteEntityAliasByIdRequest { /// * Path: identity/entity-alias/id /// * Method: LIST /// * Response: [ListEntityAliasesByIdResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/entity-alias#list-entity-alias-by-id +/// * Reference: #[derive(Builder, Debug, Endpoint, Default)] #[endpoint( path = "identity/entity-alias/id", diff --git a/src/api/identity/entity_alias/responses.rs b/src/api/identity/entity_alias/responses.rs index 5a88113..b1448d6 100644 --- a/src/api/identity/entity_alias/responses.rs +++ b/src/api/identity/entity_alias/responses.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; /// Response from executing -/// [CreateEntityAliasRequest](crate::api::ididentity::entity_alias::request::CreateEntityAliasRequest) +/// [CreateEntityAliasRequest](crate::api::identity::entity_alias::requests::CreateEntityAliasRequest) #[derive(Deserialize, Debug, Serialize)] pub struct CreateEntityAliasResponse { pub canonical_id: String, diff --git a/src/api/identity/group/requests.rs b/src/api/identity/group/requests.rs index 94696ec..9ca8780 100644 --- a/src/api/identity/group/requests.rs +++ b/src/api/identity/group/requests.rs @@ -15,7 +15,7 @@ use std::{collections::HashMap, fmt::Debug}; /// /// * Path: identity/group /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#create-a-group +/// * Reference: /// /// [`identity::group::update_by_id`]: crate::identity::group::update_by_id #[derive(Builder, Debug, Default, Endpoint, Serialize)] @@ -47,7 +47,7 @@ pub struct CreateGroupRequest { /// * Path: identity/group/id/{self.id} /// * Method: GET /// * Response: [ReadGroupByIdResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#read-group-by-id +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "identity/group/id/{self.id}", @@ -68,7 +68,7 @@ pub struct ReadGroupByIdRequest { /// /// * Path: identity/group/id/{self.id} /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#update-group-by-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint( path = "identity/group/id/{self.id}", @@ -101,7 +101,7 @@ pub struct UpdateGroupByIdRequest { /// /// * Path: identity/group/id/{self.id} /// * Method: DELETE -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#delete-group-by-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/group/id/{self.id}", @@ -122,7 +122,7 @@ pub struct DeleteGroupByIdRequest { /// * Path: identity/group/id /// * Method: LIST /// * Response: [ListGroupsByIdResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#list-groups-by-id +/// * Reference: #[derive(Builder, Debug, Endpoint, Default)] #[endpoint( path = "identity/group/id", @@ -139,7 +139,7 @@ pub struct ListGroupsByIdRequest {} /// /// * Path: identity/group/name/{self.name} /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#create-a-group +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint( path = "identity/group/name/{self.name}", @@ -170,7 +170,7 @@ pub struct CreateGroupByNameRequest { /// * Path: identity/group/name/{self.name} /// * Method: GET /// * Response: [ReadGroupByNameResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#read-group-by-name +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "identity/group/name/{self.name}", @@ -191,7 +191,7 @@ pub struct ReadGroupByNameRequest { /// /// * Path: identity/group/name/{self.name} /// * Method: DELETE -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#delete-group-by-name +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/group/name/{self.name}", @@ -212,7 +212,7 @@ pub struct DeleteGroupByNameRequest { /// * Path: identity/group/name /// * Method: LIST /// * Response: [ListGroupsByNameResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group#list-groups-by-name +/// * Reference: #[derive(Builder, Debug, Endpoint, Default)] #[endpoint( path = "identity/group/name", diff --git a/src/api/identity/group_alias/requests.rs b/src/api/identity/group_alias/requests.rs index f75e201..35d4c13 100644 --- a/src/api/identity/group_alias/requests.rs +++ b/src/api/identity/group_alias/requests.rs @@ -12,7 +12,7 @@ use std::fmt::Debug; /// * Path: identity/group-alias /// * Method: POST /// * Response: [CreateGroupAliasResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group-alias#create-a-group-alias +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Deserialize, Serialize)] #[endpoint( path = "identity/group-alias", @@ -38,7 +38,7 @@ pub struct CreateGroupAliasRequest { /// /// * Path: identity/group-alias/id/{self.id} /// * Method: POST -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group-alias#update-group-alias-by-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/group-alias/id/{self.id}", @@ -65,7 +65,7 @@ pub struct UpdateGroupAliasByIdRequest { /// * Path: identity/group-alias/id/{self.id} /// * Method: GET /// * Response: [ReadGroupAliasByIdResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group-alias#read-group-alias-by-id +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "identity/group-alias/id/{self.id}", @@ -86,7 +86,7 @@ pub struct ReadGroupAliasByIdRequest { /// /// * Path: identity/group-alias/id/{self.id} /// * Method: DELETE -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group-alias#delete-group-alias-by-id +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "identity/group-alias/id/{self.id}", @@ -107,7 +107,7 @@ pub struct DeleteGroupAliasByIdRequest { /// * Path: identity/group-alias/id /// * Method: LIST /// * Response: [ListGroupAliasesByIdResponse] -/// * Reference: https://developer.hashicorp.com/vault/api-docs/secret/identity/group-alias#list-group-alias-by-id +/// * Reference: #[derive(Builder, Debug, Endpoint, Default)] #[endpoint( path = "identity/group-alias/id", diff --git a/src/api/kv1/requests.rs b/src/api/kv1/requests.rs index 8f3cae2..7651334 100644 --- a/src/api/kv1/requests.rs +++ b/src/api/kv1/requests.rs @@ -9,7 +9,7 @@ use std::fmt::Debug; /// * Path: {self.mount}/{self.path} /// * Method: GET /// * Response: GetSecretResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v1#read-secret +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/{self.path}", @@ -30,7 +30,7 @@ pub struct GetSecretRequest { /// * Path: {self.mount}/{self.path} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v1#create-update-secret +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint(path = "{self.mount}/{self.path}", method = "POST", builder = "true")] #[builder(setter(into))] @@ -54,7 +54,7 @@ pub struct SetSecretRequest { /// * Path: {self.mount}/{self.path} /// * Method: LIST /// * Response: ListSecretResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v1#list-secrets +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/{self.path}", @@ -76,7 +76,7 @@ pub struct ListSecretRequest { /// * Path: {self.mount}/{self.path} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v1#delete-secret +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint(path = "{self.mount}/{self.path}", method = "DELETE", builder = "true")] #[builder(setter(into))] diff --git a/src/api/kv2/requests.rs b/src/api/kv2/requests.rs index c0adc32..8fa7e57 100644 --- a/src/api/kv2/requests.rs +++ b/src/api/kv2/requests.rs @@ -14,7 +14,7 @@ use std::fmt::Debug; /// * Path: {self.mount}/config /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#configure-the-kv-engine +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/config", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -33,7 +33,7 @@ pub struct SetConfigurationRequest { /// * Path: {self.mount}/config /// * Method: GET /// * Response: ReadConfigurationResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#read-kv-engine-configuration +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config", @@ -52,7 +52,7 @@ pub struct ReadConfigurationRequest { /// * Path: {self.mount}/data/{self.path} /// * Method: GET /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#read-secret-version +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/data/{self.path}", @@ -76,7 +76,7 @@ pub struct ReadSecretRequest { /// * Path: {self.mount}/data/{self.path} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#create-update-secret +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/data/{self.path}", @@ -108,7 +108,7 @@ pub struct SetSecretRequestOptions { /// * Path: {self.mount}/data/{self.path} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#delete-latest-version-of-secret +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/data/{self.path}", @@ -129,7 +129,7 @@ pub struct DeleteLatestSecretVersionRequest { /// * Path: {self.mount}/delete/{self.path} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#delete-secret-versions +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/delete/{self.path}", @@ -151,7 +151,7 @@ pub struct DeleteSecretVersionsRequest { /// * Path: {self.mount}/undelete/{self.path} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#undelete-secret-versions +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/undelete/{self.path}", @@ -174,7 +174,7 @@ pub struct UndeleteSecretVersionsRequest { /// * Path: {self.mount}/destroy/{self.path} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#destroy-secret-versions +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/destroy/{self.path}", @@ -196,7 +196,7 @@ pub struct DestroySecretVersionsRequest { /// * Path: {self.mount}/metadata/{self.path} /// * Method: LIST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#list-secrets +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/metadata/{self.path}", @@ -219,7 +219,7 @@ pub struct ListSecretsRequest { /// * Path: {self.mount}/metadata/{self.path} /// * Method: GET /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#read-secret-metadata +/// * Reference: #[derive(Builder, Debug, Endpoint)] #[endpoint( path = "{self.mount}/metadata/{self.path}", @@ -241,7 +241,7 @@ pub struct ReadSecretMetadataRequest { /// * Path: {self.mount}/metadata/{self.path} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#create-update-metadata +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/metadata/{self.path}", @@ -267,7 +267,7 @@ pub struct SetSecretMetadataRequest { /// * Path: {self.mount}/metadata/{self.path} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/kv/kv-v2#delete-metadata-and-all-versions +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/metadata/{self.path}", diff --git a/src/api/pki/requests.rs b/src/api/pki/requests.rs index 6a6985b..9302fa6 100644 --- a/src/api/pki/requests.rs +++ b/src/api/pki/requests.rs @@ -13,7 +13,7 @@ use rustify_derive::Endpoint; /// * Path: {self.mount}/config/ca /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/pki#submit-ca-information +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/config/ca", method = "POST", builder = "true")] @@ -25,7 +25,7 @@ pub struct SubmitCARequest { } /// ## Generate Root -/// https://www.vaultproject.io/api/secret/pki#generate-root +/// /// This endpoint generates a new self-signed CA certificate and private key. If /// the path ends with exported, the private key will be returned in the /// response; if it is internal the private key will not be returned and cannot @@ -33,8 +33,8 @@ pub struct SubmitCARequest { /// /// * Path: {self.mount}/root/generate/{self.cert_type} /// * Method: POST -/// * Response: [Option`] +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/root/generate/{self.cert_type}", @@ -79,7 +79,7 @@ pub struct GenerateRootRequest { /// * Path: {self.mount}/root /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/pki#delete-root +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/root", method = "DELETE", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -97,7 +97,7 @@ pub struct DeleteRootRequest { /// * Path: {self.mount}/sign/{self.role} /// * Method: POST /// * Response: [SignCertificateResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#sign-certificate +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/sign/{self.role}", @@ -130,7 +130,7 @@ pub struct SignCertificateRequest { /// * Path: {self.mount}/root/sign-intermediate /// * Method: POST /// * Response: [SignIntermediateResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#sign-intermediate +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/root/sign-intermediate", @@ -171,7 +171,7 @@ pub struct SignIntermediateRequest { /// * Path: {self.mount}/root/sign-self-issued /// * Method: POST /// * Response: [SignSelfIssuedResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#sign-intermediate +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/root/sign-self-issued", @@ -193,7 +193,7 @@ pub struct SignSelfIssuedRequest { /// * Path: {self.mount}/certs /// * Method: LIST /// * Response: [ListCertificatesResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#list-certificates +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/certs", @@ -216,7 +216,7 @@ pub struct ListCertificatesRequest { /// * Path: {self.mount}/cert/{self.serial} /// * Method: GET /// * Response: [ReadCertificateResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#read-certificate +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/cert/{self.serial}", @@ -240,7 +240,7 @@ pub struct ReadCertificateRequest { /// * Path: {self.mount}/issue/{self.role} /// * Method: POST /// * Response: [GenerateCertificateResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#read-certificate +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/issue/{self.role}", @@ -273,7 +273,7 @@ pub struct GenerateCertificateRequest { /// * Path: {self.mount}/revoke /// * Method: POST /// * Response: [RevokeCertificateResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#revoke-certificate +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/revoke", @@ -295,7 +295,7 @@ pub struct RevokeCertificateRequest { /// * Path: {self.mount}/config/crl /// * Method: GET /// * Response: [ReadCRLConfigResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#read-crl-configuration +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/crl", @@ -316,7 +316,7 @@ pub struct ReadCRLConfigRequest { /// * Path: {self.mount}/config/crl /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/pki#set-crl-configuration +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/config/crl", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -336,7 +336,7 @@ pub struct SetCRLConfigRequest { /// * Path: {self.mount}/crl/rotate /// * Method: GET /// * Response: [RotateCRLsResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#rotate-crls +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/crl/rotate", @@ -355,7 +355,7 @@ pub struct RotateCRLsRequest { /// * Path: {self.mount}/config/urls /// * Method: GET /// * Response: [ReadURLsResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#read-urls +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/urls", @@ -376,7 +376,7 @@ pub struct ReadURLsRequest { /// * Path: {self.mount}/config/urls /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/pki#set-urls +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/config/urls", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -397,7 +397,7 @@ pub struct SetURLsRequest { /// * Path: {self.mount}/intermediate/generate/{self.cert_type} /// * Method: POST /// * Response: [GenerateIntermediateResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#generate-intermediate +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/intermediate/generate/{self.cert_type}", @@ -439,7 +439,7 @@ pub struct GenerateIntermediateRequest { /// * Path: {{self.mount}/intermediate/set-signed /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/pki#set-signed-intermediate +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/intermediate/set-signed", @@ -460,7 +460,7 @@ pub struct SetSignedIntermediateRequest { /// * Path: {self.mount}/roles /// * Method: LIST /// * Response: [ListRolesResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#list-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles", @@ -480,7 +480,7 @@ pub struct ListRolesRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: GET /// * Response: [ReadRoleResponse] -/// * Reference: https://www.vaultproject.io/api/secret/pki#read-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -501,7 +501,7 @@ pub struct ReadRoleRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/pki#create-update-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -562,7 +562,7 @@ pub struct SetRoleRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/pki#delete-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -585,7 +585,7 @@ pub struct DeleteRoleRequest { /// * Path: {self.mount}/tidy /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api/secret/pki#tidy +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/tidy", diff --git a/src/api/ssh/requests.rs b/src/api/ssh/requests.rs index 652c9df..7e9d96a 100644 --- a/src/api/ssh/requests.rs +++ b/src/api/ssh/requests.rs @@ -13,7 +13,7 @@ use rustify_derive::Endpoint; /// * Path: {self.mount}/keys/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#create-update-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/keys/{self.name}", @@ -35,7 +35,7 @@ pub struct SetKeyRequest { /// * Path: {self.mount}/keys/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#delete-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/keys/{self.name}", @@ -56,7 +56,7 @@ pub struct DeleteKeyRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#create-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -102,7 +102,7 @@ pub struct SetRoleRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: GET /// * Response: [ReadRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#read-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -123,7 +123,7 @@ pub struct ReadRoleRequest { /// * Path: {self.mount}/roles /// * Method: LIST /// * Response: [ListRolesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#list-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles", @@ -143,7 +143,7 @@ pub struct ListRolesRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#delete-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/{self.name}", @@ -164,7 +164,7 @@ pub struct DeleteRoleRequest { /// * Path: {self.mount}/config/zeroaddress /// * Method: GET /// * Response: [ListZeroAddressRolesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#list-zero-address-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/zeroaddress", @@ -183,7 +183,7 @@ pub struct ListZeroAddressRolesRequest { /// * Path: {self.mount}/config/zeroaddress /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#configure-zero-address-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/zeroaddress", @@ -203,7 +203,7 @@ pub struct ConfigureZeroAddressRolesRequest { /// * Path: {self.mount}/roles/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#delete-zero-address-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/roles/zeroaddress", @@ -223,7 +223,7 @@ pub struct DeleteZeroAddressRolesRequest { /// * Path: {self.mount}/creds/{self.name} /// * Method: POST /// * Response: [GenerateSSHCredsResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#generate-ssh-credentials +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/creds/{self.name}", @@ -247,7 +247,7 @@ pub struct GenerateSSHCredsRequest { /// * Path: {self.mount}/lookup /// * Method: POST /// * Response: [ListRolesByIPResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#list-roles-by-ip +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/lookup", @@ -268,7 +268,7 @@ pub struct ListRolesByIPRequest { /// * Path: {self.mount}/verify /// * Method: POST /// * Response: [VerifySSHOTPResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#verify-ssh-otp +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/verify", @@ -290,7 +290,7 @@ pub struct VerifySSHOTPRequest { /// * Path: {self.mount}/config/ca /// * Method: POST /// * Response: [SubmitCAInfoResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#submit-ca-information +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/ca", @@ -313,7 +313,7 @@ pub struct SubmitCAInfoRequest { /// * Path: {self.mount}/config/ca /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#delete-ca-information +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/config/ca", method = "DELETE", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -328,7 +328,7 @@ pub struct DeleteCAInfoRequest { /// * Path: {self.mount}/config/ca /// * Method: GET /// * Response: [ReadPublicKeyResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#read-public-key-authenticated +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/config/ca", @@ -348,7 +348,7 @@ pub struct ReadPublicKeyRequest { /// * Path: {self.mount}/sign/{self.name} /// * Method: POST /// * Response: [SignSSHKeyResponse] -/// * Reference: https://www.vaultproject.io/api-docs/secret/ssh#sign-ssh-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/sign/{self.name}", diff --git a/src/api/sys/requests.rs b/src/api/sys/requests.rs index 5582fcb..46be4ac 100644 --- a/src/api/sys/requests.rs +++ b/src/api/sys/requests.rs @@ -13,7 +13,7 @@ use std::collections::HashMap; /// * Path: sys/mounts/{self.path} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/system/mounts#enable-secrets-engine +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint(path = "sys/mounts/{self.path}", method = "POST", builder = "true")] @@ -46,8 +46,8 @@ pub struct EnableEngineDataConfig { /// /// * Path: sys/mounts /// * Method: GET -/// * Response: [HashMap] +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( @@ -64,7 +64,7 @@ pub struct ListMountsRequest {} /// * Path: sys/auth/{self.path} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/system/auth#enable-auth-method +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint(path = "sys/auth/{self.path}", method = "POST", builder = "true")] @@ -96,8 +96,8 @@ pub struct EnableAuthDataConfig { /// /// * Path: sys/auth /// * Method: GET -/// * Response: [HashMap] +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( @@ -114,7 +114,7 @@ pub struct ListAuthsRequest {} /// * Path: /sys/wrapping/unwrap /// * Method: POST /// * Response: T -/// * Reference: https://www.vaultproject.io/api-docs/system/wrapping-unwrap#wrapping-unwrap +/// * Reference: #[derive(Builder, Endpoint)] #[endpoint(path = "/sys/wrapping/unwrap", method = "POST", response = "Value")] @@ -129,7 +129,7 @@ pub struct UnwrapRequest { /// * Path: /sys/wrapping/lookup /// * Method: POST /// * Response: WrappingLookupResponse -/// * Reference: https://www.vaultproject.io/api-docs/system/wrapping-unwrap#wrapping-unwrap +/// * Reference: #[derive(Builder, Default, Endpoint)] #[endpoint( @@ -149,7 +149,7 @@ pub struct WrappingLookupRequest { /// * Path: /sys/health /// * Method: GET /// * Response: [ReadHealthResponse] -/// * Reference: https://www.vaultproject.io/api-docs/system/health#read-health-information +/// * Reference: #[derive(Builder, Default, Endpoint)] #[endpoint( @@ -166,7 +166,7 @@ pub struct ReadHealthRequest {} /// * Path: /sys/seal /// * Method: PUT /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/system/seal#seal +/// * Reference: #[derive(Builder, Default, Endpoint)] #[endpoint(path = "/sys/seal", method = "PUT", builder = "true")] @@ -179,7 +179,7 @@ pub struct SealRequest {} /// * Path: /sys/unseal /// * Method: PUT /// * Response: [UnsealResponse] -/// * Reference: https://www.vaultproject.io/api-docs/system/unseal +/// * Reference: #[derive(Builder, Default, Endpoint)] #[endpoint( @@ -201,7 +201,7 @@ pub struct UnsealRequest { /// * Path: /sys/policy /// * Method: GET /// * Response: [ListPoliciesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/system/policy#list-policies +/// * Reference: #[derive(Builder, Default, Endpoint)] #[endpoint( @@ -218,7 +218,7 @@ pub struct ListPoliciesRequest {} /// * Path: /sys/policy/{self.name} /// * Method: GET /// * Response: [ReadPolicyResponse] -/// * Reference: https://www.vaultproject.io/api-docs/system/policy#read-policy +/// * Reference: #[derive(Builder, Default, Endpoint)] #[endpoint( @@ -237,7 +237,7 @@ pub struct ReadPolicyRequest { /// * Path: /sys/policy/{self.name} /// * Method: PUT /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/system/policy#create-update-policy +/// * Reference: #[derive(Builder, Default, Endpoint)] #[endpoint(path = "/sys/policy/{self.name}", method = "PUT", builder = "true")] @@ -253,7 +253,7 @@ pub struct CreatePolicyRequest { /// * Path: /sys/policy/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/system/policy#delete-policy +/// * Reference: #[derive(Builder, Default, Endpoint)] #[endpoint(path = "/sys/policy/{self.name}", method = "DELETE", builder = "true")] diff --git a/src/api/token/requests.rs b/src/api/token/requests.rs index ca96393..61615ec 100644 --- a/src/api/token/requests.rs +++ b/src/api/token/requests.rs @@ -11,7 +11,7 @@ use std::{collections::HashMap, fmt::Debug}; /// * Path: /auth/token/accessors /// * Method: LIST /// * Response: [ListAccessorResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#list-accessors +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( @@ -29,7 +29,7 @@ pub struct ListAccessorRequest {} /// * Path: /auth/token/create /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#create-token +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint(path = "/auth/token/create", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -57,7 +57,7 @@ pub struct CreateTokenRequest { /// * Path: /auth/token/create-orphan /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#create-token +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint(path = "/auth/token/create-orphan", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -85,7 +85,7 @@ pub struct CreateOrphanTokenRequest { /// * Path: /auth/token/create/{self.role_name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#create-token +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint( path = "/auth/token/create/{self.role_name}", @@ -119,7 +119,7 @@ pub struct CreateRoleTokenRequest { /// * Path: /auth/token/lookup /// * Method: POST /// * Response: [LookupTokenResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#lookup-a-token +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/token/lookup", @@ -138,7 +138,7 @@ pub struct LookupTokenRequest { /// * Path: /auth/token/lookup-self /// * Method: GET /// * Response: [LookupTokenResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#lookup-a-token-self +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/token/lookup-self", @@ -154,7 +154,7 @@ pub struct LookupTokenSelfRequest {} /// * Path: /auth/token/lookup-accessor /// * Method: POST /// * Response: [LookupTokenResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#lookup-a-token-accessor +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/token/lookup-accessor", @@ -173,7 +173,7 @@ pub struct LookupTokenAccessorRequest { /// * Path: /auth/token/renew /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#renew-a-token +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/token/renew", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -188,7 +188,7 @@ pub struct RenewTokenRequest { /// * Path: /auth/token/renew-self /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#renew-a-token-self +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = " /auth/token/renew-self", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -202,7 +202,7 @@ pub struct RenewTokenSelfRequest { /// * Path: /auth/token/renew-accessor /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#renew-a-token-self +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = " /auth/token/renew-accessor", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -217,7 +217,7 @@ pub struct RenewTokenAccessorRequest { /// * Path: /auth/token/revoke /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#revoke-a-token +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/token/revoke", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -231,7 +231,7 @@ pub struct RevokeTokenRequest { /// * Path: /auth/token/revoke-self /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#revoke-a-token-self +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = " /auth/token/revoke-self", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -243,7 +243,7 @@ pub struct RevokeTokenSelfRequest {} /// * Path: /auth/token/revoke-accessor /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#revoke-a-token-accessor +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/token/revoke-accessor", @@ -261,7 +261,7 @@ pub struct RevokeTokenAccessorRequest { /// * Path: /auth/token/revoke-orphan /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#revoke-token-and-orphan-children +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/token/revoke-orphan", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -275,7 +275,7 @@ pub struct RevokeTokenOrphanRequest { /// * Path: /auth/token/roles/{self.role_name} /// * Method: GET /// * Response: [ReadTokenRoleResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#read-token-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/token/roles/{self.role_name}", @@ -294,7 +294,7 @@ pub struct ReadTokenRoleRequest { /// * Path: /auth/token/roles /// * Method: GET /// * Response: [ListTokenRolesResponse] -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#list-token-roles +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/token/roles", @@ -311,7 +311,7 @@ pub struct ListTokenRolesRequest {} /// * Path: /auth/token/roles/:role_name /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#create-update-token-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/token/roles/{self.role_name}", @@ -342,7 +342,7 @@ pub struct SetTokenRoleRequest { /// * Path: /auth/token/roles/{self.role_name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#delete-token-role +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "/auth/token/roles/{self.role_name}", @@ -362,7 +362,7 @@ pub struct DeleteTokenRoleRequest { /// * Path: /auth/token/tidy /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/auth/token#tidy-tokens +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "/auth/token/tidy", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] diff --git a/src/api/transit/requests.rs b/src/api/transit/requests.rs index b43bcba..76a19a8 100644 --- a/src/api/transit/requests.rs +++ b/src/api/transit/requests.rs @@ -16,7 +16,7 @@ use std::fmt::Debug; /// * Path: {self.mount}/keys/{self.name} /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#create-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint, Serialize)] #[endpoint( path = "{self.mount}/keys/{self.name}", @@ -64,7 +64,7 @@ pub struct CreateKeyRequest { /// * Path: {self.mount}/keys/{self.name} /// * Method: GET /// * Response: ReadKeyResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#read-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/keys/{self.name}", @@ -86,7 +86,7 @@ pub struct ReadKeyRequest { /// * Path: {self.mount}/keys /// * Method: LIST /// * Response: ListKeysResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#list-keys +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/keys", @@ -107,7 +107,7 @@ pub struct ListKeysRequest { /// * Path: {self.mount}/keys/{self.name}/config /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#update-key-configuration +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/keys/{self.name}/config", @@ -156,7 +156,7 @@ pub struct UpdateKeyConfigurationRequest { /// * Path: {self.mount}/keys/{self.name} /// * Method: DELETE /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#delete-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/keys/{self.name}", @@ -181,7 +181,7 @@ pub struct DeleteKeyRequest { /// * Path: {self.mount}/keys/{self.name}/rotate /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#rotate-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/keys/{self.name}/rotate", @@ -207,7 +207,7 @@ pub struct RotateKeyRequest { /// * Path: {self.mount}/export/{self.key_type}/{self.name}(/{self.version}) /// * Method: GET /// * Response: ExportKeyResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#export-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/export/{self.key_type}/{self.name}{self.version}", @@ -286,7 +286,7 @@ impl std::fmt::Display for ExportVersion { /// * Path: {self.mount}/encrypt/{self.name} /// * Method: POST /// * Response: EncryptDataResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#encrypt-data +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/encrypt/{self.name}", @@ -343,7 +343,7 @@ pub struct EncryptDataRequest { /// * Path: {self.mount}/decrypt/{self.name} /// * Method: POST /// * Response: DecryptDataResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#decrypt-data +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/decrypt/{self.name}", @@ -377,7 +377,7 @@ pub struct DecryptDataRequest { /// * Path: {self.mount}/rewrap/{self.name} /// * Method: POST /// * Response: RewrapDataResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#rewrap-data +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/rewrap/{self.name}", @@ -418,7 +418,7 @@ pub struct RewrapDataRequest { /// * Path: {self.mount}/datakey/{self.key_type}/{self.name} /// * Method: POST /// * Response: GenerateDataKeyResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#generate-data-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/datakey/{self.key_type}/{self.name}", @@ -481,7 +481,7 @@ impl std::fmt::Display for DataKeyType { /// * Path: {self.mount}/random(/{self.source})(/{self.bytes}) /// * Method: POST /// * Response: GenerateRandomBytesResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#generate-random-bytes +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/random", @@ -526,7 +526,7 @@ impl Default for RandomBytesSource { /// * Path: {self.mount}/hash(/{self.algorithm) /// * Method: POST /// * Response: HashDataResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#hash-data +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/hash", @@ -556,7 +556,7 @@ pub struct HashDataRequest { /// * Path: {self.mount}/hmac/{self.name}(/{self.algorithm) /// * Method: POST /// * Response: GenerateHmacResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#generate-hmac +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/hmac/{self.name}", @@ -588,7 +588,7 @@ pub struct GenerateHmacRequest { /// * Path: {self.mount}/sign/{self.name}(/{self.hash_algorithm) /// * Method: POST /// * Response: SignDataResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#sign-data +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/sign/{self.name}", @@ -635,7 +635,7 @@ pub struct SignDataRequest { /// * Path: {self.mount}/verify/{self.name}(/{self.hash_algorithm) /// * Method: POST /// * Response: VerifySignedDataResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#verify-signed-data +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/verify/{self.name}", @@ -683,7 +683,7 @@ pub struct VerifySignedDataRequest { /// * Path: {self.mount}/backup/{self.name} /// * Method: GET /// * Response: BackupKeyResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#backup-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/backup/{self.name}", @@ -706,7 +706,7 @@ pub struct BackupKeyRequest { /// * Path: {self.mount}/restore(/{self.name}) /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#restore-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/restore", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -730,7 +730,7 @@ pub struct RestoreKeyRequest { /// * Path: {self.mount}/keys/{self.name}/trim /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#trim-key +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/keys/{self.name}/trim", @@ -760,7 +760,7 @@ pub struct TrimKeyRequest { /// * Path: {self.mount}/transit/cache-config /// * Method: POST /// * Response: N/A -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#configure-cache +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint(path = "{self.mount}/cache-config", method = "POST", builder = "true")] #[builder(setter(into, strip_option), default)] @@ -780,7 +780,7 @@ pub struct ConfigureCacheRequest { /// * Path: {self.mount}/transit/cache-config /// * Method: GET /// * Response: ReadTransitCacheConfigurationResponse -/// * Reference: https://www.vaultproject.io/api-docs/secret/transit#read-transit-cache-configuration +/// * Reference: #[derive(Builder, Debug, Default, Endpoint)] #[endpoint( path = "{self.mount}/cache-config", diff --git a/src/api/transit/responses.rs b/src/api/transit/responses.rs index 23b39ca..446cb58 100644 --- a/src/api/transit/responses.rs +++ b/src/api/transit/responses.rs @@ -68,7 +68,7 @@ pub struct GenerateDataKeyResponse { } /// Response from executing -/// [RandomBytesRequest][crate::api::transit::requests::RandomBytesRequest] +/// [GenerateRandomBytesRequest][crate::api::transit::requests::GenerateRandomBytesRequest] #[derive(Debug, Serialize, Deserialize)] pub struct GenerateRandomBytesResponse { pub random_bytes: String, diff --git a/src/auth/kubernetes.rs b/src/auth/kubernetes.rs index 723f8b1..e12fb8a 100644 --- a/src/auth/kubernetes.rs +++ b/src/auth/kubernetes.rs @@ -107,7 +107,7 @@ pub mod role { /// Creates a Kubernetes role. /// - /// See [SetAppRoleRequest] + /// See [CreateKubernetesRoleRequest] #[instrument(skip(client, opts), err)] pub async fn create( client: &impl Client, diff --git a/src/identity/entity_alias.rs b/src/identity/entity_alias.rs index c54edc5..697aecb 100644 --- a/src/identity/entity_alias.rs +++ b/src/identity/entity_alias.rs @@ -69,9 +69,9 @@ pub async fn read_by_id( api::exec_with_result(client, endpoint).await } -/// Update entity by `id`. +/// Update entity_alias by `id`. /// -/// See [UpdateEntityByIdRequest] +/// See [UpdateEntityAliasByIdRequest] #[instrument(skip(client, opts), err)] pub async fn update_by_id( client: &impl Client, @@ -95,9 +95,9 @@ pub async fn delete_by_id(client: &impl Client, id: &str) -> Result<(), ClientEr api::exec_with_empty(client, endpoint).await } -/// List entities by ID. +/// List entity aliases by ID. /// -/// See [ListEntityAliasByIdRequest] +/// See [ListEntityAliasesByIdRequest] #[instrument(skip(client), err)] pub async fn list_by_id( client: &impl Client, diff --git a/src/identity/group_alias.rs b/src/identity/group_alias.rs index 4c526ff..19b73f6 100644 --- a/src/identity/group_alias.rs +++ b/src/identity/group_alias.rs @@ -60,9 +60,9 @@ pub async fn read_by_id( api::exec_with_result(client, endpoint).await } -/// Update group by `id`. +/// Update group alias by `id`. /// -/// See [UpdateGroupByIdRequest] +/// See [UpdateGroupAliasByIdRequest] #[instrument(skip(client, opts), err)] pub async fn update_by_id( client: &impl Client, @@ -92,9 +92,9 @@ pub async fn delete_by_id(client: &impl Client, id: &str) -> Result<(), ClientEr api::exec_with_empty(client, endpoint).await } -/// List groups by ID. +/// List groups aliases by ID. /// -/// See [ListGroupAliasByIdRequest] +/// See [ListGroupAliasesByIdRequest] #[instrument(skip(client), err)] pub async fn list_by_id(client: &impl Client) -> Result { let endpoint = ListGroupAliasesByIdRequest::builder().build().unwrap(); diff --git a/src/kv1.rs b/src/kv1.rs index 36a160b..dbca1f3 100644 --- a/src/kv1.rs +++ b/src/kv1.rs @@ -17,8 +17,8 @@ use std::collections::HashMap; /// Sets the value of the secret at the given path /// -/// A key called ttl will trigger some special behavior. See the [Vault KV secrets engine documentation][https://www.vaultproject.io/docs/secrets/kv] for details. -/// See [SetSecretRequest] +/// A key called ttl will trigger some special behavior. See the [Vault KV secrets engine documentation][] for details. +/// See [SetSecretRequest][crate::api::kv1::requests::SetSecretRequest] #[instrument(skip(client, data), err)] pub async fn set( client: &impl Client, diff --git a/src/lib.rs b/src/lib.rs index 188a34d..8db12c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,196 +1,5 @@ -//! # vaultrs -//! -//! > An asynchronous Rust client library for the [Hashicorp Vault][1] API -//! -//! The following backends are currently supported: -//! -//! * Auth -//! * [AppleRole](https://www.vaultproject.io/docs/auth/approle) -//! * [AWS](https://www.vaultproject.io/docs/auth/aws) -//! * [JWT/OIDC](https://www.vaultproject.io/api-docs/auth/jwt) -//! * [Token](https://www.vaultproject.io/docs/auth/token) -//! * [Userpass](https://www.vaultproject.io/docs/auth/userpass) -//! * Secrets -//! * [Databases](https://www.vaultproject.io/api-docs/secret/databases) -//! * [KV v2](https://www.vaultproject.io/docs/secrets/kv/kv-v2) -//! * [PKI](https://www.vaultproject.io/docs/secrets/pki) -//! * [SSH](https://www.vaultproject.io/docs/secrets/ssh) -//! * [Transit](https://www.vaultproject.io/api-docs/secret/transit) -//! * Sys -//! * [Health](https://www.vaultproject.io/api-docs/system/health) -//! * [Policies](https://www.vaultproject.io/api-docs/system/policy) -//! * [Sealing](https://www.vaultproject.io/api-docs/system/seal) -//! * [Wrapping](https://www.vaultproject.io/docs/concepts/response-wrapping) -//! -//! See something missing? -//! [Open an issue](https://github.com/jmgilman/vaultrs/issues/new). -//! -//! ## Installation -//! -//! Add vaultrs as a dependency to your cargo.toml: -//! ```toml -//! [dependencies] -//! vaultrs = "0.7.0" -//! ``` -//! -//! ## Usage -//! -//! ### Basic -//! -//! The client is used to configure the connection to Vault and is required to -//! be passed to all API calls for execution. Behind the scenes it uses an -//! asynchronous client from [Reqwest](https://docs.rs/reqwest/) for -//! communicating to Vault. -//! -//! ```rust -//! use vaultrs::client::{Client, VaultClient, VaultClientSettingsBuilder}; -//! -//! // Create a client -//! let mut client = VaultClient::new( -//! VaultClientSettingsBuilder::default() -//! .address("https://127.0.0.1:8200") -//! .token("TOKEN") -//! .build() -//! .unwrap() -//! ).unwrap(); -//! -//! ``` -//! -//! ### Secrets -//! -//! The library currently supports all operations available for version 2 of the -//! key/value store. -//! -//! ```should_panic -//! use serde::{Deserialize, Serialize}; -//! use vaultrs::kv2; -//! # use vaultrs::client::{VaultClient, VaultClientSettingsBuilder}; -//! -//! # let client = VaultClient::new( -//! # VaultClientSettingsBuilder::default() -//! # .address("https://127.0.0.1:8200") -//! # .token("TOKEN") -//! # .build() -//! # .unwrap() -//! # ).unwrap(); -//! # -//! // Create and read secrets -//! #[derive(Debug, Deserialize, Serialize)] -//! struct MySecret { -//! key: String, -//! password: String, -//! } -//! -//! let secret = MySecret { -//! key: "super".to_string(), -//! password: "secret".to_string(), -//! }; -//! # tokio_test::block_on(async { -//! kv2::set( -//! &client, -//! "secret", -//! "mysecret", -//! &secret, -//! ).await; -//! -//! let secret: MySecret = kv2::read(&client, "secret", "mysecret").await.unwrap(); -//! println!("{}", secret.password) // "secret" -//! # }) -//! ``` -//! -//! ### PKI -//! -//! The library currently supports all operations available for the PKI secrets -//! engine. -//! -//! ```should_panic -//! use vaultrs::api::pki::requests::GenerateCertificateRequest; -//! # use vaultrs::client::{VaultClient, VaultClientSettingsBuilder}; -//! use vaultrs::pki::cert; -//! -//! # let client = VaultClient::new( -//! # VaultClientSettingsBuilder::default() -//! # .address("https://127.0.0.1:8200") -//! # .token("TOKEN") -//! # .build() -//! # .unwrap() -//! # ).unwrap(); -//! # -//! # tokio_test::block_on(async { -//! // Generate a certificate using the PKI backend -//! let cert = cert::generate( -//! &client, -//! "pki", -//! "my_role", -//! Some(GenerateCertificateRequest::builder().common_name("test.com")), -//! ).await.unwrap(); -//! println!("{}", cert.certificate) // "{PEM encoded certificate}" -//! # }) -//! ``` -//! -//! ### Wrapping -//! -//! All requests implement the ability to be -//! [wrapped](https://www.vaultproject.io/docs/concepts/response-wrapping). These -//! can be passed in your application internally before being unwrapped. -//! -//! ```should_panic -//! use vaultrs::api::ResponseWrapper; -//! use vaultrs::api::sys::requests::ListMountsRequest; -//! # use vaultrs::client::{VaultClient, VaultClientSettingsBuilder}; -//! -//! # let client = VaultClient::new( -//! # VaultClientSettingsBuilder::default() -//! # .address("https://127.0.0.1:8200") -//! # .token("TOKEN") -//! # .build() -//! # .unwrap() -//! # ).unwrap(); -//! # -//! # tokio_test::block_on(async { -//! let endpoint = ListMountsRequest::builder().build().unwrap(); -//! let wrap_resp = endpoint.wrap(&client).await; // Wrapped response -//! assert!(wrap_resp.is_ok()); -//! -//! let wrap_resp = wrap_resp.unwrap(); // Unwrap Result<> -//! let info = wrap_resp.lookup(&client).await; // Check status of this wrapped response -//! assert!(info.is_ok()); -//! -//! let unwrap_resp = wrap_resp.unwrap(&client).await; // Unwrap the response -//! assert!(unwrap_resp.is_ok()); -//! -//! let info = wrap_resp.lookup(&client).await; // Error: response already unwrapped -//! assert!(info.is_err()); -//! # }) -//! ``` -//! -//! ## Error Handling -//! -//! All errors generated by this crate are wrapped in the `ClientError` enum -//! provided by the crate. API warnings are automatically captured via `log` and -//! API errors are captured and returned as their own variant. Connection -//! related errors from `rusify` are wrapped and returned as a single variant. -//! -//! ## Testing -//! -//! See the the [tests](tests) directory for tests. Run tests with `cargo test`. -//! -//! **Note**: All tests rely on bringing up a local Vault development server -//! using Docker. In order to run tests Docker must be running locally (Docker -//! Desktop works). -//! -//! ## Contributing -//! -//! 1. Fork it (https://github.com/jmgilman/vaultrs/fork) -//! 2. Create your feature branch (git checkout -b feature/fooBar) -//! 3. Commit your changes (git commit -am 'Add some fooBar') -//! 4. Push to the branch (git push origin feature/fooBar) -//! 5. Create a new Pull Request -//! -//! See [CONTRIBUTING](CONTRIBUTING.md) for extensive documentation on the -//! architecture of this library and how to add additional functionality to it. -//! -//! [1]: https://www.vaultproject.io/ +#![doc = include_str!("../README.md")] + #[macro_use] extern crate derive_builder; #[macro_use] diff --git a/tests/aws.rs b/tests/aws.rs index a007cbd..6241c2d 100644 --- a/tests/aws.rs +++ b/tests/aws.rs @@ -3,7 +3,8 @@ extern crate tracing; mod common; -use common::{LocalStackServer, VaultServer, VaultServerHelper}; +use common::{VaultServer, VaultServerHelper}; +use dockertest_server::servers::cloud::localstack::LocalStackServer; use test_log::test; use vaultrs::client::Client; use vaultrs::error::ClientError; @@ -306,7 +307,7 @@ mod config { let res = res.unwrap(); assert_eq!(res.safety_buffer, 86400); - assert_eq!(res.disable_periodic_tidy, true); + assert!(res.disable_periodic_tidy); } pub async fn test_delete(client: &impl Client, endpoint: &AwsAuthEndpoint) { let res = @@ -343,7 +344,7 @@ mod config { let res = res.unwrap(); assert_eq!(res.safety_buffer, 86400); - assert_eq!(res.disable_periodic_tidy, false); + assert!(!res.disable_periodic_tidy); } pub async fn test_delete(client: &impl Client, endpoint: &AwsAuthEndpoint) { @@ -456,7 +457,7 @@ mod identity_access_list { let res = aws::identity_access_list::list(client, &endpoint.path).await; assert!(match res { // vault returns 404 instead of empty list - // https://github.com/hashicorp/vault/issues/1365 + // Err(ClientError::APIError { code, errors: _ }) => code == 404, _ => false, }) @@ -666,8 +667,8 @@ pub mod secretengine { let data = res.unwrap(); assert!(data.access_key.starts_with("ASIA")); - assert!(data.secret_key.len() > 0); - assert!(data.security_token.unwrap().len() > 0); + assert!(!data.secret_key.is_empty()); + assert!(!data.security_token.unwrap().is_empty()); } pub async fn test_credentials_sts( @@ -686,8 +687,8 @@ pub mod secretengine { let data = res.unwrap(); assert!(data.access_key.starts_with("ASIA")); - assert!(data.secret_key.len() > 0); - assert!(data.security_token.unwrap().len() > 0); + assert!(!data.secret_key.is_empty()); + assert!(!data.security_token.unwrap().is_empty()); } pub async fn test_delete(client: &impl Client, endpoint: &AwsSecretEngineEndpoint) { diff --git a/tests/client.rs b/tests/client.rs index e5f39db..8614cc3 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -60,20 +60,20 @@ fn build_client() -> VaultClient { #[test] #[serial_test::serial] fn test_should_verify_tls() { - for value in vec!["", "1", "t", "T", "true", "True", "TRUE"] { + for value in ["", "1", "t", "T", "true", "True", "TRUE"] { env::set_var(VAULT_SKIP_VERIFY, value); let client = build_client(); - assert_eq!(client.settings.verify, true); + assert!(client.settings.verify); } } #[test] #[serial_test::serial] fn test_should_not_verify_tls() { - for value in vec!["0", "f", "F", "false", "False", "FALSE"] { + for value in ["0", "f", "F", "false", "False", "FALSE"] { env::set_var(VAULT_SKIP_VERIFY, value); let client = build_client(); - assert_eq!(client.settings.verify, false); + assert!(!client.settings.verify); } } @@ -82,5 +82,5 @@ fn test_should_not_verify_tls() { fn test_should_verify_tls_if_variable_is_not_set() { env::remove_var(VAULT_SKIP_VERIFY); let client = build_client(); - assert_eq!(client.settings.verify, true); + assert!(client.settings.verify); } diff --git a/tests/common.rs b/tests/common.rs index 9495112..512125c 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -1,6 +1,6 @@ use async_trait::async_trait; -pub use dockertest_server::servers::cloud::localstack::{LocalStackServer, LocalStackServerConfig}; -pub use dockertest_server::servers::database::postgres::{PostgresServer, PostgresServerConfig}; +pub use dockertest_server::servers::cloud::localstack::LocalStackServerConfig; +pub use dockertest_server::servers::database::postgres::PostgresServerConfig; pub use dockertest_server::servers::hashi::{VaultServer, VaultServerConfig}; use dockertest_server::servers::webserver::nginx::{ ManagedContent, NginxServerConfig, WebserverContent, diff --git a/tests/database.rs b/tests/database.rs index 4e02991..107f446 100644 --- a/tests/database.rs +++ b/tests/database.rs @@ -3,7 +3,8 @@ extern crate tracing; mod common; -use common::{PostgresServer, VaultServer, VaultServerHelper}; +use common::{VaultServer, VaultServerHelper}; +use dockertest_server::servers::database::postgres::PostgresServer; use test_log::test; use vaultrs::api::database::requests::PostgreSQLConnectionRequest; use vaultrs::client::Client; diff --git a/tests/kv1.rs b/tests/kv1.rs index aa33174..3b4c98f 100644 --- a/tests/kv1.rs +++ b/tests/kv1.rs @@ -24,13 +24,13 @@ fn test_kv1() { // Create test secrets let expected_secret = HashMap::from([("key1", "value1"), ("key2", "value2")]); - kv1::set(&client, mount, &secret_path, &expected_secret) + kv1::set(&client, mount, secret_path, &expected_secret) .await .unwrap(); // Read it let read_secret: HashMap = - kv1::get(&client, &mount, &secret_path).await.unwrap(); + kv1::get(&client, mount, secret_path).await.unwrap(); println!("{:?}", read_secret); @@ -45,7 +45,7 @@ fn test_kv1() { // Read it as raw value let read_secret_raw: GetSecretResponse = - kv1::get_raw(&client, &mount, &secret_path).await.unwrap(); + kv1::get_raw(&client, mount, secret_path).await.unwrap(); println!("{:?}", read_secret_raw); @@ -59,16 +59,16 @@ fn test_kv1() { ); // List secret keys - let list_secret = kv1::list(&client, &mount, "mysecret").await.unwrap(); + let list_secret = kv1::list(&client, mount, "mysecret").await.unwrap(); println!("{:?}", list_secret); assert_eq!(list_secret.data.keys, vec!["foo"]); // Delete secret and read again and expect 404 to check deletion - kv1::delete(&client, &mount, &secret_path).await.unwrap(); + kv1::delete(&client, mount, secret_path).await.unwrap(); - let r = kv1::get_raw(&client, &mount, &secret_path).await; + let r = kv1::get_raw(&client, mount, secret_path).await; match r.expect_err(&format!( "Expected error when reading {} after delete.", @@ -89,14 +89,14 @@ fn test_kv1() { .unwrap(); let read_secrets: HashMap = - kv1::get(&client, &mount, "my/secrets").await.unwrap(); + kv1::get(&client, mount, "my/secrets").await.unwrap(); println!("{:}", read_secrets.get("key1").unwrap()); // value1 - let list_secret = kv1::list(&client, &mount, "my").await.unwrap(); + let list_secret = kv1::list(&client, mount, "my").await.unwrap(); println!("{:?}", list_secret.data.keys); // [ "secrets" ] - kv1::delete(&client, &mount, "my/secrets").await.unwrap(); + kv1::delete(&client, mount, "my/secrets").await.unwrap(); }); } diff --git a/vaultrs-login/Cargo.toml b/vaultrs-login/Cargo.toml index a9b9b9d..08ddc4c 100644 --- a/vaultrs-login/Cargo.toml +++ b/vaultrs-login/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vaultrs-login" -version = "0.1.7" +version = "0.2.0" authors = ["Joshua Gilman "] description = "Adds login support for Vault clients from vaultrs." license = "MIT" @@ -31,7 +31,7 @@ tiny_http = { version = "0.12.0", optional = true } tokio = { version = "1.26.0", optional = true } tracing = "0.1.37" url = "2.3.1" -vaultrs = { version = "0.7.0", path = ".." } +vaultrs = { version = "0.7.1", path = ".." } [dev-dependencies] reqwest = "0.11.15" diff --git a/vaultrs-login/README.md b/vaultrs-login/README.md index 7ae6bc6..1258349 100644 --- a/vaultrs-login/README.md +++ b/vaultrs-login/README.md @@ -8,7 +8,7 @@ Add `vaultrs-login` as a dependency to your cargo.toml: ```toml [dependencies] -vaultrs-login = "0.1.6" +vaultrs-login = "0.2.0" ``` ## Usage diff --git a/vaultrs-login/src/engines/oidc.rs b/vaultrs-login/src/engines/oidc.rs index 4ec76a7..2c5c508 100644 --- a/vaultrs-login/src/engines/oidc.rs +++ b/vaultrs-login/src/engines/oidc.rs @@ -53,7 +53,7 @@ impl MultiLoginMethod for OIDCLogin { client: &impl Client, mount: &str, ) -> Result { - // The Vault CLI uses http://localhost:8250/oidc/callback by default, so + // The Vault CLI uses // we match that here to try and remain consistent let port = self.port.unwrap_or(8250); let ip = "127.0.0.1"; diff --git a/vaultrs-login/src/lib.rs b/vaultrs-login/src/lib.rs index e0b32c3..4195229 100644 --- a/vaultrs-login/src/lib.rs +++ b/vaultrs-login/src/lib.rs @@ -6,9 +6,9 @@ //! //! Add `vaultrs-login` as a dependency to your cargo.toml: //! -//! ```ignore +//! ```toml //! [dependencies] -//! vaultrs-login = "0.1.5" +//! vaultrs-login = "0.2.0" //! ``` //! //! ## Usage @@ -85,7 +85,7 @@ pub trait LoginClient: Client + Sized { /// Performs a login using the given method and sets the resulting token to /// this client. #[instrument(skip(self, method), err)] - /// Workaround until https://github.com/tokio-rs/tracing/issues/2876 is fixed + /// Workaround until #[allow(clippy::blocks_in_conditions)] async fn login( &mut self, @@ -101,7 +101,7 @@ pub trait LoginClient: Client + Sized { /// callback which must be passed back to the client to finish the login /// flow. #[instrument(skip(self, method), err)] - /// Workaround until https://github.com/tokio-rs/tracing/issues/2876 is fixed + /// Workaround until #[allow(clippy::blocks_in_conditions)] async fn login_multi( &self, @@ -114,7 +114,7 @@ pub trait LoginClient: Client + Sized { /// Performs the second step of a multi-step login and sets the resulting /// token to this client. #[instrument(skip(self, callback), err)] - /// Workaround until https://github.com/tokio-rs/tracing/issues/2876 is fixed + /// Workaround until #[allow(clippy::blocks_in_conditions)] async fn login_multi_callback( &mut self, diff --git a/vaultrs-login/tests/login.rs b/vaultrs-login/tests/login.rs index 7912640..ba4e427 100644 --- a/vaultrs-login/tests/login.rs +++ b/vaultrs-login/tests/login.rs @@ -21,9 +21,9 @@ use vaultrs_login::LoginClient; fn test() { let test = common::new_test(); test.run(|instance| async move { - let oidc_server: OIDCServer = instance.server(); + let _oidc_server: OIDCServer = instance.server(); let vault_server: VaultServer = instance.server(); - let localstack_server: LocalStackServer = instance.server(); + let _localstack_server: LocalStackServer = instance.server(); let client = vault_server.client(); // Mounts @@ -53,10 +53,10 @@ fn test() { test_userpass(&mut vault_server.client()).await; #[cfg(feature = "oidc")] - test_oidc(&oidc_server, &vault_server, &mut vault_server.client()).await; + test_oidc(&_oidc_server, &vault_server, &mut vault_server.client()).await; #[cfg(feature = "aws")] - test_aws(&localstack_server, &mut vault_server.client()).await; + test_aws(&_localstack_server, &mut vault_server.client()).await; }); }