#[non_exhaustive]pub struct Secret {
pub kms_key_name: String,
pub secret_env: HashMap<String, Bytes>,
/* private fields */
}Expand description
Pairs a set of secret environment variables containing encrypted
values with the Cloud KMS key to use to decrypt the value.
Note: Use kmsKeyName with available_secrets instead of using
kmsKeyName with secret. For instructions see:
https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kms_key_name: StringCloud KMS key name to use to decrypt these envs.
secret_env: HashMap<String, Bytes>Map of environment variable name to its encrypted value.
Secret environment variables must be unique across all of a build’s secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build’s secrets.
Implementations§
Source§impl Secret
impl Secret
pub fn new() -> Self
Sourcepub fn set_kms_key_name<T: Into<String>>(self, v: T) -> Self
pub fn set_kms_key_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_secret_env<T, K, V>(self, v: T) -> Self
pub fn set_secret_env<T, K, V>(self, v: T) -> Self
Sets the value of secret_env.
§Example
ⓘ
let x = Secret::new().set_secret_env([
("key0", bytes::Bytes::from_static(b"abc")),
("key1", bytes::Bytes::from_static(b"xyz")),
]);Trait Implementations§
impl StructuralPartialEq for Secret
Auto Trait Implementations§
impl Freeze for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnwindSafe for Secret
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more