Skip to content

Commit 9682584

Browse files
Google APIscopybara-github
authored andcommitted
feat: update protos to include InvalidateApprovalRequest and GetAccessApprovalServiceAccount APIs
PiperOrigin-RevId: 449820922
1 parent cfe613f commit 9682584

1 file changed

Lines changed: 165 additions & 36 deletions

File tree

google/cloud/accessapproval/v1/accessapproval.proto

Lines changed: 165 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ option ruby_package = "Google::Cloud::AccessApproval::V1";
6767
// If a request is not approved or dismissed, we call it pending.
6868
service AccessApproval {
6969
option (google.api.default_host) = "accessapproval.googleapis.com";
70-
option (google.api.oauth_scopes) =
71-
"https://www.googleapis.com/auth/cloud-platform";
70+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
7271

7372
// Lists approval requests associated with a project, folder, or organization.
7473
// Approval requests can be filtered by state (pending, active, dismissed).
7574
// The order is reverse chronological.
76-
rpc ListApprovalRequests(ListApprovalRequestsMessage)
77-
returns (ListApprovalRequestsResponse) {
75+
rpc ListApprovalRequests(ListApprovalRequestsMessage) returns (ListApprovalRequestsResponse) {
7876
option (google.api.http) = {
7977
get: "/v1/{parent=projects/*}/approvalRequests"
80-
additional_bindings { get: "/v1/{parent=folders/*}/approvalRequests" }
78+
additional_bindings {
79+
get: "/v1/{parent=folders/*}/approvalRequests"
80+
}
8181
additional_bindings {
8282
get: "/v1/{parent=organizations/*}/approvalRequests"
8383
}
@@ -89,7 +89,9 @@ service AccessApproval {
8989
rpc GetApprovalRequest(GetApprovalRequestMessage) returns (ApprovalRequest) {
9090
option (google.api.http) = {
9191
get: "/v1/{name=projects/*/approvalRequests/*}"
92-
additional_bindings { get: "/v1/{name=folders/*/approvalRequests/*}" }
92+
additional_bindings {
93+
get: "/v1/{name=folders/*/approvalRequests/*}"
94+
}
9395
additional_bindings {
9496
get: "/v1/{name=organizations/*/approvalRequests/*}"
9597
}
@@ -101,8 +103,7 @@ service AccessApproval {
101103
//
102104
// Returns NOT_FOUND if the request does not exist. Returns
103105
// FAILED_PRECONDITION if the request exists but is not in a pending state.
104-
rpc ApproveApprovalRequest(ApproveApprovalRequestMessage)
105-
returns (ApprovalRequest) {
106+
rpc ApproveApprovalRequest(ApproveApprovalRequestMessage) returns (ApprovalRequest) {
106107
option (google.api.http) = {
107108
post: "/v1/{name=projects/*/approvalRequests/*}:approve"
108109
body: "*"
@@ -127,8 +128,7 @@ service AccessApproval {
127128
//
128129
// Returns FAILED_PRECONDITION if the request exists but is not in a pending
129130
// state.
130-
rpc DismissApprovalRequest(DismissApprovalRequestMessage)
131-
returns (ApprovalRequest) {
131+
rpc DismissApprovalRequest(DismissApprovalRequestMessage) returns (ApprovalRequest) {
132132
option (google.api.http) = {
133133
post: "/v1/{name=projects/*/approvalRequests/*}:dismiss"
134134
body: "*"
@@ -143,12 +143,36 @@ service AccessApproval {
143143
};
144144
}
145145

146+
// Invalidates an existing ApprovalRequest. Returns the updated
147+
// ApprovalRequest.
148+
//
149+
// NOTE: This does not deny access to the resource if another request has been
150+
// made and approved. It only invalidates a single approval.
151+
//
152+
// Returns FAILED_PRECONDITION if the request exists but is not in an approved
153+
// state.
154+
rpc InvalidateApprovalRequest(InvalidateApprovalRequestMessage) returns (ApprovalRequest) {
155+
option (google.api.http) = {
156+
post: "/v1/{name=projects/*/approvalRequests/*}:invalidate"
157+
body: "*"
158+
additional_bindings {
159+
post: "/v1/{name=folders/*/approvalRequests/*}:invalidate"
160+
body: "*"
161+
}
162+
additional_bindings {
163+
post: "/v1/{name=organizations/*/approvalRequests/*}:invalidate"
164+
body: "*"
165+
}
166+
};
167+
}
168+
146169
// Gets the settings associated with a project, folder, or organization.
147-
rpc GetAccessApprovalSettings(GetAccessApprovalSettingsMessage)
148-
returns (AccessApprovalSettings) {
170+
rpc GetAccessApprovalSettings(GetAccessApprovalSettingsMessage) returns (AccessApprovalSettings) {
149171
option (google.api.http) = {
150172
get: "/v1/{name=projects/*/accessApprovalSettings}"
151-
additional_bindings { get: "/v1/{name=folders/*/accessApprovalSettings}" }
173+
additional_bindings {
174+
get: "/v1/{name=folders/*/accessApprovalSettings}"
175+
}
152176
additional_bindings {
153177
get: "/v1/{name=organizations/*/accessApprovalSettings}"
154178
}
@@ -158,8 +182,7 @@ service AccessApproval {
158182

159183
// Updates the settings associated with a project, folder, or organization.
160184
// Settings to update are determined by the value of field_mask.
161-
rpc UpdateAccessApprovalSettings(UpdateAccessApprovalSettingsMessage)
162-
returns (AccessApprovalSettings) {
185+
rpc UpdateAccessApprovalSettings(UpdateAccessApprovalSettingsMessage) returns (AccessApprovalSettings) {
163186
option (google.api.http) = {
164187
patch: "/v1/{settings.name=projects/*/accessApprovalSettings}"
165188
body: "settings"
@@ -181,8 +204,7 @@ service AccessApproval {
181204
// Approval disabled. If Access Approval is enabled at a higher level of the
182205
// hierarchy, then Access Approval will still be enabled at this level as
183206
// the settings are inherited.
184-
rpc DeleteAccessApprovalSettings(DeleteAccessApprovalSettingsMessage)
185-
returns (google.protobuf.Empty) {
207+
rpc DeleteAccessApprovalSettings(DeleteAccessApprovalSettingsMessage) returns (google.protobuf.Empty) {
186208
option (google.api.http) = {
187209
delete: "/v1/{name=projects/*/accessApprovalSettings}"
188210
additional_bindings {
@@ -194,6 +216,21 @@ service AccessApproval {
194216
};
195217
option (google.api.method_signature) = "name";
196218
}
219+
220+
// Retrieves the service account that is used by Access Approval to access KMS
221+
// keys for signing approved approval requests.
222+
rpc GetAccessApprovalServiceAccount(GetAccessApprovalServiceAccountMessage) returns (AccessApprovalServiceAccount) {
223+
option (google.api.http) = {
224+
get: "/v1/{name=projects/*/serviceAccount}"
225+
additional_bindings {
226+
get: "/v1/{name=folders/*/serviceAccount}"
227+
}
228+
additional_bindings {
229+
get: "/v1/{name=organizations/*/serviceAccount}"
230+
}
231+
};
232+
option (google.api.method_signature) = "name";
233+
}
197234
}
198235

199236
// Home office and physical location of the principal.
@@ -249,14 +286,23 @@ message AccessReason {
249286
CUSTOMER_INITIATED_SUPPORT = 1;
250287

251288
// The principal accessed customer data in order to diagnose or resolve a
252-
// suspected issue in services or a known outage. Often this access is used
253-
// to confirm that customers are not affected by a suspected service issue
254-
// or to remediate a reversible system issue.
289+
// suspected issue in services. Often this access is used to confirm that
290+
// customers are not affected by a suspected service issue or to remediate a
291+
// reversible system issue.
255292
GOOGLE_INITIATED_SERVICE = 2;
256293

257294
// Google initiated service for security, fraud, abuse, or compliance
258295
// purposes.
259296
GOOGLE_INITIATED_REVIEW = 3;
297+
298+
// The principal was compelled to access customer data in order to respond
299+
// to a legal third party data request or process, including legal processes
300+
// from customers themselves.
301+
THIRD_PARTY_DATA_REQUEST = 4;
302+
303+
// The principal accessed customer data in order to diagnose or resolve a
304+
// suspected issue in services or a known outage.
305+
GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 5;
260306
}
261307

262308
// Type of access justification.
@@ -266,22 +312,48 @@ message AccessReason {
266312
string detail = 2;
267313
}
268314

315+
// Information about the digital signature of the resource.
316+
message SignatureInfo {
317+
// The digital signature.
318+
bytes signature = 1;
319+
320+
// How this signature may be verified.
321+
oneof verification_info {
322+
// The public key for the Google default signing, encoded in PEM format. The
323+
// signature was created using a private key which may be verified using
324+
// this public key.
325+
string google_public_key_pem = 2;
326+
327+
// The resource name of the customer CryptoKeyVersion used for signing.
328+
string customer_kms_key_version = 3;
329+
}
330+
}
331+
269332
// A decision that has been made to approve access to a resource.
270333
message ApproveDecision {
271334
// The time at which approval was granted.
272335
google.protobuf.Timestamp approve_time = 1;
273336

274337
// The time at which the approval expires.
275338
google.protobuf.Timestamp expire_time = 2;
339+
340+
// If set, denotes the timestamp at which the approval is invalidated.
341+
google.protobuf.Timestamp invalidate_time = 3;
342+
343+
// The signature for the ApprovalRequest and details on how it was signed.
344+
SignatureInfo signature_info = 4;
345+
346+
// True when the request has been auto-approved.
347+
bool auto_approved = 5;
276348
}
277349

278350
// A decision that has been made to dismiss an approval request.
279351
message DismissDecision {
280352
// The time at which the approval request was dismissed.
281353
google.protobuf.Timestamp dismiss_time = 1;
282354

283-
// This field will be true if the ApprovalRequest was implcitly dismissed
284-
// due to inaction by the access approval approvers (the request is not acted
355+
// This field will be true if the ApprovalRequest was implicitly dismissed due
356+
// to inaction by the access approval approvers (the request is not acted
285357
// on by the approvers before the exiration time).
286358
bool implicit = 2;
287359
}
@@ -431,8 +503,8 @@ message AccessApprovalSettings {
431503
// * "folders/{folder}/accessApprovalSettings"
432504
// * "organizations/{organization}/accessApprovalSettings"
433505
string name = 1 [(google.api.resource_reference) = {
434-
type: "accessapproval.googleapis.com/AccessApprovalSettings"
435-
}];
506+
type: "accessapproval.googleapis.com/AccessApprovalSettings"
507+
}];
436508

437509
// A list of email addresses to which notifications relating to approval
438510
// requests should be sent. Notifications relating to a resource will be sent
@@ -459,15 +531,58 @@ message AccessApprovalSettings {
459531
// or more ancestors of the Project or Folder (this field will always be
460532
// unset for the organization since organizations do not have ancestors).
461533
bool enrolled_ancestor = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
534+
535+
// The asymmetric crypto key version to use for signing approval requests.
536+
// Empty active_key_version indicates that a Google-managed key should be used
537+
// for signing. This property will be ignored if set by an ancestor of this
538+
// resource, and new non-empty values may not be set.
539+
string active_key_version = 6;
540+
541+
// Output only. This field is read only (not settable via UpdateAccessApprovalSettings
542+
// method). If the field is true, that indicates that an ancestor of this
543+
// Project or Folder has set active_key_version (this field will always be
544+
// unset for the organization since organizations do not have ancestors).
545+
bool ancestor_has_active_key_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
546+
547+
// Output only. This field is read only (not settable via UpdateAccessApprovalSettings
548+
// method). If the field is true, that indicates that there is some
549+
// configuration issue with the active_key_version configured at this level in
550+
// the resource hierarchy (e.g. it doesn't exist or the Access Approval
551+
// service account doesn't have the correct permissions on it, etc.) This key
552+
// version is not necessarily the effective key version at this level, as key
553+
// versions are inherited top-down.
554+
bool invalid_key_version = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
555+
}
556+
557+
// Access Approval service account related to a project/folder/organization.
558+
message AccessApprovalServiceAccount {
559+
option (google.api.resource) = {
560+
type: "accessapproval.googleapis.com/AccessApprovalServiceAccount"
561+
pattern: "projects/{project}/serviceAccount"
562+
pattern: "folders/{folder}/serviceAccount"
563+
pattern: "organizations/{organization}/serviceAccount"
564+
};
565+
566+
// The resource name of the Access Approval service account. Format is one of:
567+
//
568+
// * "projects/{project}/serviceAccount"
569+
// * "folders/{folder}/serviceAccount"
570+
// * "organizations/{organization}/serviceAccount"
571+
string name = 1 [(google.api.resource_reference) = {
572+
type: "accessapproval.googleapis.com/AccessApprovalServiceAccount"
573+
}];
574+
575+
// Email address of the service account.
576+
string account_email = 2;
462577
}
463578

464579
// Request to list approval requests.
465580
message ListApprovalRequestsMessage {
466581
// The parent resource. This may be "projects/{project}",
467582
// "folders/{folder}", or "organizations/{organization}".
468583
string parent = 1 [(google.api.resource_reference) = {
469-
child_type: "accessapproval.googleapis.com/ApprovalRequest"
470-
}];
584+
child_type: "accessapproval.googleapis.com/ApprovalRequest"
585+
}];
471586

472587
// A filter on the type of approval requests to retrieve. Must be one of the
473588
// following values:
@@ -505,16 +620,16 @@ message GetApprovalRequestMessage {
505620
// Format:
506621
// "{projects|folders|organizations}/{id}/approvalRequests/{approval_request}"
507622
string name = 1 [(google.api.resource_reference) = {
508-
type: "accessapproval.googleapis.com/ApprovalRequest"
509-
}];
623+
type: "accessapproval.googleapis.com/ApprovalRequest"
624+
}];
510625
}
511626

512627
// Request to approve an ApprovalRequest.
513628
message ApproveApprovalRequestMessage {
514629
// Name of the approval request to approve.
515630
string name = 1 [(google.api.resource_reference) = {
516-
type: "accessapproval.googleapis.com/ApprovalRequest"
517-
}];
631+
type: "accessapproval.googleapis.com/ApprovalRequest"
632+
}];
518633

519634
// The expiration time of this approval.
520635
google.protobuf.Timestamp expire_time = 2;
@@ -524,17 +639,25 @@ message ApproveApprovalRequestMessage {
524639
message DismissApprovalRequestMessage {
525640
// Name of the ApprovalRequest to dismiss.
526641
string name = 1 [(google.api.resource_reference) = {
527-
type: "accessapproval.googleapis.com/ApprovalRequest"
528-
}];
642+
type: "accessapproval.googleapis.com/ApprovalRequest"
643+
}];
644+
}
645+
646+
// Request to invalidate an existing approval.
647+
message InvalidateApprovalRequestMessage {
648+
// Name of the ApprovalRequest to invalidate.
649+
string name = 1 [(google.api.resource_reference) = {
650+
type: "accessapproval.googleapis.com/ApprovalRequest"
651+
}];
529652
}
530653

531654
// Request to get access approval settings.
532655
message GetAccessApprovalSettingsMessage {
533656
// The name of the AccessApprovalSettings to retrieve.
534657
// Format: "{projects|folders|organizations}/{id}/accessApprovalSettings"
535658
string name = 1 [(google.api.resource_reference) = {
536-
type: "accessapproval.googleapis.com/AccessApprovalSettings"
537-
}];
659+
type: "accessapproval.googleapis.com/AccessApprovalSettings"
660+
}];
538661
}
539662

540663
// Request to update access approval settings.
@@ -559,6 +682,12 @@ message UpdateAccessApprovalSettingsMessage {
559682
message DeleteAccessApprovalSettingsMessage {
560683
// Name of the AccessApprovalSettings to delete.
561684
string name = 1 [(google.api.resource_reference) = {
562-
type: "accessapproval.googleapis.com/AccessApprovalSettings"
563-
}];
685+
type: "accessapproval.googleapis.com/AccessApprovalSettings"
686+
}];
687+
}
688+
689+
// Request to get an Access Approval service account.
690+
message GetAccessApprovalServiceAccountMessage {
691+
// Name of the AccessApprovalServiceAccount to retrieve.
692+
string name = 1;
564693
}

0 commit comments

Comments
 (0)