pub struct KeyEnv { /* private fields */ }Expand description
KeyEnv API client.
Implementations§
Source§impl KeyEnv
impl KeyEnv
Sourcepub fn builder() -> KeyEnvBuilder
pub fn builder() -> KeyEnvBuilder
Create a new builder for the KeyEnv client.
Sourcepub async fn clear_cache(
&self,
project_id: Option<&str>,
environment: Option<&str>,
)
pub async fn clear_cache( &self, project_id: Option<&str>, environment: Option<&str>, )
Clear cache for a specific project/environment.
Sourcepub async fn clear_all_cache(&self)
pub async fn clear_all_cache(&self)
Clear all cached data.
Sourcepub async fn get_current_user(&self) -> Result<CurrentUserResponse>
pub async fn get_current_user(&self) -> Result<CurrentUserResponse>
Get current user or service token information.
Sourcepub async fn validate_token(&self) -> Result<CurrentUserResponse>
pub async fn validate_token(&self) -> Result<CurrentUserResponse>
Validate the token and return user info.
Sourcepub async fn list_projects(&self) -> Result<Vec<Project>>
pub async fn list_projects(&self) -> Result<Vec<Project>>
List all accessible projects.
Sourcepub async fn get_project(&self, project_id: &str) -> Result<Project>
pub async fn get_project(&self, project_id: &str) -> Result<Project>
Get a project by ID.
Sourcepub async fn create_project(&self, team_id: &str, name: &str) -> Result<Project>
pub async fn create_project(&self, team_id: &str, name: &str) -> Result<Project>
Create a new project.
Sourcepub async fn delete_project(&self, project_id: &str) -> Result<()>
pub async fn delete_project(&self, project_id: &str) -> Result<()>
Delete a project.
Sourcepub async fn list_environments(
&self,
project_id: &str,
) -> Result<Vec<Environment>>
pub async fn list_environments( &self, project_id: &str, ) -> Result<Vec<Environment>>
List environments in a project.
Sourcepub async fn create_environment(
&self,
project_id: &str,
name: &str,
inherits_from: Option<&str>,
) -> Result<Environment>
pub async fn create_environment( &self, project_id: &str, name: &str, inherits_from: Option<&str>, ) -> Result<Environment>
Create a new environment in a project.
Sourcepub async fn delete_environment(
&self,
project_id: &str,
environment: &str,
) -> Result<()>
pub async fn delete_environment( &self, project_id: &str, environment: &str, ) -> Result<()>
Delete an environment from a project.
Sourcepub async fn list_secrets(
&self,
project_id: &str,
environment: &str,
) -> Result<Vec<SecretWithInheritance>>
pub async fn list_secrets( &self, project_id: &str, environment: &str, ) -> Result<Vec<SecretWithInheritance>>
List secrets (without values) in an environment.
Sourcepub async fn export_secrets(
&self,
project_id: &str,
environment: &str,
) -> Result<Vec<SecretWithValueAndInheritance>>
pub async fn export_secrets( &self, project_id: &str, environment: &str, ) -> Result<Vec<SecretWithValueAndInheritance>>
Export secrets with values from an environment.
Sourcepub async fn export_secrets_as_map(
&self,
project_id: &str,
environment: &str,
) -> Result<HashMap<String, String>>
pub async fn export_secrets_as_map( &self, project_id: &str, environment: &str, ) -> Result<HashMap<String, String>>
Export secrets as a HashMap.
Sourcepub async fn get_secret(
&self,
project_id: &str,
environment: &str,
key: &str,
) -> Result<SecretWithValue>
pub async fn get_secret( &self, project_id: &str, environment: &str, key: &str, ) -> Result<SecretWithValue>
Get a single secret by key.
Sourcepub async fn set_secret(
&self,
project_id: &str,
environment: &str,
key: &str,
value: &str,
) -> Result<()>
pub async fn set_secret( &self, project_id: &str, environment: &str, key: &str, value: &str, ) -> Result<()>
Set (create or update) a secret.
Sourcepub async fn set_secret_with_description(
&self,
project_id: &str,
environment: &str,
key: &str,
value: &str,
description: Option<&str>,
) -> Result<()>
pub async fn set_secret_with_description( &self, project_id: &str, environment: &str, key: &str, value: &str, description: Option<&str>, ) -> Result<()>
Set a secret with an optional description.
Sourcepub async fn delete_secret(
&self,
project_id: &str,
environment: &str,
key: &str,
) -> Result<()>
pub async fn delete_secret( &self, project_id: &str, environment: &str, key: &str, ) -> Result<()>
Delete a secret.
Sourcepub async fn bulk_import(
&self,
project_id: &str,
environment: &str,
secrets: Vec<SecretInput>,
options: BulkImportOptions,
) -> Result<BulkImportResult>
pub async fn bulk_import( &self, project_id: &str, environment: &str, secrets: Vec<SecretInput>, options: BulkImportOptions, ) -> Result<BulkImportResult>
Bulk import secrets.
Sourcepub async fn load_env(
&self,
project_id: &str,
environment: &str,
) -> Result<usize>
pub async fn load_env( &self, project_id: &str, environment: &str, ) -> Result<usize>
Load secrets into environment variables. Returns the number of secrets loaded.
Sourcepub async fn generate_env_file(
&self,
project_id: &str,
environment: &str,
) -> Result<String>
pub async fn generate_env_file( &self, project_id: &str, environment: &str, ) -> Result<String>
Generate .env file content.
Sourcepub async fn list_permissions(
&self,
project_id: &str,
environment: &str,
) -> Result<Vec<Permission>>
pub async fn list_permissions( &self, project_id: &str, environment: &str, ) -> Result<Vec<Permission>>
List permissions for an environment.
Sourcepub async fn set_permission(
&self,
project_id: &str,
environment: &str,
user_id: &str,
role: &str,
) -> Result<()>
pub async fn set_permission( &self, project_id: &str, environment: &str, user_id: &str, role: &str, ) -> Result<()>
Set a user’s permission for an environment.
Sourcepub async fn delete_permission(
&self,
project_id: &str,
environment: &str,
user_id: &str,
) -> Result<()>
pub async fn delete_permission( &self, project_id: &str, environment: &str, user_id: &str, ) -> Result<()>
Delete a user’s permission for an environment.
Sourcepub async fn bulk_set_permissions(
&self,
project_id: &str,
environment: &str,
permissions: Vec<PermissionInput>,
) -> Result<()>
pub async fn bulk_set_permissions( &self, project_id: &str, environment: &str, permissions: Vec<PermissionInput>, ) -> Result<()>
Bulk set permissions.
Sourcepub async fn get_my_permissions(
&self,
project_id: &str,
) -> Result<MyPermissionsResponse>
pub async fn get_my_permissions( &self, project_id: &str, ) -> Result<MyPermissionsResponse>
Get the current user’s permissions for a project.
Sourcepub async fn get_project_defaults(
&self,
project_id: &str,
) -> Result<Vec<DefaultPermission>>
pub async fn get_project_defaults( &self, project_id: &str, ) -> Result<Vec<DefaultPermission>>
Get default permissions for a project.
Sourcepub async fn set_project_defaults(
&self,
project_id: &str,
defaults: Vec<DefaultPermission>,
) -> Result<()>
pub async fn set_project_defaults( &self, project_id: &str, defaults: Vec<DefaultPermission>, ) -> Result<()>
Set default permissions for a project.
Sourcepub async fn get_secret_history(
&self,
project_id: &str,
environment: &str,
key: &str,
) -> Result<Vec<SecretHistory>>
pub async fn get_secret_history( &self, project_id: &str, environment: &str, key: &str, ) -> Result<Vec<SecretHistory>>
Get the version history of a secret.