xref: /aosp_15_r20/external/googleapis/google/cloud/secretmanager/v1/resources.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1*d5c09012SAndroid Build Coastguard Worker// Copyright 2024 Google LLC
2*d5c09012SAndroid Build Coastguard Worker//
3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*d5c09012SAndroid Build Coastguard Worker//
7*d5c09012SAndroid Build Coastguard Worker//     http://www.apache.org/licenses/LICENSE-2.0
8*d5c09012SAndroid Build Coastguard Worker//
9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*d5c09012SAndroid Build Coastguard Worker// limitations under the License.
14*d5c09012SAndroid Build Coastguard Worker
15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3";
16*d5c09012SAndroid Build Coastguard Worker
17*d5c09012SAndroid Build Coastguard Workerpackage google.cloud.secretmanager.v1;
18*d5c09012SAndroid Build Coastguard Worker
19*d5c09012SAndroid Build Coastguard Workerimport "google/api/field_behavior.proto";
20*d5c09012SAndroid Build Coastguard Workerimport "google/api/resource.proto";
21*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/duration.proto";
22*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/timestamp.proto";
23*d5c09012SAndroid Build Coastguard Worker
24*d5c09012SAndroid Build Coastguard Workeroption cc_enable_arenas = true;
25*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.SecretManager.V1";
26*d5c09012SAndroid Build Coastguard Workeroption go_package = "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb;secretmanagerpb";
27*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
28*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "ResourcesProto";
29*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.cloud.secretmanager.v1";
30*d5c09012SAndroid Build Coastguard Workeroption objc_class_prefix = "GSM";
31*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\SecretManager\\V1";
32*d5c09012SAndroid Build Coastguard Workeroption ruby_package = "Google::Cloud::SecretManager::V1";
33*d5c09012SAndroid Build Coastguard Worker
34*d5c09012SAndroid Build Coastguard Worker// A [Secret][google.cloud.secretmanager.v1.Secret] is a logical secret whose
35*d5c09012SAndroid Build Coastguard Worker// value and versions can be accessed.
36*d5c09012SAndroid Build Coastguard Worker//
37*d5c09012SAndroid Build Coastguard Worker// A [Secret][google.cloud.secretmanager.v1.Secret] is made up of zero or more
38*d5c09012SAndroid Build Coastguard Worker// [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] that represent
39*d5c09012SAndroid Build Coastguard Worker// the secret data.
40*d5c09012SAndroid Build Coastguard Workermessage Secret {
41*d5c09012SAndroid Build Coastguard Worker  option (google.api.resource) = {
42*d5c09012SAndroid Build Coastguard Worker    type: "secretmanager.googleapis.com/Secret"
43*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/secrets/{secret}"
44*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/locations/{location}/secrets/{secret}"
45*d5c09012SAndroid Build Coastguard Worker    plural: "secrets"
46*d5c09012SAndroid Build Coastguard Worker    singular: "secret"
47*d5c09012SAndroid Build Coastguard Worker  };
48*d5c09012SAndroid Build Coastguard Worker
49*d5c09012SAndroid Build Coastguard Worker  // Output only. The resource name of the
50*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret] in the format
51*d5c09012SAndroid Build Coastguard Worker  // `projects/*/secrets/*`.
52*d5c09012SAndroid Build Coastguard Worker  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
53*d5c09012SAndroid Build Coastguard Worker
54*d5c09012SAndroid Build Coastguard Worker  // Optional. Immutable. The replication policy of the secret data attached to
55*d5c09012SAndroid Build Coastguard Worker  // the [Secret][google.cloud.secretmanager.v1.Secret].
56*d5c09012SAndroid Build Coastguard Worker  //
57*d5c09012SAndroid Build Coastguard Worker  // The replication policy cannot be changed after the Secret has been created.
58*d5c09012SAndroid Build Coastguard Worker  Replication replication = 2 [
59*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = IMMUTABLE,
60*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL
61*d5c09012SAndroid Build Coastguard Worker  ];
62*d5c09012SAndroid Build Coastguard Worker
63*d5c09012SAndroid Build Coastguard Worker  // Output only. The time at which the
64*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret] was created.
65*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Timestamp create_time = 3
66*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OUTPUT_ONLY];
67*d5c09012SAndroid Build Coastguard Worker
68*d5c09012SAndroid Build Coastguard Worker  // The labels assigned to this Secret.
69*d5c09012SAndroid Build Coastguard Worker  //
70*d5c09012SAndroid Build Coastguard Worker  // Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
71*d5c09012SAndroid Build Coastguard Worker  // of maximum 128 bytes, and must conform to the following PCRE regular
72*d5c09012SAndroid Build Coastguard Worker  // expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
73*d5c09012SAndroid Build Coastguard Worker  //
74*d5c09012SAndroid Build Coastguard Worker  // Label values must be between 0 and 63 characters long, have a UTF-8
75*d5c09012SAndroid Build Coastguard Worker  // encoding of maximum 128 bytes, and must conform to the following PCRE
76*d5c09012SAndroid Build Coastguard Worker  // regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
77*d5c09012SAndroid Build Coastguard Worker  //
78*d5c09012SAndroid Build Coastguard Worker  // No more than 64 labels can be assigned to a given resource.
79*d5c09012SAndroid Build Coastguard Worker  map<string, string> labels = 4;
80*d5c09012SAndroid Build Coastguard Worker
81*d5c09012SAndroid Build Coastguard Worker  // Optional. A list of up to 10 Pub/Sub topics to which messages are published
82*d5c09012SAndroid Build Coastguard Worker  // when control plane operations are called on the secret or its versions.
83*d5c09012SAndroid Build Coastguard Worker  repeated Topic topics = 5 [(google.api.field_behavior) = OPTIONAL];
84*d5c09012SAndroid Build Coastguard Worker
85*d5c09012SAndroid Build Coastguard Worker  // Expiration policy attached to the
86*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret]. If specified the
87*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret] and all
88*d5c09012SAndroid Build Coastguard Worker  // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] will be
89*d5c09012SAndroid Build Coastguard Worker  // automatically deleted at expiration. Expired secrets are irreversibly
90*d5c09012SAndroid Build Coastguard Worker  // deleted.
91*d5c09012SAndroid Build Coastguard Worker  //
92*d5c09012SAndroid Build Coastguard Worker  // Expiration is *not* the recommended way to set time-based permissions. [IAM
93*d5c09012SAndroid Build Coastguard Worker  // Conditions](https://cloud.google.com/secret-manager/docs/access-control#conditions)
94*d5c09012SAndroid Build Coastguard Worker  // is recommended for granting time-based permissions because the operation
95*d5c09012SAndroid Build Coastguard Worker  // can be reversed.
96*d5c09012SAndroid Build Coastguard Worker  oneof expiration {
97*d5c09012SAndroid Build Coastguard Worker    // Optional. Timestamp in UTC when the
98*d5c09012SAndroid Build Coastguard Worker    // [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire.
99*d5c09012SAndroid Build Coastguard Worker    // This is always provided on output, regardless of what was sent on input.
100*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Timestamp expire_time = 6
101*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OPTIONAL];
102*d5c09012SAndroid Build Coastguard Worker
103*d5c09012SAndroid Build Coastguard Worker    // Input only. The TTL for the
104*d5c09012SAndroid Build Coastguard Worker    // [Secret][google.cloud.secretmanager.v1.Secret].
105*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Duration ttl = 7 [(google.api.field_behavior) = INPUT_ONLY];
106*d5c09012SAndroid Build Coastguard Worker  }
107*d5c09012SAndroid Build Coastguard Worker
108*d5c09012SAndroid Build Coastguard Worker  // Optional. Etag of the currently stored
109*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret].
110*d5c09012SAndroid Build Coastguard Worker  string etag = 8 [(google.api.field_behavior) = OPTIONAL];
111*d5c09012SAndroid Build Coastguard Worker
112*d5c09012SAndroid Build Coastguard Worker  // Optional. Rotation policy attached to the
113*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is
114*d5c09012SAndroid Build Coastguard Worker  // no rotation policy.
115*d5c09012SAndroid Build Coastguard Worker  Rotation rotation = 9 [(google.api.field_behavior) = OPTIONAL];
116*d5c09012SAndroid Build Coastguard Worker
117*d5c09012SAndroid Build Coastguard Worker  // Optional. Mapping from version alias to version name.
118*d5c09012SAndroid Build Coastguard Worker  //
119*d5c09012SAndroid Build Coastguard Worker  // A version alias is a string with a maximum length of 63 characters and can
120*d5c09012SAndroid Build Coastguard Worker  // contain uppercase and lowercase letters, numerals, and the hyphen (`-`)
121*d5c09012SAndroid Build Coastguard Worker  // and underscore ('_') characters. An alias string must start with a
122*d5c09012SAndroid Build Coastguard Worker  // letter and cannot be the string 'latest' or 'NEW'.
123*d5c09012SAndroid Build Coastguard Worker  // No more than 50 aliases can be assigned to a given secret.
124*d5c09012SAndroid Build Coastguard Worker  //
125*d5c09012SAndroid Build Coastguard Worker  // Version-Alias pairs will be viewable via GetSecret and modifiable via
126*d5c09012SAndroid Build Coastguard Worker  // UpdateSecret. Access by alias is only be supported on
127*d5c09012SAndroid Build Coastguard Worker  // GetSecretVersion and AccessSecretVersion.
128*d5c09012SAndroid Build Coastguard Worker  map<string, int64> version_aliases = 11
129*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
130*d5c09012SAndroid Build Coastguard Worker
131*d5c09012SAndroid Build Coastguard Worker  // Optional. Custom metadata about the secret.
132*d5c09012SAndroid Build Coastguard Worker  //
133*d5c09012SAndroid Build Coastguard Worker  // Annotations are distinct from various forms of labels.
134*d5c09012SAndroid Build Coastguard Worker  // Annotations exist to allow client tools to store their own state
135*d5c09012SAndroid Build Coastguard Worker  // information without requiring a database.
136*d5c09012SAndroid Build Coastguard Worker  //
137*d5c09012SAndroid Build Coastguard Worker  // Annotation keys must be between 1 and 63 characters long, have a UTF-8
138*d5c09012SAndroid Build Coastguard Worker  // encoding of maximum 128 bytes, begin and end with an alphanumeric character
139*d5c09012SAndroid Build Coastguard Worker  // ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and
140*d5c09012SAndroid Build Coastguard Worker  // alphanumerics in between these symbols.
141*d5c09012SAndroid Build Coastguard Worker  //
142*d5c09012SAndroid Build Coastguard Worker  // The total size of annotation keys and values must be less than 16KiB.
143*d5c09012SAndroid Build Coastguard Worker  map<string, string> annotations = 13 [(google.api.field_behavior) = OPTIONAL];
144*d5c09012SAndroid Build Coastguard Worker
145*d5c09012SAndroid Build Coastguard Worker  // Optional. Secret Version TTL after destruction request
146*d5c09012SAndroid Build Coastguard Worker  //
147*d5c09012SAndroid Build Coastguard Worker  // This is a part of the Delayed secret version destroy feature.
148*d5c09012SAndroid Build Coastguard Worker  // For secret with TTL>0, version destruction doesn't happen immediately
149*d5c09012SAndroid Build Coastguard Worker  // on calling destroy instead the version goes to a disabled state and
150*d5c09012SAndroid Build Coastguard Worker  // destruction happens after the TTL expires.
151*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration version_destroy_ttl = 14
152*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
153*d5c09012SAndroid Build Coastguard Worker
154*d5c09012SAndroid Build Coastguard Worker  // Optional. The customer-managed encryption configuration of the Regionalised
155*d5c09012SAndroid Build Coastguard Worker  // Secrets. If no configuration is provided, Google-managed default encryption
156*d5c09012SAndroid Build Coastguard Worker  // is used.
157*d5c09012SAndroid Build Coastguard Worker  //
158*d5c09012SAndroid Build Coastguard Worker  // Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption
159*d5c09012SAndroid Build Coastguard Worker  // configuration only apply to
160*d5c09012SAndroid Build Coastguard Worker  // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added
161*d5c09012SAndroid Build Coastguard Worker  // afterwards. They do not apply retroactively to existing
162*d5c09012SAndroid Build Coastguard Worker  // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
163*d5c09012SAndroid Build Coastguard Worker  CustomerManagedEncryption customer_managed_encryption = 15
164*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
165*d5c09012SAndroid Build Coastguard Worker}
166*d5c09012SAndroid Build Coastguard Worker
167*d5c09012SAndroid Build Coastguard Worker// A secret version resource in the Secret Manager API.
168*d5c09012SAndroid Build Coastguard Workermessage SecretVersion {
169*d5c09012SAndroid Build Coastguard Worker  option (google.api.resource) = {
170*d5c09012SAndroid Build Coastguard Worker    type: "secretmanager.googleapis.com/SecretVersion"
171*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/secrets/{secret}/versions/{secret_version}"
172*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}"
173*d5c09012SAndroid Build Coastguard Worker    plural: "secretVersions"
174*d5c09012SAndroid Build Coastguard Worker    singular: "secretVersion"
175*d5c09012SAndroid Build Coastguard Worker  };
176*d5c09012SAndroid Build Coastguard Worker
177*d5c09012SAndroid Build Coastguard Worker  // The state of a
178*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion], indicating if
179*d5c09012SAndroid Build Coastguard Worker  // it can be accessed.
180*d5c09012SAndroid Build Coastguard Worker  enum State {
181*d5c09012SAndroid Build Coastguard Worker    // Not specified. This value is unused and invalid.
182*d5c09012SAndroid Build Coastguard Worker    STATE_UNSPECIFIED = 0;
183*d5c09012SAndroid Build Coastguard Worker
184*d5c09012SAndroid Build Coastguard Worker    // The [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] may be
185*d5c09012SAndroid Build Coastguard Worker    // accessed.
186*d5c09012SAndroid Build Coastguard Worker    ENABLED = 1;
187*d5c09012SAndroid Build Coastguard Worker
188*d5c09012SAndroid Build Coastguard Worker    // The [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] may not
189*d5c09012SAndroid Build Coastguard Worker    // be accessed, but the secret data is still available and can be placed
190*d5c09012SAndroid Build Coastguard Worker    // back into the
191*d5c09012SAndroid Build Coastguard Worker    // [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED]
192*d5c09012SAndroid Build Coastguard Worker    // state.
193*d5c09012SAndroid Build Coastguard Worker    DISABLED = 2;
194*d5c09012SAndroid Build Coastguard Worker
195*d5c09012SAndroid Build Coastguard Worker    // The [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] is
196*d5c09012SAndroid Build Coastguard Worker    // destroyed and the secret data is no longer stored. A version may not
197*d5c09012SAndroid Build Coastguard Worker    // leave this state once entered.
198*d5c09012SAndroid Build Coastguard Worker    DESTROYED = 3;
199*d5c09012SAndroid Build Coastguard Worker  }
200*d5c09012SAndroid Build Coastguard Worker
201*d5c09012SAndroid Build Coastguard Worker  // Output only. The resource name of the
202*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format
203*d5c09012SAndroid Build Coastguard Worker  // `projects/*/secrets/*/versions/*`.
204*d5c09012SAndroid Build Coastguard Worker  //
205*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] IDs in a
206*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret] start at 1 and are
207*d5c09012SAndroid Build Coastguard Worker  // incremented for each subsequent version of the secret.
208*d5c09012SAndroid Build Coastguard Worker  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
209*d5c09012SAndroid Build Coastguard Worker
210*d5c09012SAndroid Build Coastguard Worker  // Output only. The time at which the
211*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] was created.
212*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Timestamp create_time = 2
213*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OUTPUT_ONLY];
214*d5c09012SAndroid Build Coastguard Worker
215*d5c09012SAndroid Build Coastguard Worker  // Output only. The time this
216*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] was destroyed.
217*d5c09012SAndroid Build Coastguard Worker  // Only present if [state][google.cloud.secretmanager.v1.SecretVersion.state]
218*d5c09012SAndroid Build Coastguard Worker  // is
219*d5c09012SAndroid Build Coastguard Worker  // [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED].
220*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Timestamp destroy_time = 3
221*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OUTPUT_ONLY];
222*d5c09012SAndroid Build Coastguard Worker
223*d5c09012SAndroid Build Coastguard Worker  // Output only. The current state of the
224*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
225*d5c09012SAndroid Build Coastguard Worker  State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
226*d5c09012SAndroid Build Coastguard Worker
227*d5c09012SAndroid Build Coastguard Worker  // The replication status of the
228*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
229*d5c09012SAndroid Build Coastguard Worker  ReplicationStatus replication_status = 5;
230*d5c09012SAndroid Build Coastguard Worker
231*d5c09012SAndroid Build Coastguard Worker  // Output only. Etag of the currently stored
232*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
233*d5c09012SAndroid Build Coastguard Worker  string etag = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
234*d5c09012SAndroid Build Coastguard Worker
235*d5c09012SAndroid Build Coastguard Worker  // Output only. True if payload checksum specified in
236*d5c09012SAndroid Build Coastguard Worker  // [SecretPayload][google.cloud.secretmanager.v1.SecretPayload] object has
237*d5c09012SAndroid Build Coastguard Worker  // been received by
238*d5c09012SAndroid Build Coastguard Worker  // [SecretManagerService][google.cloud.secretmanager.v1.SecretManagerService]
239*d5c09012SAndroid Build Coastguard Worker  // on
240*d5c09012SAndroid Build Coastguard Worker  // [SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion].
241*d5c09012SAndroid Build Coastguard Worker  bool client_specified_payload_checksum = 7
242*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OUTPUT_ONLY];
243*d5c09012SAndroid Build Coastguard Worker
244*d5c09012SAndroid Build Coastguard Worker  // Optional. Output only. Scheduled destroy time for secret version.
245*d5c09012SAndroid Build Coastguard Worker  // This is a part of the Delayed secret version destroy feature. For a
246*d5c09012SAndroid Build Coastguard Worker  // Secret with a valid version destroy TTL, when a secert version is
247*d5c09012SAndroid Build Coastguard Worker  // destroyed, the version is moved to disabled state and it is scheduled for
248*d5c09012SAndroid Build Coastguard Worker  // destruction. The version is destroyed only after the
249*d5c09012SAndroid Build Coastguard Worker  // `scheduled_destroy_time`.
250*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Timestamp scheduled_destroy_time = 8
251*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OUTPUT_ONLY];
252*d5c09012SAndroid Build Coastguard Worker
253*d5c09012SAndroid Build Coastguard Worker  // Output only. The customer-managed encryption status of the
254*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
255*d5c09012SAndroid Build Coastguard Worker  // populated if customer-managed encryption is used and
256*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret] is a Regionalised Secret.
257*d5c09012SAndroid Build Coastguard Worker  CustomerManagedEncryptionStatus customer_managed_encryption = 9
258*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OUTPUT_ONLY];
259*d5c09012SAndroid Build Coastguard Worker}
260*d5c09012SAndroid Build Coastguard Worker
261*d5c09012SAndroid Build Coastguard Worker// A policy that defines the replication and encryption configuration of data.
262*d5c09012SAndroid Build Coastguard Workermessage Replication {
263*d5c09012SAndroid Build Coastguard Worker  // A replication policy that replicates the
264*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret] payload without any
265*d5c09012SAndroid Build Coastguard Worker  // restrictions.
266*d5c09012SAndroid Build Coastguard Worker  message Automatic {
267*d5c09012SAndroid Build Coastguard Worker    // Optional. The customer-managed encryption configuration of the
268*d5c09012SAndroid Build Coastguard Worker    // [Secret][google.cloud.secretmanager.v1.Secret]. If no configuration is
269*d5c09012SAndroid Build Coastguard Worker    // provided, Google-managed default encryption is used.
270*d5c09012SAndroid Build Coastguard Worker    //
271*d5c09012SAndroid Build Coastguard Worker    // Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption
272*d5c09012SAndroid Build Coastguard Worker    // configuration only apply to
273*d5c09012SAndroid Build Coastguard Worker    // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added
274*d5c09012SAndroid Build Coastguard Worker    // afterwards. They do not apply retroactively to existing
275*d5c09012SAndroid Build Coastguard Worker    // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
276*d5c09012SAndroid Build Coastguard Worker    CustomerManagedEncryption customer_managed_encryption = 1
277*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OPTIONAL];
278*d5c09012SAndroid Build Coastguard Worker  }
279*d5c09012SAndroid Build Coastguard Worker
280*d5c09012SAndroid Build Coastguard Worker  // A replication policy that replicates the
281*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret] payload into the locations
282*d5c09012SAndroid Build Coastguard Worker  // specified in [Secret.replication.user_managed.replicas][]
283*d5c09012SAndroid Build Coastguard Worker  message UserManaged {
284*d5c09012SAndroid Build Coastguard Worker    // Represents a Replica for this
285*d5c09012SAndroid Build Coastguard Worker    // [Secret][google.cloud.secretmanager.v1.Secret].
286*d5c09012SAndroid Build Coastguard Worker    message Replica {
287*d5c09012SAndroid Build Coastguard Worker      // The canonical IDs of the location to replicate data.
288*d5c09012SAndroid Build Coastguard Worker      // For example: `"us-east1"`.
289*d5c09012SAndroid Build Coastguard Worker      string location = 1;
290*d5c09012SAndroid Build Coastguard Worker
291*d5c09012SAndroid Build Coastguard Worker      // Optional. The customer-managed encryption configuration of the
292*d5c09012SAndroid Build Coastguard Worker      // [User-Managed Replica][Replication.UserManaged.Replica]. If no
293*d5c09012SAndroid Build Coastguard Worker      // configuration is provided, Google-managed default encryption is used.
294*d5c09012SAndroid Build Coastguard Worker      //
295*d5c09012SAndroid Build Coastguard Worker      // Updates to the [Secret][google.cloud.secretmanager.v1.Secret]
296*d5c09012SAndroid Build Coastguard Worker      // encryption configuration only apply to
297*d5c09012SAndroid Build Coastguard Worker      // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added
298*d5c09012SAndroid Build Coastguard Worker      // afterwards. They do not apply retroactively to existing
299*d5c09012SAndroid Build Coastguard Worker      // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
300*d5c09012SAndroid Build Coastguard Worker      CustomerManagedEncryption customer_managed_encryption = 2
301*d5c09012SAndroid Build Coastguard Worker          [(google.api.field_behavior) = OPTIONAL];
302*d5c09012SAndroid Build Coastguard Worker    }
303*d5c09012SAndroid Build Coastguard Worker
304*d5c09012SAndroid Build Coastguard Worker    // Required. The list of Replicas for this
305*d5c09012SAndroid Build Coastguard Worker    // [Secret][google.cloud.secretmanager.v1.Secret].
306*d5c09012SAndroid Build Coastguard Worker    //
307*d5c09012SAndroid Build Coastguard Worker    // Cannot be empty.
308*d5c09012SAndroid Build Coastguard Worker    repeated Replica replicas = 1 [(google.api.field_behavior) = REQUIRED];
309*d5c09012SAndroid Build Coastguard Worker  }
310*d5c09012SAndroid Build Coastguard Worker
311*d5c09012SAndroid Build Coastguard Worker  // The replication policy for this secret.
312*d5c09012SAndroid Build Coastguard Worker  oneof replication {
313*d5c09012SAndroid Build Coastguard Worker    // The [Secret][google.cloud.secretmanager.v1.Secret] will automatically be
314*d5c09012SAndroid Build Coastguard Worker    // replicated without any restrictions.
315*d5c09012SAndroid Build Coastguard Worker    Automatic automatic = 1;
316*d5c09012SAndroid Build Coastguard Worker
317*d5c09012SAndroid Build Coastguard Worker    // The [Secret][google.cloud.secretmanager.v1.Secret] will only be
318*d5c09012SAndroid Build Coastguard Worker    // replicated into the locations specified.
319*d5c09012SAndroid Build Coastguard Worker    UserManaged user_managed = 2;
320*d5c09012SAndroid Build Coastguard Worker  }
321*d5c09012SAndroid Build Coastguard Worker}
322*d5c09012SAndroid Build Coastguard Worker
323*d5c09012SAndroid Build Coastguard Worker// Configuration for encrypting secret payloads using customer-managed
324*d5c09012SAndroid Build Coastguard Worker// encryption keys (CMEK).
325*d5c09012SAndroid Build Coastguard Workermessage CustomerManagedEncryption {
326*d5c09012SAndroid Build Coastguard Worker  // Required. The resource name of the Cloud KMS CryptoKey used to encrypt
327*d5c09012SAndroid Build Coastguard Worker  // secret payloads.
328*d5c09012SAndroid Build Coastguard Worker  //
329*d5c09012SAndroid Build Coastguard Worker  // For secrets using the
330*d5c09012SAndroid Build Coastguard Worker  // [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
331*d5c09012SAndroid Build Coastguard Worker  // replication policy type, Cloud KMS CryptoKeys must reside in the same
332*d5c09012SAndroid Build Coastguard Worker  // location as the [replica location][Secret.UserManaged.Replica.location].
333*d5c09012SAndroid Build Coastguard Worker  //
334*d5c09012SAndroid Build Coastguard Worker  // For secrets using the
335*d5c09012SAndroid Build Coastguard Worker  // [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
336*d5c09012SAndroid Build Coastguard Worker  // replication policy type, Cloud KMS CryptoKeys must reside in `global`.
337*d5c09012SAndroid Build Coastguard Worker  //
338*d5c09012SAndroid Build Coastguard Worker  // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
339*d5c09012SAndroid Build Coastguard Worker  string kms_key_name = 1 [(google.api.field_behavior) = REQUIRED];
340*d5c09012SAndroid Build Coastguard Worker}
341*d5c09012SAndroid Build Coastguard Worker
342*d5c09012SAndroid Build Coastguard Worker// The replication status of a
343*d5c09012SAndroid Build Coastguard Worker// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
344*d5c09012SAndroid Build Coastguard Workermessage ReplicationStatus {
345*d5c09012SAndroid Build Coastguard Worker  // The replication status of a
346*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] using
347*d5c09012SAndroid Build Coastguard Worker  // automatic replication.
348*d5c09012SAndroid Build Coastguard Worker  //
349*d5c09012SAndroid Build Coastguard Worker  // Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret]
350*d5c09012SAndroid Build Coastguard Worker  // has an automatic replication policy.
351*d5c09012SAndroid Build Coastguard Worker  message AutomaticStatus {
352*d5c09012SAndroid Build Coastguard Worker    // Output only. The customer-managed encryption status of the
353*d5c09012SAndroid Build Coastguard Worker    // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
354*d5c09012SAndroid Build Coastguard Worker    // populated if customer-managed encryption is used.
355*d5c09012SAndroid Build Coastguard Worker    CustomerManagedEncryptionStatus customer_managed_encryption = 1
356*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OUTPUT_ONLY];
357*d5c09012SAndroid Build Coastguard Worker  }
358*d5c09012SAndroid Build Coastguard Worker
359*d5c09012SAndroid Build Coastguard Worker  // The replication status of a
360*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] using
361*d5c09012SAndroid Build Coastguard Worker  // user-managed replication.
362*d5c09012SAndroid Build Coastguard Worker  //
363*d5c09012SAndroid Build Coastguard Worker  // Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret]
364*d5c09012SAndroid Build Coastguard Worker  // has a user-managed replication policy.
365*d5c09012SAndroid Build Coastguard Worker  message UserManagedStatus {
366*d5c09012SAndroid Build Coastguard Worker    // Describes the status of a user-managed replica for the
367*d5c09012SAndroid Build Coastguard Worker    // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
368*d5c09012SAndroid Build Coastguard Worker    message ReplicaStatus {
369*d5c09012SAndroid Build Coastguard Worker      // Output only. The canonical ID of the replica location.
370*d5c09012SAndroid Build Coastguard Worker      // For example: `"us-east1"`.
371*d5c09012SAndroid Build Coastguard Worker      string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
372*d5c09012SAndroid Build Coastguard Worker
373*d5c09012SAndroid Build Coastguard Worker      // Output only. The customer-managed encryption status of the
374*d5c09012SAndroid Build Coastguard Worker      // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
375*d5c09012SAndroid Build Coastguard Worker      // populated if customer-managed encryption is used.
376*d5c09012SAndroid Build Coastguard Worker      CustomerManagedEncryptionStatus customer_managed_encryption = 2
377*d5c09012SAndroid Build Coastguard Worker          [(google.api.field_behavior) = OUTPUT_ONLY];
378*d5c09012SAndroid Build Coastguard Worker    }
379*d5c09012SAndroid Build Coastguard Worker
380*d5c09012SAndroid Build Coastguard Worker    // Output only. The list of replica statuses for the
381*d5c09012SAndroid Build Coastguard Worker    // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
382*d5c09012SAndroid Build Coastguard Worker    repeated ReplicaStatus replicas = 1
383*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OUTPUT_ONLY];
384*d5c09012SAndroid Build Coastguard Worker  }
385*d5c09012SAndroid Build Coastguard Worker
386*d5c09012SAndroid Build Coastguard Worker  // The replication status of the
387*d5c09012SAndroid Build Coastguard Worker  // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
388*d5c09012SAndroid Build Coastguard Worker  oneof replication_status {
389*d5c09012SAndroid Build Coastguard Worker    // Describes the replication status of a
390*d5c09012SAndroid Build Coastguard Worker    // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
391*d5c09012SAndroid Build Coastguard Worker    // automatic replication.
392*d5c09012SAndroid Build Coastguard Worker    //
393*d5c09012SAndroid Build Coastguard Worker    // Only populated if the parent
394*d5c09012SAndroid Build Coastguard Worker    // [Secret][google.cloud.secretmanager.v1.Secret] has an automatic
395*d5c09012SAndroid Build Coastguard Worker    // replication policy.
396*d5c09012SAndroid Build Coastguard Worker    AutomaticStatus automatic = 1;
397*d5c09012SAndroid Build Coastguard Worker
398*d5c09012SAndroid Build Coastguard Worker    // Describes the replication status of a
399*d5c09012SAndroid Build Coastguard Worker    // [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
400*d5c09012SAndroid Build Coastguard Worker    // user-managed replication.
401*d5c09012SAndroid Build Coastguard Worker    //
402*d5c09012SAndroid Build Coastguard Worker    // Only populated if the parent
403*d5c09012SAndroid Build Coastguard Worker    // [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed
404*d5c09012SAndroid Build Coastguard Worker    // replication policy.
405*d5c09012SAndroid Build Coastguard Worker    UserManagedStatus user_managed = 2;
406*d5c09012SAndroid Build Coastguard Worker  }
407*d5c09012SAndroid Build Coastguard Worker}
408*d5c09012SAndroid Build Coastguard Worker
409*d5c09012SAndroid Build Coastguard Worker// Describes the status of customer-managed encryption.
410*d5c09012SAndroid Build Coastguard Workermessage CustomerManagedEncryptionStatus {
411*d5c09012SAndroid Build Coastguard Worker  // Required. The resource name of the Cloud KMS CryptoKeyVersion used to
412*d5c09012SAndroid Build Coastguard Worker  // encrypt the secret payload, in the following format:
413*d5c09012SAndroid Build Coastguard Worker  // `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
414*d5c09012SAndroid Build Coastguard Worker  string kms_key_version_name = 1 [(google.api.field_behavior) = REQUIRED];
415*d5c09012SAndroid Build Coastguard Worker}
416*d5c09012SAndroid Build Coastguard Worker
417*d5c09012SAndroid Build Coastguard Worker// A Pub/Sub topic which Secret Manager will publish to when control plane
418*d5c09012SAndroid Build Coastguard Worker// events occur on this secret.
419*d5c09012SAndroid Build Coastguard Workermessage Topic {
420*d5c09012SAndroid Build Coastguard Worker  option (google.api.resource) = {
421*d5c09012SAndroid Build Coastguard Worker    type: "pubsub.googleapis.com/Topic"
422*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/topics/{topic}"
423*d5c09012SAndroid Build Coastguard Worker  };
424*d5c09012SAndroid Build Coastguard Worker
425*d5c09012SAndroid Build Coastguard Worker  // Required. The resource name of the Pub/Sub topic that will be published to,
426*d5c09012SAndroid Build Coastguard Worker  // in the following format: `projects/*/topics/*`. For publication to succeed,
427*d5c09012SAndroid Build Coastguard Worker  // the Secret Manager service agent must have the `pubsub.topic.publish`
428*d5c09012SAndroid Build Coastguard Worker  // permission on the topic. The Pub/Sub Publisher role
429*d5c09012SAndroid Build Coastguard Worker  // (`roles/pubsub.publisher`) includes this permission.
430*d5c09012SAndroid Build Coastguard Worker  string name = 1 [(google.api.field_behavior) = REQUIRED];
431*d5c09012SAndroid Build Coastguard Worker}
432*d5c09012SAndroid Build Coastguard Worker
433*d5c09012SAndroid Build Coastguard Worker// The rotation time and period for a
434*d5c09012SAndroid Build Coastguard Worker// [Secret][google.cloud.secretmanager.v1.Secret]. At next_rotation_time, Secret
435*d5c09012SAndroid Build Coastguard Worker// Manager will send a Pub/Sub notification to the topics configured on the
436*d5c09012SAndroid Build Coastguard Worker// Secret. [Secret.topics][google.cloud.secretmanager.v1.Secret.topics] must be
437*d5c09012SAndroid Build Coastguard Worker// set to configure rotation.
438*d5c09012SAndroid Build Coastguard Workermessage Rotation {
439*d5c09012SAndroid Build Coastguard Worker  // Optional. Timestamp in UTC at which the
440*d5c09012SAndroid Build Coastguard Worker  // [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to rotate.
441*d5c09012SAndroid Build Coastguard Worker  // Cannot be set to less than 300s (5 min) in the future and at most
442*d5c09012SAndroid Build Coastguard Worker  // 3153600000s (100 years).
443*d5c09012SAndroid Build Coastguard Worker  //
444*d5c09012SAndroid Build Coastguard Worker  // [next_rotation_time][google.cloud.secretmanager.v1.Rotation.next_rotation_time]
445*d5c09012SAndroid Build Coastguard Worker  // MUST  be set if
446*d5c09012SAndroid Build Coastguard Worker  // [rotation_period][google.cloud.secretmanager.v1.Rotation.rotation_period]
447*d5c09012SAndroid Build Coastguard Worker  // is set.
448*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Timestamp next_rotation_time = 1
449*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
450*d5c09012SAndroid Build Coastguard Worker
451*d5c09012SAndroid Build Coastguard Worker  // Input only. The Duration between rotation notifications. Must be in seconds
452*d5c09012SAndroid Build Coastguard Worker  // and at least 3600s (1h) and at most 3153600000s (100 years).
453*d5c09012SAndroid Build Coastguard Worker  //
454*d5c09012SAndroid Build Coastguard Worker  // If
455*d5c09012SAndroid Build Coastguard Worker  // [rotation_period][google.cloud.secretmanager.v1.Rotation.rotation_period]
456*d5c09012SAndroid Build Coastguard Worker  // is set,
457*d5c09012SAndroid Build Coastguard Worker  // [next_rotation_time][google.cloud.secretmanager.v1.Rotation.next_rotation_time]
458*d5c09012SAndroid Build Coastguard Worker  // must be set.
459*d5c09012SAndroid Build Coastguard Worker  // [next_rotation_time][google.cloud.secretmanager.v1.Rotation.next_rotation_time]
460*d5c09012SAndroid Build Coastguard Worker  // will be advanced by this period when the service automatically sends
461*d5c09012SAndroid Build Coastguard Worker  // rotation notifications.
462*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration rotation_period = 2
463*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = INPUT_ONLY];
464*d5c09012SAndroid Build Coastguard Worker}
465*d5c09012SAndroid Build Coastguard Worker
466*d5c09012SAndroid Build Coastguard Worker// A secret payload resource in the Secret Manager API. This contains the
467*d5c09012SAndroid Build Coastguard Worker// sensitive secret payload that is associated with a
468*d5c09012SAndroid Build Coastguard Worker// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
469*d5c09012SAndroid Build Coastguard Workermessage SecretPayload {
470*d5c09012SAndroid Build Coastguard Worker  // The secret data. Must be no larger than 64KiB.
471*d5c09012SAndroid Build Coastguard Worker  bytes data = 1;
472*d5c09012SAndroid Build Coastguard Worker
473*d5c09012SAndroid Build Coastguard Worker  // Optional. If specified,
474*d5c09012SAndroid Build Coastguard Worker  // [SecretManagerService][google.cloud.secretmanager.v1.SecretManagerService]
475*d5c09012SAndroid Build Coastguard Worker  // will verify the integrity of the received
476*d5c09012SAndroid Build Coastguard Worker  // [data][google.cloud.secretmanager.v1.SecretPayload.data] on
477*d5c09012SAndroid Build Coastguard Worker  // [SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion]
478*d5c09012SAndroid Build Coastguard Worker  // calls using the crc32c checksum and store it to include in future
479*d5c09012SAndroid Build Coastguard Worker  // [SecretManagerService.AccessSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion]
480*d5c09012SAndroid Build Coastguard Worker  // responses. If a checksum is not provided in the
481*d5c09012SAndroid Build Coastguard Worker  // [SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion]
482*d5c09012SAndroid Build Coastguard Worker  // request, the
483*d5c09012SAndroid Build Coastguard Worker  // [SecretManagerService][google.cloud.secretmanager.v1.SecretManagerService]
484*d5c09012SAndroid Build Coastguard Worker  // will generate and store one for you.
485*d5c09012SAndroid Build Coastguard Worker  //
486*d5c09012SAndroid Build Coastguard Worker  // The CRC32C value is encoded as a Int64 for compatibility, and can be
487*d5c09012SAndroid Build Coastguard Worker  // safely downconverted to uint32 in languages that support this type.
488*d5c09012SAndroid Build Coastguard Worker  // https://cloud.google.com/apis/design/design_patterns#integer_types
489*d5c09012SAndroid Build Coastguard Worker  optional int64 data_crc32c = 2 [(google.api.field_behavior) = OPTIONAL];
490*d5c09012SAndroid Build Coastguard Worker}
491