1- // Copyright 2025 Google LLC
1+ // Copyright 2026 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -28,21 +28,23 @@ option java_outer_classname = "AutokeyAdminProto";
2828option java_package = "com.google.cloud.kms.v1" ;
2929
3030// Provides interfaces for managing [Cloud KMS
31- // Autokey](https://cloud.google.com/kms/help/autokey) folder-level
32- // configurations. A configuration is inherited by all descendent projects. A
33- // configuration at one folder overrides any other configurations in its
34- // ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS
35- // Autokey, so that users working in a descendant project can request
36- // provisioned [CryptoKeys][google.cloud.kms.v1.CryptoKey], ready for Customer
37- // Managed Encryption Key (CMEK) use, on-demand.
31+ // Autokey](https://cloud.google.com/kms/help/autokey) folder-level or
32+ // project-level configurations. A configuration is inherited by all descendent
33+ // folders and projects. A configuration at a folder or project overrides any
34+ // other configurations in its ancestry. Setting a configuration on a folder is
35+ // a prerequisite for Cloud KMS Autokey, so that users working in a descendant
36+ // project can request provisioned [CryptoKeys][google.cloud.kms.v1.CryptoKey],
37+ // ready for Customer Managed Encryption Key (CMEK) use, on-demand when using
38+ // the dedicated key project mode. This is not required when using the delegated
39+ // key management mode for same-project keys.
3840service AutokeyAdmin {
3941 option (google.api.default_host ) = "cloudkms.googleapis.com" ;
4042 option (google.api.oauth_scopes ) =
4143 "https://www.googleapis.com/auth/cloud-platform,"
4244 "https://www.googleapis.com/auth/cloudkms" ;
4345
44- // Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a
45- // folder . The caller must have both `cloudkms.autokeyConfigs.update`
46+ // Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a folder
47+ // or a project . The caller must have both `cloudkms.autokeyConfigs.update`
4648 // permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy`
4749 // permission on the provided key project. A
4850 // [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's
@@ -52,15 +54,20 @@ service AutokeyAdmin {
5254 option (google.api.http ) = {
5355 patch : "/v1/{autokey_config.name=folders/*/autokeyConfig}"
5456 body : "autokey_config"
57+ additional_bindings {
58+ patch : "/v1/{autokey_config.name=projects/*/autokeyConfig}"
59+ body : "autokey_config"
60+ }
5561 };
5662 option (google.api.method_signature ) = "autokey_config,update_mask" ;
5763 }
5864
59- // Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a
60- // folder .
65+ // Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a folder
66+ // or project .
6167 rpc GetAutokeyConfig (GetAutokeyConfigRequest ) returns (AutokeyConfig ) {
6268 option (google.api.http ) = {
6369 get : "/v1/{name=folders/*/autokeyConfig}"
70+ additional_bindings { get : "/v1/{name=projects/*/autokeyConfig}" }
6471 };
6572 option (google.api.method_signature ) = "name" ;
6673 }
@@ -93,7 +100,8 @@ message UpdateAutokeyConfigRequest {
93100// [GetAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.GetAutokeyConfig].
94101message GetAutokeyConfigRequest {
95102 // Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig]
96- // resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.
103+ // resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig` or
104+ // `projects/{PROJECT_NUMBER}/autokeyConfig`.
97105 string name = 1 [
98106 (google.api.field_behavior ) = REQUIRED ,
99107 (google.api.resource_reference ) = {
@@ -107,6 +115,7 @@ message AutokeyConfig {
107115 option (google.api.resource ) = {
108116 type : "cloudkms.googleapis.com/AutokeyConfig"
109117 pattern : "folders/{folder}/autokeyConfig"
118+ pattern : "projects/{project}/autokeyConfig"
110119 plural : "autokeyConfigs"
111120 singular : "autokeyConfig"
112121 };
@@ -126,10 +135,45 @@ message AutokeyConfig {
126135 // The AutokeyConfig is not yet initialized or has been reset to its default
127136 // uninitialized state.
128137 UNINITIALIZED = 3 ;
138+
139+ // The service account lacks the necessary permissions in the key project to
140+ // configure Autokey.
141+ KEY_PROJECT_PERMISSION_DENIED = 4 ;
142+ }
143+
144+ // Defines the resolution mode enum for the key project.
145+ // The
146+ // [KeyProjectResolutionMode][google.cloud.kms.v1.AutokeyConfig.KeyProjectResolutionMode]
147+ // determines the mechanism by which
148+ // [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] identifies a
149+ // [key_project][google.cloud.kms.v1.AutokeyConfig.key_project] at its
150+ // specific configuration node. This parameter also determines if Autokey can
151+ // be used within this project or folder.
152+ enum KeyProjectResolutionMode {
153+ // Default value. KeyProjectResolutionMode when not specified will act as
154+ // `DEDICATED_KEY_PROJECT`.
155+ KEY_PROJECT_RESOLUTION_MODE_UNSPECIFIED = 0 ;
156+
157+ // Keys are created in a dedicated project specified by `key_project`.
158+ DEDICATED_KEY_PROJECT = 1 ;
159+
160+ // Keys are created in the same project as the resource requesting the key.
161+ // The `key_project` must not be set when this mode is used.
162+ RESOURCE_PROJECT = 2 ;
163+
164+ // Disables the AutokeyConfig. When this mode is set, any AutokeyConfig
165+ // from higher levels in the resource hierarchy are ignored for this
166+ // resource and its descendants. This setting can be overridden
167+ // by a more specific configuration at a lower level. For example,
168+ // if Autokey is disabled on a folder, it can be re-enabled on a sub-folder
169+ // or project within that folder by setting a different mode (e.g.,
170+ // DEDICATED_KEY_PROJECT or RESOURCE_PROJECT).
171+ DISABLED = 3 ;
129172 }
130173
131174 // Identifier. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig]
132- // resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.
175+ // resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig` or
176+ // `projects/{PROJECT_NUMBER}/autokeyConfig`.
133177 string name = 1 [(google.api.field_behavior ) = IDENTIFIER ];
134178
135179 // Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or
@@ -153,6 +197,12 @@ message AutokeyConfig {
153197 // an up-to-date value before proceeding. The request will be rejected with an
154198 // ABORTED error on a mismatched etag.
155199 string etag = 6 [(google.api.field_behavior ) = OPTIONAL ];
200+
201+ // Optional. KeyProjectResolutionMode for the AutokeyConfig.
202+ // Valid values are `DEDICATED_KEY_PROJECT`, `RESOURCE_PROJECT`, or
203+ // `DISABLED`.
204+ KeyProjectResolutionMode key_project_resolution_mode = 8
205+ [(google.api.field_behavior ) = OPTIONAL ];
156206}
157207
158208// Request message for
0 commit comments