Skip to content

Commit d462b20

Browse files
feat: add support for Cloud EKM to the Cloud KMS service and resource protos (#306)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/9c94202f-63a5-4df0-9d76-871a00f99b85/targets
1 parent 5ccfd5f commit d462b20

File tree

11 files changed

+638
-43
lines changed

11 files changed

+638
-43
lines changed

packages/google-cloud-kms/.jsdoc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
includePattern: '\\.js$'
4141
},
4242
templates: {
43-
copyright: 'Copyright 2019 Google, LLC.',
43+
copyright: 'Copyright 2020 Google LLC',
4444
includeDate: false,
4545
sourceFiles: false,
4646
systemName: '@google-cloud/kms',
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"enable-source-maps": true,
3+
"throw-deprecation": true,
4+
"timeout": 10000
5+
}

packages/google-cloud-kms/.prettierrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// https://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,

packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2020 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.
@@ -16,11 +16,11 @@ syntax = "proto3";
1616

1717
package google.cloud.kms.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/api/field_behavior.proto";
2120
import "google/api/resource.proto";
2221
import "google/protobuf/duration.proto";
2322
import "google/protobuf/timestamp.proto";
23+
import "google/api/annotations.proto";
2424

2525
option cc_enable_arenas = true;
2626
option csharp_namespace = "Google.Cloud.Kms.V1";
@@ -284,6 +284,9 @@ message CryptoKeyVersion {
284284

285285
// ECDSA on the NIST P-384 curve with a SHA384 digest.
286286
EC_SIGN_P384_SHA384 = 13;
287+
288+
// Algorithm representing symmetric encryption by an external key manager.
289+
EXTERNAL_SYMMETRIC_ENCRYPTION = 18;
287290
}
288291

289292
// The state of a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], indicating if it can be used.
@@ -390,11 +393,21 @@ message CryptoKeyVersion {
390393
// [state][google.cloud.kms.v1.CryptoKeyVersion.state] is
391394
// [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED].
392395
string import_failure_reason = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
396+
397+
// ExternalProtectionLevelOptions stores a group of additional fields for
398+
// configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that are specific to the
399+
// [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level.
400+
ExternalProtectionLevelOptions external_protection_level_options = 17;
393401
}
394402

395403
// The public key for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Obtained via
396404
// [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
397405
message PublicKey {
406+
option (google.api.resource) = {
407+
type: "cloudkms.googleapis.com/PublicKey"
408+
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}/publicKey"
409+
};
410+
398411
// The public key, encoded in PEM format. For more information, see the
399412
// [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
400413
// [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
@@ -560,3 +573,11 @@ enum ProtectionLevel {
560573
// Crypto operations are performed by an external key manager.
561574
EXTERNAL = 3;
562575
}
576+
577+
// ExternalProtectionLevelOptions stores a group of additional fields for
578+
// configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that are specific to the
579+
// [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level.
580+
message ExternalProtectionLevelOptions {
581+
// The URI for an external resource that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents.
582+
string external_key_uri = 1;
583+
}

packages/google-cloud-kms/protos/google/cloud/kms/v1/service.proto

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2020 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.
@@ -870,4 +870,9 @@ message LocationMetadata {
870870
// [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
871871
// [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this location.
872872
bool hsm_available = 1;
873+
874+
// Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with
875+
// [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
876+
// [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in this location.
877+
bool ekm_available = 2;
873878
}

packages/google-cloud-kms/protos/protos.d.ts

+104-1
Original file line numberDiff line numberDiff line change
@@ -5798,6 +5798,9 @@ export namespace google {
57985798

57995799
/** CryptoKeyVersion importFailureReason */
58005800
importFailureReason?: (string|null);
5801+
5802+
/** CryptoKeyVersion externalProtectionLevelOptions */
5803+
externalProtectionLevelOptions?: (google.cloud.kms.v1.IExternalProtectionLevelOptions|null);
58015804
}
58025805

58035806
/** Represents a CryptoKeyVersion. */
@@ -5845,6 +5848,9 @@ export namespace google {
58455848
/** CryptoKeyVersion importFailureReason. */
58465849
public importFailureReason: string;
58475850

5851+
/** CryptoKeyVersion externalProtectionLevelOptions. */
5852+
public externalProtectionLevelOptions?: (google.cloud.kms.v1.IExternalProtectionLevelOptions|null);
5853+
58485854
/**
58495855
* Creates a new CryptoKeyVersion instance using the specified properties.
58505856
* @param [properties] Properties to set
@@ -5935,7 +5941,8 @@ export namespace google {
59355941
RSA_DECRYPT_OAEP_4096_SHA256 = 10,
59365942
RSA_DECRYPT_OAEP_4096_SHA512 = 17,
59375943
EC_SIGN_P256_SHA256 = 12,
5938-
EC_SIGN_P384_SHA384 = 13
5944+
EC_SIGN_P384_SHA384 = 13,
5945+
EXTERNAL_SYMMETRIC_ENCRYPTION = 18
59395946
}
59405947

59415948
/** CryptoKeyVersionState enum. */
@@ -6313,6 +6320,96 @@ export namespace google {
63136320
EXTERNAL = 3
63146321
}
63156322

6323+
/** Properties of an ExternalProtectionLevelOptions. */
6324+
interface IExternalProtectionLevelOptions {
6325+
6326+
/** ExternalProtectionLevelOptions externalKeyUri */
6327+
externalKeyUri?: (string|null);
6328+
}
6329+
6330+
/** Represents an ExternalProtectionLevelOptions. */
6331+
class ExternalProtectionLevelOptions implements IExternalProtectionLevelOptions {
6332+
6333+
/**
6334+
* Constructs a new ExternalProtectionLevelOptions.
6335+
* @param [properties] Properties to set
6336+
*/
6337+
constructor(properties?: google.cloud.kms.v1.IExternalProtectionLevelOptions);
6338+
6339+
/** ExternalProtectionLevelOptions externalKeyUri. */
6340+
public externalKeyUri: string;
6341+
6342+
/**
6343+
* Creates a new ExternalProtectionLevelOptions instance using the specified properties.
6344+
* @param [properties] Properties to set
6345+
* @returns ExternalProtectionLevelOptions instance
6346+
*/
6347+
public static create(properties?: google.cloud.kms.v1.IExternalProtectionLevelOptions): google.cloud.kms.v1.ExternalProtectionLevelOptions;
6348+
6349+
/**
6350+
* Encodes the specified ExternalProtectionLevelOptions message. Does not implicitly {@link google.cloud.kms.v1.ExternalProtectionLevelOptions.verify|verify} messages.
6351+
* @param message ExternalProtectionLevelOptions message or plain object to encode
6352+
* @param [writer] Writer to encode to
6353+
* @returns Writer
6354+
*/
6355+
public static encode(message: google.cloud.kms.v1.IExternalProtectionLevelOptions, writer?: $protobuf.Writer): $protobuf.Writer;
6356+
6357+
/**
6358+
* Encodes the specified ExternalProtectionLevelOptions message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ExternalProtectionLevelOptions.verify|verify} messages.
6359+
* @param message ExternalProtectionLevelOptions message or plain object to encode
6360+
* @param [writer] Writer to encode to
6361+
* @returns Writer
6362+
*/
6363+
public static encodeDelimited(message: google.cloud.kms.v1.IExternalProtectionLevelOptions, writer?: $protobuf.Writer): $protobuf.Writer;
6364+
6365+
/**
6366+
* Decodes an ExternalProtectionLevelOptions message from the specified reader or buffer.
6367+
* @param reader Reader or buffer to decode from
6368+
* @param [length] Message length if known beforehand
6369+
* @returns ExternalProtectionLevelOptions
6370+
* @throws {Error} If the payload is not a reader or valid buffer
6371+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
6372+
*/
6373+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ExternalProtectionLevelOptions;
6374+
6375+
/**
6376+
* Decodes an ExternalProtectionLevelOptions message from the specified reader or buffer, length delimited.
6377+
* @param reader Reader or buffer to decode from
6378+
* @returns ExternalProtectionLevelOptions
6379+
* @throws {Error} If the payload is not a reader or valid buffer
6380+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
6381+
*/
6382+
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ExternalProtectionLevelOptions;
6383+
6384+
/**
6385+
* Verifies an ExternalProtectionLevelOptions message.
6386+
* @param message Plain object to verify
6387+
* @returns `null` if valid, otherwise the reason why it is not
6388+
*/
6389+
public static verify(message: { [k: string]: any }): (string|null);
6390+
6391+
/**
6392+
* Creates an ExternalProtectionLevelOptions message from a plain object. Also converts values to their respective internal types.
6393+
* @param object Plain object
6394+
* @returns ExternalProtectionLevelOptions
6395+
*/
6396+
public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ExternalProtectionLevelOptions;
6397+
6398+
/**
6399+
* Creates a plain object from an ExternalProtectionLevelOptions message. Also converts values to other types if specified.
6400+
* @param message ExternalProtectionLevelOptions
6401+
* @param [options] Conversion options
6402+
* @returns Plain object
6403+
*/
6404+
public static toObject(message: google.cloud.kms.v1.ExternalProtectionLevelOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };
6405+
6406+
/**
6407+
* Converts this ExternalProtectionLevelOptions to JSON.
6408+
* @returns JSON object
6409+
*/
6410+
public toJSON(): { [k: string]: any };
6411+
}
6412+
63166413
/** Represents a KeyManagementService */
63176414
class KeyManagementService extends $protobuf.rpc.Service {
63186415

@@ -10005,6 +10102,9 @@ export namespace google {
1000510102

1000610103
/** LocationMetadata hsmAvailable */
1000710104
hsmAvailable?: (boolean|null);
10105+
10106+
/** LocationMetadata ekmAvailable */
10107+
ekmAvailable?: (boolean|null);
1000810108
}
1000910109

1001010110
/** Represents a LocationMetadata. */
@@ -10019,6 +10119,9 @@ export namespace google {
1001910119
/** LocationMetadata hsmAvailable. */
1002010120
public hsmAvailable: boolean;
1002110121

10122+
/** LocationMetadata ekmAvailable. */
10123+
public ekmAvailable: boolean;
10124+
1002210125
/**
1002310126
* Creates a new LocationMetadata instance using the specified properties.
1002410127
* @param [properties] Properties to set

0 commit comments

Comments
 (0)