Skip to content

Commit 9ecdacc

Browse files
Google APIscopybara-github
authored andcommitted
feat: added expire_time and ttl fields to Secret
PiperOrigin-RevId: 352563582
1 parent 61ab034 commit 9ecdacc

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

google/cloud/secretmanager/v1/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ proto_library(
2222
"//google/api:resource_proto",
2323
"//google/iam/v1:iam_policy_proto",
2424
"//google/iam/v1:policy_proto",
25+
"@com_google_protobuf//:duration_proto",
2526
"@com_google_protobuf//:empty_proto",
2627
"@com_google_protobuf//:field_mask_proto",
2728
"@com_google_protobuf//:timestamp_proto",

google/cloud/secretmanager/v1/resources.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package google.cloud.secretmanager.v1;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
21+
import "google/protobuf/duration.proto";
2122
import "google/protobuf/timestamp.proto";
2223
import "google/api/annotations.proto";
2324

@@ -68,6 +69,23 @@ message Secret {
6869
//
6970
// No more than 64 labels can be assigned to a given resource.
7071
map<string, string> labels = 4;
72+
73+
// Expiration policy attached to the [Secret][google.cloud.secretmanager.v1.Secret]. If specified the [Secret][google.cloud.secretmanager.v1.Secret]
74+
// and all [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] will be automatically deleted at
75+
// expiration. Expired secrets are irreversibly deleted.
76+
//
77+
// Expiration is *not* the recommended way to set time-based permissions. [IAM
78+
// Conditions](https://cloud.google.com/secret-manager/docs/access-control#conditions)
79+
// is recommended for granting time-based permissions because the operation
80+
// can be reversed.
81+
oneof expiration {
82+
// Optional. Timestamp in UTC when the [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. This is
83+
// always provided on output, regardless of what was sent on input.
84+
google.protobuf.Timestamp expire_time = 6 [(google.api.field_behavior) = OPTIONAL];
85+
86+
// Input only. The TTL for the [Secret][google.cloud.secretmanager.v1.Secret].
87+
google.protobuf.Duration ttl = 7 [(google.api.field_behavior) = INPUT_ONLY];
88+
}
7189
}
7290

7391
// A secret version resource in the Secret Manager API.

0 commit comments

Comments
 (0)