diff --git a/packages/google-cloud-kms/.OwlBot.yaml b/packages/google-cloud-kms/.OwlBot.yaml index 77de842d921..e133a83d54c 100644 --- a/packages/google-cloud-kms/.OwlBot.yaml +++ b/packages/google-cloud-kms/.OwlBot.yaml @@ -15,6 +15,6 @@ deep-remove-regex: - /owl-bot-staging deep-copy-regex: - - source: /google/cloud/kms/(.*)/.*-nodejs + - source: /google/cloud/kms/v(.*)/.*-nodejs dest: /owl-bot-staging/google-cloud-kms/$1 api-name: kms diff --git a/packages/google-cloud-kms/README.md b/packages/google-cloud-kms/README.md index a950f5859b5..bbc177b40bc 100644 --- a/packages/google-cloud-kms/README.md +++ b/packages/google-cloud-kms/README.md @@ -97,8 +97,10 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Ekm_service.create_ekm_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.create_ekm_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/ekm_service.create_ekm_connection.js,samples/README.md) | +| Ekm_service.get_ekm_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_config.js,samples/README.md) | | Ekm_service.get_ekm_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_connection.js,samples/README.md) | | Ekm_service.list_ekm_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.list_ekm_connections.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/ekm_service.list_ekm_connections.js,samples/README.md) | +| Ekm_service.update_ekm_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_config.js,samples/README.md) | | Ekm_service.update_ekm_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_connection.js,samples/README.md) | | Key_management_service.asymmetric_decrypt | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/key_management_service.asymmetric_decrypt.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/key_management_service.asymmetric_decrypt.js,samples/README.md) | | Key_management_service.asymmetric_sign | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/key_management_service.asymmetric_sign.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/key_management_service.asymmetric_sign.js,samples/README.md) | diff --git a/packages/google-cloud-kms/protos/google/cloud/kms/v1/ekm_service.proto b/packages/google-cloud-kms/protos/google/cloud/kms/v1/ekm_service.proto index aea72d68170..e5c05c26fd3 100644 --- a/packages/google-cloud-kms/protos/google/cloud/kms/v1/ekm_service.proto +++ b/packages/google-cloud-kms/protos/google/cloud/kms/v1/ekm_service.proto @@ -83,6 +83,25 @@ service EkmService { }; option (google.api.method_signature) = "ekm_connection,update_mask"; } + + // Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + // for a given project and location. + rpc GetEkmConfig(GetEkmConfigRequest) returns (EkmConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/ekmConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + // for a given project and location. + rpc UpdateEkmConfig(UpdateEkmConfigRequest) returns (EkmConfig) { + option (google.api.http) = { + patch: "/v1/{ekm_config.name=projects/*/locations/*/ekmConfig}" + body: "ekm_config" + }; + option (google.api.method_signature) = "ekm_config,update_mask"; + } } // Request message for @@ -187,6 +206,30 @@ message UpdateEkmConnectionRequest { [(google.api.field_behavior) = REQUIRED]; } +// Request message for +// [EkmService.GetEkmConfig][google.cloud.kms.v1.EkmService.GetEkmConfig]. +message GetEkmConfigRequest { + // Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the + // [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/EkmConfig" + } + ]; +} + +// Request message for +// [EkmService.UpdateEkmConfig][google.cloud.kms.v1.EkmService.UpdateEkmConfig]. +message UpdateEkmConfigRequest { + // Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. + EkmConfig ekm_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + // A [Certificate][google.cloud.kms.v1.Certificate] represents an X.509 // certificate used to authenticate HTTPS connections to EKM replicas. message Certificate { @@ -274,6 +317,44 @@ message EkmConnection { [(google.api.field_behavior) = REQUIRED]; } + // [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] + // describes who can perform control plane cryptographic operations using this + // [EkmConnection][google.cloud.kms.v1.EkmConnection]. + enum KeyManagementMode { + // Not specified. + KEY_MANAGEMENT_MODE_UNSPECIFIED = 0; + + // EKM-side key management operations on + // [CryptoKeys][google.cloud.kms.v1.CryptoKey] created with this + // [EkmConnection][google.cloud.kms.v1.EkmConnection] must be initiated from + // the EKM directly and cannot be performed from Cloud KMS. This means that: + // * When creating a + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] associated with + // this + // [EkmConnection][google.cloud.kms.v1.EkmConnection], the caller must + // supply the key path of pre-existing external key material that will be + // linked to the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + // * Destruction of external key material cannot be requested via the + // Cloud KMS API and must be performed directly in the EKM. + // * Automatic rotation of key material is not supported. + MANUAL = 1; + + // All [CryptoKeys][google.cloud.kms.v1.CryptoKey] created with this + // [EkmConnection][google.cloud.kms.v1.EkmConnection] use EKM-side key + // management operations initiated from Cloud KMS. This means that: + // * When a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // associated with this [EkmConnection][google.cloud.kms.v1.EkmConnection] + // is + // created, the EKM automatically generates new key material and a new + // key path. The caller cannot supply the key path of pre-existing + // external key material. + // * Destruction of external key material associated with this + // [EkmConnection][google.cloud.kms.v1.EkmConnection] can be requested by + // calling [DestroyCryptoKeyVersion][EkmService.DestroyCryptoKeyVersion]. + // * Automatic rotation of key material is supported. + CLOUD_KMS = 2; + } + // Output only. The resource name for the // [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format // `projects/*/locations/*/ekmConnections/*`. @@ -295,4 +376,46 @@ message EkmConnection { // Optional. Etag of the currently stored // [EkmConnection][google.cloud.kms.v1.EkmConnection]. string etag = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes who can perform control plane operations on the EKM. If + // unset, this defaults to + // [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. + KeyManagementMode key_management_mode = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Identifies the EKM Crypto Space that this + // [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This + // field is required if + // [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is + // [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. + string crypto_space_path = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// An [EkmConfig][google.cloud.kms.v1.EkmConfig] is a singleton resource that +// represents configuration parameters that apply to all +// [CryptoKeys][google.cloud.kms.v1.CryptoKey] and +// [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] with a +// [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of +// [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC] in a given +// project and location. +message EkmConfig { + option (google.api.resource) = { + type: "cloudkms.googleapis.com/EkmConfig" + pattern: "projects/{project}/locations/{location}/ekmConfig" + }; + + // Output only. The resource name for the + // [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format + // `projects/*/locations/*/ekmConfig`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource name of the default + // [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to + // the empty string removes the default. + string default_ekm_connection = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/EkmConnection" + } + ]; } diff --git a/packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto b/packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto index 23a787295fd..e4a0ff037b4 100644 --- a/packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto +++ b/packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto @@ -473,6 +473,23 @@ message CryptoKeyVersion { // Additional details can be found in // [CryptoKeyVersion.import_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.import_failure_reason]. IMPORT_FAILED = 7; + + // This version was not generated successfully. It may not be used, enabled, + // disabled, or destroyed. Additional details can be found in + // [CryptoKeyVersion.generation_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.generation_failure_reason]. + GENERATION_FAILED = 8; + + // This version was destroyed, and it may not be used or enabled again. + // Cloud KMS is waiting for the corresponding key material residing in an + // external key manager to be destroyed. + PENDING_EXTERNAL_DESTRUCTION = 9; + + // This version was destroyed, and it may not be used or enabled again. + // However, Cloud KMS could not confirm that the corresponding key material + // residing in an external key manager was destroyed. Additional details can + // be found in + // [CryptoKeyVersion.external_destruction_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.external_destruction_failure_reason]. + EXTERNAL_DESTRUCTION_FAILED = 10; } // A view for [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]s. @@ -567,6 +584,19 @@ message CryptoKeyVersion { // [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. string import_failure_reason = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The root cause of the most recent generation failure. Only + // present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + // [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. + string generation_failure_reason = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The root cause of the most recent external destruction + // failure. Only present if + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + // [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. + string external_destruction_failure_reason = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // ExternalProtectionLevelOptions stores a group of additional fields for // configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that // are specific to the diff --git a/packages/google-cloud-kms/protos/protos.d.ts b/packages/google-cloud-kms/protos/protos.d.ts index 7bcf7aef273..949eeb93678 100644 --- a/packages/google-cloud-kms/protos/protos.d.ts +++ b/packages/google-cloud-kms/protos/protos.d.ts @@ -101,6 +101,34 @@ export namespace google { * @returns Promise */ public updateEkmConnection(request: google.cloud.kms.v1.IUpdateEkmConnectionRequest): Promise; + + /** + * Calls GetEkmConfig. + * @param request GetEkmConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EkmConfig + */ + public getEkmConfig(request: google.cloud.kms.v1.IGetEkmConfigRequest, callback: google.cloud.kms.v1.EkmService.GetEkmConfigCallback): void; + + /** + * Calls GetEkmConfig. + * @param request GetEkmConfigRequest message or plain object + * @returns Promise + */ + public getEkmConfig(request: google.cloud.kms.v1.IGetEkmConfigRequest): Promise; + + /** + * Calls UpdateEkmConfig. + * @param request UpdateEkmConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EkmConfig + */ + public updateEkmConfig(request: google.cloud.kms.v1.IUpdateEkmConfigRequest, callback: google.cloud.kms.v1.EkmService.UpdateEkmConfigCallback): void; + + /** + * Calls UpdateEkmConfig. + * @param request UpdateEkmConfigRequest message or plain object + * @returns Promise + */ + public updateEkmConfig(request: google.cloud.kms.v1.IUpdateEkmConfigRequest): Promise; } namespace EkmService { @@ -132,6 +160,20 @@ export namespace google { * @param [response] EkmConnection */ type UpdateEkmConnectionCallback = (error: (Error|null), response?: google.cloud.kms.v1.EkmConnection) => void; + + /** + * Callback as used by {@link google.cloud.kms.v1.EkmService|getEkmConfig}. + * @param error Error, if any + * @param [response] EkmConfig + */ + type GetEkmConfigCallback = (error: (Error|null), response?: google.cloud.kms.v1.EkmConfig) => void; + + /** + * Callback as used by {@link google.cloud.kms.v1.EkmService|updateEkmConfig}. + * @param error Error, if any + * @param [response] EkmConfig + */ + type UpdateEkmConfigCallback = (error: (Error|null), response?: google.cloud.kms.v1.EkmConfig) => void; } /** Properties of a ListEkmConnectionsRequest. */ @@ -673,6 +715,206 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GetEkmConfigRequest. */ + interface IGetEkmConfigRequest { + + /** GetEkmConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetEkmConfigRequest. */ + class GetEkmConfigRequest implements IGetEkmConfigRequest { + + /** + * Constructs a new GetEkmConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IGetEkmConfigRequest); + + /** GetEkmConfigRequest name. */ + public name: string; + + /** + * Creates a new GetEkmConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEkmConfigRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IGetEkmConfigRequest): google.cloud.kms.v1.GetEkmConfigRequest; + + /** + * Encodes the specified GetEkmConfigRequest message. Does not implicitly {@link google.cloud.kms.v1.GetEkmConfigRequest.verify|verify} messages. + * @param message GetEkmConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IGetEkmConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEkmConfigRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetEkmConfigRequest.verify|verify} messages. + * @param message GetEkmConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IGetEkmConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEkmConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEkmConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetEkmConfigRequest; + + /** + * Decodes a GetEkmConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEkmConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetEkmConfigRequest; + + /** + * Verifies a GetEkmConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEkmConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEkmConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetEkmConfigRequest; + + /** + * Creates a plain object from a GetEkmConfigRequest message. Also converts values to other types if specified. + * @param message GetEkmConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.GetEkmConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEkmConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEkmConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEkmConfigRequest. */ + interface IUpdateEkmConfigRequest { + + /** UpdateEkmConfigRequest ekmConfig */ + ekmConfig?: (google.cloud.kms.v1.IEkmConfig|null); + + /** UpdateEkmConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEkmConfigRequest. */ + class UpdateEkmConfigRequest implements IUpdateEkmConfigRequest { + + /** + * Constructs a new UpdateEkmConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IUpdateEkmConfigRequest); + + /** UpdateEkmConfigRequest ekmConfig. */ + public ekmConfig?: (google.cloud.kms.v1.IEkmConfig|null); + + /** UpdateEkmConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEkmConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEkmConfigRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IUpdateEkmConfigRequest): google.cloud.kms.v1.UpdateEkmConfigRequest; + + /** + * Encodes the specified UpdateEkmConfigRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateEkmConfigRequest.verify|verify} messages. + * @param message UpdateEkmConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IUpdateEkmConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEkmConfigRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateEkmConfigRequest.verify|verify} messages. + * @param message UpdateEkmConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IUpdateEkmConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEkmConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEkmConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.UpdateEkmConfigRequest; + + /** + * Decodes an UpdateEkmConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEkmConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.UpdateEkmConfigRequest; + + /** + * Verifies an UpdateEkmConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateEkmConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEkmConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.UpdateEkmConfigRequest; + + /** + * Creates a plain object from an UpdateEkmConfigRequest message. Also converts values to other types if specified. + * @param message UpdateEkmConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.UpdateEkmConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEkmConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEkmConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Certificate. */ interface ICertificate { @@ -832,6 +1074,12 @@ export namespace google { /** EkmConnection etag */ etag?: (string|null); + + /** EkmConnection keyManagementMode */ + keyManagementMode?: (google.cloud.kms.v1.EkmConnection.KeyManagementMode|keyof typeof google.cloud.kms.v1.EkmConnection.KeyManagementMode|null); + + /** EkmConnection cryptoSpacePath */ + cryptoSpacePath?: (string|null); } /** Represents an EkmConnection. */ @@ -855,6 +1103,12 @@ export namespace google { /** EkmConnection etag. */ public etag: string; + /** EkmConnection keyManagementMode. */ + public keyManagementMode: (google.cloud.kms.v1.EkmConnection.KeyManagementMode|keyof typeof google.cloud.kms.v1.EkmConnection.KeyManagementMode); + + /** EkmConnection cryptoSpacePath. */ + public cryptoSpacePath: string; + /** * Creates a new EkmConnection instance using the specified properties. * @param [properties] Properties to set @@ -1049,6 +1303,116 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** KeyManagementMode enum. */ + enum KeyManagementMode { + KEY_MANAGEMENT_MODE_UNSPECIFIED = 0, + MANUAL = 1, + CLOUD_KMS = 2 + } + } + + /** Properties of an EkmConfig. */ + interface IEkmConfig { + + /** EkmConfig name */ + name?: (string|null); + + /** EkmConfig defaultEkmConnection */ + defaultEkmConnection?: (string|null); + } + + /** Represents an EkmConfig. */ + class EkmConfig implements IEkmConfig { + + /** + * Constructs a new EkmConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IEkmConfig); + + /** EkmConfig name. */ + public name: string; + + /** EkmConfig defaultEkmConnection. */ + public defaultEkmConnection: string; + + /** + * Creates a new EkmConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EkmConfig instance + */ + public static create(properties?: google.cloud.kms.v1.IEkmConfig): google.cloud.kms.v1.EkmConfig; + + /** + * Encodes the specified EkmConfig message. Does not implicitly {@link google.cloud.kms.v1.EkmConfig.verify|verify} messages. + * @param message EkmConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IEkmConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EkmConfig message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EkmConfig.verify|verify} messages. + * @param message EkmConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IEkmConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EkmConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EkmConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.EkmConfig; + + /** + * Decodes an EkmConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EkmConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.EkmConfig; + + /** + * Verifies an EkmConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EkmConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EkmConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.EkmConfig; + + /** + * Creates a plain object from an EkmConfig message. Also converts values to other types if specified. + * @param message EkmConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.EkmConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EkmConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EkmConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a KeyRing. */ @@ -1696,6 +2060,12 @@ export namespace google { /** CryptoKeyVersion importFailureReason */ importFailureReason?: (string|null); + /** CryptoKeyVersion generationFailureReason */ + generationFailureReason?: (string|null); + + /** CryptoKeyVersion externalDestructionFailureReason */ + externalDestructionFailureReason?: (string|null); + /** CryptoKeyVersion externalProtectionLevelOptions */ externalProtectionLevelOptions?: (google.cloud.kms.v1.IExternalProtectionLevelOptions|null); @@ -1748,6 +2118,12 @@ export namespace google { /** CryptoKeyVersion importFailureReason. */ public importFailureReason: string; + /** CryptoKeyVersion generationFailureReason. */ + public generationFailureReason: string; + + /** CryptoKeyVersion externalDestructionFailureReason. */ + public externalDestructionFailureReason: string; + /** CryptoKeyVersion externalProtectionLevelOptions. */ public externalProtectionLevelOptions?: (google.cloud.kms.v1.IExternalProtectionLevelOptions|null); @@ -1876,7 +2252,10 @@ export namespace google { DESTROYED = 3, DESTROY_SCHEDULED = 4, PENDING_IMPORT = 6, - IMPORT_FAILED = 7 + IMPORT_FAILED = 7, + GENERATION_FAILED = 8, + PENDING_EXTERNAL_DESTRUCTION = 9, + EXTERNAL_DESTRUCTION_FAILED = 10 } /** CryptoKeyVersionView enum. */ diff --git a/packages/google-cloud-kms/protos/protos.js b/packages/google-cloud-kms/protos/protos.js index 2d5b9a64afb..da1e3741c07 100644 --- a/packages/google-cloud-kms/protos/protos.js +++ b/packages/google-cloud-kms/protos/protos.js @@ -230,6 +230,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.kms.v1.EkmService|getEkmConfig}. + * @memberof google.cloud.kms.v1.EkmService + * @typedef GetEkmConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.EkmConfig} [response] EkmConfig + */ + + /** + * Calls GetEkmConfig. + * @function getEkmConfig + * @memberof google.cloud.kms.v1.EkmService + * @instance + * @param {google.cloud.kms.v1.IGetEkmConfigRequest} request GetEkmConfigRequest message or plain object + * @param {google.cloud.kms.v1.EkmService.GetEkmConfigCallback} callback Node-style callback called with the error, if any, and EkmConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EkmService.prototype.getEkmConfig = function getEkmConfig(request, callback) { + return this.rpcCall(getEkmConfig, $root.google.cloud.kms.v1.GetEkmConfigRequest, $root.google.cloud.kms.v1.EkmConfig, request, callback); + }, "name", { value: "GetEkmConfig" }); + + /** + * Calls GetEkmConfig. + * @function getEkmConfig + * @memberof google.cloud.kms.v1.EkmService + * @instance + * @param {google.cloud.kms.v1.IGetEkmConfigRequest} request GetEkmConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.kms.v1.EkmService|updateEkmConfig}. + * @memberof google.cloud.kms.v1.EkmService + * @typedef UpdateEkmConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.EkmConfig} [response] EkmConfig + */ + + /** + * Calls UpdateEkmConfig. + * @function updateEkmConfig + * @memberof google.cloud.kms.v1.EkmService + * @instance + * @param {google.cloud.kms.v1.IUpdateEkmConfigRequest} request UpdateEkmConfigRequest message or plain object + * @param {google.cloud.kms.v1.EkmService.UpdateEkmConfigCallback} callback Node-style callback called with the error, if any, and EkmConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EkmService.prototype.updateEkmConfig = function updateEkmConfig(request, callback) { + return this.rpcCall(updateEkmConfig, $root.google.cloud.kms.v1.UpdateEkmConfigRequest, $root.google.cloud.kms.v1.EkmConfig, request, callback); + }, "name", { value: "UpdateEkmConfig" }); + + /** + * Calls UpdateEkmConfig. + * @function updateEkmConfig + * @memberof google.cloud.kms.v1.EkmService + * @instance + * @param {google.cloud.kms.v1.IUpdateEkmConfigRequest} request UpdateEkmConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return EkmService; })(); @@ -1358,12 +1424,452 @@ UpdateEkmConnectionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateEkmConnectionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateEkmConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ekmConnection = $root.google.cloud.kms.v1.EkmConnection.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEkmConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.UpdateEkmConnectionRequest} UpdateEkmConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEkmConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEkmConnectionRequest message. + * @function verify + * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEkmConnectionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ekmConnection != null && message.hasOwnProperty("ekmConnection")) { + var error = $root.google.cloud.kms.v1.EkmConnection.verify(message.ekmConnection); + if (error) + return "ekmConnection." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEkmConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.UpdateEkmConnectionRequest} UpdateEkmConnectionRequest + */ + UpdateEkmConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.UpdateEkmConnectionRequest) + return object; + var message = new $root.google.cloud.kms.v1.UpdateEkmConnectionRequest(); + if (object.ekmConnection != null) { + if (typeof object.ekmConnection !== "object") + throw TypeError(".google.cloud.kms.v1.UpdateEkmConnectionRequest.ekmConnection: object expected"); + message.ekmConnection = $root.google.cloud.kms.v1.EkmConnection.fromObject(object.ekmConnection); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.kms.v1.UpdateEkmConnectionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEkmConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @static + * @param {google.cloud.kms.v1.UpdateEkmConnectionRequest} message UpdateEkmConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEkmConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ekmConnection = null; + object.updateMask = null; + } + if (message.ekmConnection != null && message.hasOwnProperty("ekmConnection")) + object.ekmConnection = $root.google.cloud.kms.v1.EkmConnection.toObject(message.ekmConnection, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEkmConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEkmConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEkmConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEkmConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.kms.v1.UpdateEkmConnectionRequest"; + }; + + return UpdateEkmConnectionRequest; + })(); + + v1.GetEkmConfigRequest = (function() { + + /** + * Properties of a GetEkmConfigRequest. + * @memberof google.cloud.kms.v1 + * @interface IGetEkmConfigRequest + * @property {string|null} [name] GetEkmConfigRequest name + */ + + /** + * Constructs a new GetEkmConfigRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a GetEkmConfigRequest. + * @implements IGetEkmConfigRequest + * @constructor + * @param {google.cloud.kms.v1.IGetEkmConfigRequest=} [properties] Properties to set + */ + function GetEkmConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEkmConfigRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @instance + */ + GetEkmConfigRequest.prototype.name = ""; + + /** + * Creates a new GetEkmConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {google.cloud.kms.v1.IGetEkmConfigRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.GetEkmConfigRequest} GetEkmConfigRequest instance + */ + GetEkmConfigRequest.create = function create(properties) { + return new GetEkmConfigRequest(properties); + }; + + /** + * Encodes the specified GetEkmConfigRequest message. Does not implicitly {@link google.cloud.kms.v1.GetEkmConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {google.cloud.kms.v1.IGetEkmConfigRequest} message GetEkmConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEkmConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetEkmConfigRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetEkmConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {google.cloud.kms.v1.IGetEkmConfigRequest} message GetEkmConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEkmConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEkmConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.GetEkmConfigRequest} GetEkmConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEkmConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetEkmConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEkmConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.GetEkmConfigRequest} GetEkmConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEkmConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEkmConfigRequest message. + * @function verify + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEkmConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetEkmConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.GetEkmConfigRequest} GetEkmConfigRequest + */ + GetEkmConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.GetEkmConfigRequest) + return object; + var message = new $root.google.cloud.kms.v1.GetEkmConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEkmConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {google.cloud.kms.v1.GetEkmConfigRequest} message GetEkmConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEkmConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetEkmConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetEkmConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEkmConfigRequest + * @function getTypeUrl + * @memberof google.cloud.kms.v1.GetEkmConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEkmConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.kms.v1.GetEkmConfigRequest"; + }; + + return GetEkmConfigRequest; + })(); + + v1.UpdateEkmConfigRequest = (function() { + + /** + * Properties of an UpdateEkmConfigRequest. + * @memberof google.cloud.kms.v1 + * @interface IUpdateEkmConfigRequest + * @property {google.cloud.kms.v1.IEkmConfig|null} [ekmConfig] UpdateEkmConfigRequest ekmConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEkmConfigRequest updateMask + */ + + /** + * Constructs a new UpdateEkmConfigRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an UpdateEkmConfigRequest. + * @implements IUpdateEkmConfigRequest + * @constructor + * @param {google.cloud.kms.v1.IUpdateEkmConfigRequest=} [properties] Properties to set + */ + function UpdateEkmConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEkmConfigRequest ekmConfig. + * @member {google.cloud.kms.v1.IEkmConfig|null|undefined} ekmConfig + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest + * @instance + */ + UpdateEkmConfigRequest.prototype.ekmConfig = null; + + /** + * UpdateEkmConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest + * @instance + */ + UpdateEkmConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEkmConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest + * @static + * @param {google.cloud.kms.v1.IUpdateEkmConfigRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.UpdateEkmConfigRequest} UpdateEkmConfigRequest instance + */ + UpdateEkmConfigRequest.create = function create(properties) { + return new UpdateEkmConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateEkmConfigRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateEkmConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest + * @static + * @param {google.cloud.kms.v1.IUpdateEkmConfigRequest} message UpdateEkmConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEkmConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ekmConfig != null && Object.hasOwnProperty.call(message, "ekmConfig")) + $root.google.cloud.kms.v1.EkmConfig.encode(message.ekmConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEkmConfigRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateEkmConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest + * @static + * @param {google.cloud.kms.v1.IUpdateEkmConfigRequest} message UpdateEkmConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEkmConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEkmConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.UpdateEkmConfigRequest} UpdateEkmConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEkmConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateEkmConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.ekmConnection = $root.google.cloud.kms.v1.EkmConnection.decode(reader, reader.uint32()); + message.ekmConfig = $root.google.cloud.kms.v1.EkmConfig.decode(reader, reader.uint32()); break; } case 2: { @@ -1379,36 +1885,36 @@ }; /** - * Decodes an UpdateEkmConnectionRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateEkmConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.UpdateEkmConnectionRequest} UpdateEkmConnectionRequest + * @returns {google.cloud.kms.v1.UpdateEkmConfigRequest} UpdateEkmConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateEkmConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateEkmConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateEkmConnectionRequest message. + * Verifies an UpdateEkmConfigRequest message. * @function verify - * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateEkmConnectionRequest.verify = function verify(message) { + UpdateEkmConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.ekmConnection != null && message.hasOwnProperty("ekmConnection")) { - var error = $root.google.cloud.kms.v1.EkmConnection.verify(message.ekmConnection); + if (message.ekmConfig != null && message.hasOwnProperty("ekmConfig")) { + var error = $root.google.cloud.kms.v1.EkmConfig.verify(message.ekmConfig); if (error) - return "ekmConnection." + error; + return "ekmConfig." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); @@ -1419,81 +1925,81 @@ }; /** - * Creates an UpdateEkmConnectionRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateEkmConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.UpdateEkmConnectionRequest} UpdateEkmConnectionRequest + * @returns {google.cloud.kms.v1.UpdateEkmConfigRequest} UpdateEkmConfigRequest */ - UpdateEkmConnectionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.UpdateEkmConnectionRequest) + UpdateEkmConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.UpdateEkmConfigRequest) return object; - var message = new $root.google.cloud.kms.v1.UpdateEkmConnectionRequest(); - if (object.ekmConnection != null) { - if (typeof object.ekmConnection !== "object") - throw TypeError(".google.cloud.kms.v1.UpdateEkmConnectionRequest.ekmConnection: object expected"); - message.ekmConnection = $root.google.cloud.kms.v1.EkmConnection.fromObject(object.ekmConnection); + var message = new $root.google.cloud.kms.v1.UpdateEkmConfigRequest(); + if (object.ekmConfig != null) { + if (typeof object.ekmConfig !== "object") + throw TypeError(".google.cloud.kms.v1.UpdateEkmConfigRequest.ekmConfig: object expected"); + message.ekmConfig = $root.google.cloud.kms.v1.EkmConfig.fromObject(object.ekmConfig); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.kms.v1.UpdateEkmConnectionRequest.updateMask: object expected"); + throw TypeError(".google.cloud.kms.v1.UpdateEkmConfigRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from an UpdateEkmConnectionRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateEkmConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest * @static - * @param {google.cloud.kms.v1.UpdateEkmConnectionRequest} message UpdateEkmConnectionRequest + * @param {google.cloud.kms.v1.UpdateEkmConfigRequest} message UpdateEkmConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateEkmConnectionRequest.toObject = function toObject(message, options) { + UpdateEkmConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.ekmConnection = null; + object.ekmConfig = null; object.updateMask = null; } - if (message.ekmConnection != null && message.hasOwnProperty("ekmConnection")) - object.ekmConnection = $root.google.cloud.kms.v1.EkmConnection.toObject(message.ekmConnection, options); + if (message.ekmConfig != null && message.hasOwnProperty("ekmConfig")) + object.ekmConfig = $root.google.cloud.kms.v1.EkmConfig.toObject(message.ekmConfig, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this UpdateEkmConnectionRequest to JSON. + * Converts this UpdateEkmConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest * @instance * @returns {Object.} JSON object */ - UpdateEkmConnectionRequest.prototype.toJSON = function toJSON() { + UpdateEkmConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateEkmConnectionRequest + * Gets the default type url for UpdateEkmConfigRequest * @function getTypeUrl - * @memberof google.cloud.kms.v1.UpdateEkmConnectionRequest + * @memberof google.cloud.kms.v1.UpdateEkmConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateEkmConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateEkmConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.kms.v1.UpdateEkmConnectionRequest"; + return typeUrlPrefix + "/google.cloud.kms.v1.UpdateEkmConfigRequest"; }; - return UpdateEkmConnectionRequest; + return UpdateEkmConfigRequest; })(); v1.Certificate = (function() { @@ -1930,6 +2436,8 @@ * @property {google.protobuf.ITimestamp|null} [createTime] EkmConnection createTime * @property {Array.|null} [serviceResolvers] EkmConnection serviceResolvers * @property {string|null} [etag] EkmConnection etag + * @property {google.cloud.kms.v1.EkmConnection.KeyManagementMode|null} [keyManagementMode] EkmConnection keyManagementMode + * @property {string|null} [cryptoSpacePath] EkmConnection cryptoSpacePath */ /** @@ -1980,6 +2488,22 @@ */ EkmConnection.prototype.etag = ""; + /** + * EkmConnection keyManagementMode. + * @member {google.cloud.kms.v1.EkmConnection.KeyManagementMode} keyManagementMode + * @memberof google.cloud.kms.v1.EkmConnection + * @instance + */ + EkmConnection.prototype.keyManagementMode = 0; + + /** + * EkmConnection cryptoSpacePath. + * @member {string} cryptoSpacePath + * @memberof google.cloud.kms.v1.EkmConnection + * @instance + */ + EkmConnection.prototype.cryptoSpacePath = ""; + /** * Creates a new EkmConnection instance using the specified properties. * @function create @@ -2013,6 +2537,10 @@ $root.google.cloud.kms.v1.EkmConnection.ServiceResolver.encode(message.serviceResolvers[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + if (message.keyManagementMode != null && Object.hasOwnProperty.call(message, "keyManagementMode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.keyManagementMode); + if (message.cryptoSpacePath != null && Object.hasOwnProperty.call(message, "cryptoSpacePath")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cryptoSpacePath); return writer; }; @@ -2065,6 +2593,14 @@ message.etag = reader.string(); break; } + case 6: { + message.keyManagementMode = reader.int32(); + break; + } + case 7: { + message.cryptoSpacePath = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2120,6 +2656,18 @@ if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; + if (message.keyManagementMode != null && message.hasOwnProperty("keyManagementMode")) + switch (message.keyManagementMode) { + default: + return "keyManagementMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.cryptoSpacePath != null && message.hasOwnProperty("cryptoSpacePath")) + if (!$util.isString(message.cryptoSpacePath)) + return "cryptoSpacePath: string expected"; return null; }; @@ -2154,6 +2702,28 @@ } if (object.etag != null) message.etag = String(object.etag); + switch (object.keyManagementMode) { + default: + if (typeof object.keyManagementMode === "number") { + message.keyManagementMode = object.keyManagementMode; + break; + } + break; + case "KEY_MANAGEMENT_MODE_UNSPECIFIED": + case 0: + message.keyManagementMode = 0; + break; + case "MANUAL": + case 1: + message.keyManagementMode = 1; + break; + case "CLOUD_KMS": + case 2: + message.keyManagementMode = 2; + break; + } + if (object.cryptoSpacePath != null) + message.cryptoSpacePath = String(object.cryptoSpacePath); return message; }; @@ -2176,6 +2746,8 @@ object.name = ""; object.createTime = null; object.etag = ""; + object.keyManagementMode = options.enums === String ? "KEY_MANAGEMENT_MODE_UNSPECIFIED" : 0; + object.cryptoSpacePath = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2188,6 +2760,10 @@ } if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; + if (message.keyManagementMode != null && message.hasOwnProperty("keyManagementMode")) + object.keyManagementMode = options.enums === String ? $root.google.cloud.kms.v1.EkmConnection.KeyManagementMode[message.keyManagementMode] === undefined ? message.keyManagementMode : $root.google.cloud.kms.v1.EkmConnection.KeyManagementMode[message.keyManagementMode] : message.keyManagementMode; + if (message.cryptoSpacePath != null && message.hasOwnProperty("cryptoSpacePath")) + object.cryptoSpacePath = message.cryptoSpacePath; return object; }; @@ -2512,9 +3088,252 @@ return ServiceResolver; })(); + /** + * KeyManagementMode enum. + * @name google.cloud.kms.v1.EkmConnection.KeyManagementMode + * @enum {number} + * @property {number} KEY_MANAGEMENT_MODE_UNSPECIFIED=0 KEY_MANAGEMENT_MODE_UNSPECIFIED value + * @property {number} MANUAL=1 MANUAL value + * @property {number} CLOUD_KMS=2 CLOUD_KMS value + */ + EkmConnection.KeyManagementMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_MANAGEMENT_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MANUAL"] = 1; + values[valuesById[2] = "CLOUD_KMS"] = 2; + return values; + })(); + return EkmConnection; })(); + v1.EkmConfig = (function() { + + /** + * Properties of an EkmConfig. + * @memberof google.cloud.kms.v1 + * @interface IEkmConfig + * @property {string|null} [name] EkmConfig name + * @property {string|null} [defaultEkmConnection] EkmConfig defaultEkmConnection + */ + + /** + * Constructs a new EkmConfig. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an EkmConfig. + * @implements IEkmConfig + * @constructor + * @param {google.cloud.kms.v1.IEkmConfig=} [properties] Properties to set + */ + function EkmConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EkmConfig name. + * @member {string} name + * @memberof google.cloud.kms.v1.EkmConfig + * @instance + */ + EkmConfig.prototype.name = ""; + + /** + * EkmConfig defaultEkmConnection. + * @member {string} defaultEkmConnection + * @memberof google.cloud.kms.v1.EkmConfig + * @instance + */ + EkmConfig.prototype.defaultEkmConnection = ""; + + /** + * Creates a new EkmConfig instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {google.cloud.kms.v1.IEkmConfig=} [properties] Properties to set + * @returns {google.cloud.kms.v1.EkmConfig} EkmConfig instance + */ + EkmConfig.create = function create(properties) { + return new EkmConfig(properties); + }; + + /** + * Encodes the specified EkmConfig message. Does not implicitly {@link google.cloud.kms.v1.EkmConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {google.cloud.kms.v1.IEkmConfig} message EkmConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EkmConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.defaultEkmConnection != null && Object.hasOwnProperty.call(message, "defaultEkmConnection")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultEkmConnection); + return writer; + }; + + /** + * Encodes the specified EkmConfig message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EkmConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {google.cloud.kms.v1.IEkmConfig} message EkmConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EkmConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EkmConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.EkmConfig} EkmConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EkmConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.EkmConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.defaultEkmConnection = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EkmConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.EkmConfig} EkmConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EkmConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EkmConfig message. + * @function verify + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EkmConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.defaultEkmConnection != null && message.hasOwnProperty("defaultEkmConnection")) + if (!$util.isString(message.defaultEkmConnection)) + return "defaultEkmConnection: string expected"; + return null; + }; + + /** + * Creates an EkmConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.EkmConfig} EkmConfig + */ + EkmConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.EkmConfig) + return object; + var message = new $root.google.cloud.kms.v1.EkmConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.defaultEkmConnection != null) + message.defaultEkmConnection = String(object.defaultEkmConnection); + return message; + }; + + /** + * Creates a plain object from an EkmConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {google.cloud.kms.v1.EkmConfig} message EkmConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EkmConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.defaultEkmConnection = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.defaultEkmConnection != null && message.hasOwnProperty("defaultEkmConnection")) + object.defaultEkmConnection = message.defaultEkmConnection; + return object; + }; + + /** + * Converts this EkmConfig to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.EkmConfig + * @instance + * @returns {Object.} JSON object + */ + EkmConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EkmConfig + * @function getTypeUrl + * @memberof google.cloud.kms.v1.EkmConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EkmConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.kms.v1.EkmConfig"; + }; + + return EkmConfig; + })(); + v1.KeyRing = (function() { /** @@ -4356,6 +5175,8 @@ * @property {string|null} [importJob] CryptoKeyVersion importJob * @property {google.protobuf.ITimestamp|null} [importTime] CryptoKeyVersion importTime * @property {string|null} [importFailureReason] CryptoKeyVersion importFailureReason + * @property {string|null} [generationFailureReason] CryptoKeyVersion generationFailureReason + * @property {string|null} [externalDestructionFailureReason] CryptoKeyVersion externalDestructionFailureReason * @property {google.cloud.kms.v1.IExternalProtectionLevelOptions|null} [externalProtectionLevelOptions] CryptoKeyVersion externalProtectionLevelOptions * @property {boolean|null} [reimportEligible] CryptoKeyVersion reimportEligible */ @@ -4471,6 +5292,22 @@ */ CryptoKeyVersion.prototype.importFailureReason = ""; + /** + * CryptoKeyVersion generationFailureReason. + * @member {string} generationFailureReason + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.generationFailureReason = ""; + + /** + * CryptoKeyVersion externalDestructionFailureReason. + * @member {string} externalDestructionFailureReason + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.externalDestructionFailureReason = ""; + /** * CryptoKeyVersion externalProtectionLevelOptions. * @member {google.cloud.kms.v1.IExternalProtectionLevelOptions|null|undefined} externalProtectionLevelOptions @@ -4539,6 +5376,10 @@ $root.google.cloud.kms.v1.ExternalProtectionLevelOptions.encode(message.externalProtectionLevelOptions, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); if (message.reimportEligible != null && Object.hasOwnProperty.call(message, "reimportEligible")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.reimportEligible); + if (message.generationFailureReason != null && Object.hasOwnProperty.call(message, "generationFailureReason")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.generationFailureReason); + if (message.externalDestructionFailureReason != null && Object.hasOwnProperty.call(message, "externalDestructionFailureReason")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.externalDestructionFailureReason); return writer; }; @@ -4621,6 +5462,14 @@ message.importFailureReason = reader.string(); break; } + case 19: { + message.generationFailureReason = reader.string(); + break; + } + case 20: { + message.externalDestructionFailureReason = reader.string(); + break; + } case 17: { message.externalProtectionLevelOptions = $root.google.cloud.kms.v1.ExternalProtectionLevelOptions.decode(reader, reader.uint32()); break; @@ -4679,6 +5528,9 @@ case 4: case 6: case 7: + case 8: + case 9: + case 10: break; } if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) @@ -4763,6 +5615,12 @@ if (message.importFailureReason != null && message.hasOwnProperty("importFailureReason")) if (!$util.isString(message.importFailureReason)) return "importFailureReason: string expected"; + if (message.generationFailureReason != null && message.hasOwnProperty("generationFailureReason")) + if (!$util.isString(message.generationFailureReason)) + return "generationFailureReason: string expected"; + if (message.externalDestructionFailureReason != null && message.hasOwnProperty("externalDestructionFailureReason")) + if (!$util.isString(message.externalDestructionFailureReason)) + return "externalDestructionFailureReason: string expected"; if (message.externalProtectionLevelOptions != null && message.hasOwnProperty("externalProtectionLevelOptions")) { var error = $root.google.cloud.kms.v1.ExternalProtectionLevelOptions.verify(message.externalProtectionLevelOptions); if (error) @@ -4827,6 +5685,18 @@ case 7: message.state = 7; break; + case "GENERATION_FAILED": + case 8: + message.state = 8; + break; + case "PENDING_EXTERNAL_DESTRUCTION": + case 9: + message.state = 9; + break; + case "EXTERNAL_DESTRUCTION_FAILED": + case 10: + message.state = 10; + break; } switch (object.protectionLevel) { default: @@ -5014,6 +5884,10 @@ } if (object.importFailureReason != null) message.importFailureReason = String(object.importFailureReason); + if (object.generationFailureReason != null) + message.generationFailureReason = String(object.generationFailureReason); + if (object.externalDestructionFailureReason != null) + message.externalDestructionFailureReason = String(object.externalDestructionFailureReason); if (object.externalProtectionLevelOptions != null) { if (typeof object.externalProtectionLevelOptions !== "object") throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.externalProtectionLevelOptions: object expected"); @@ -5052,6 +5926,8 @@ object.importFailureReason = ""; object.externalProtectionLevelOptions = null; object.reimportEligible = false; + object.generationFailureReason = ""; + object.externalDestructionFailureReason = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5081,6 +5957,10 @@ object.externalProtectionLevelOptions = $root.google.cloud.kms.v1.ExternalProtectionLevelOptions.toObject(message.externalProtectionLevelOptions, options); if (message.reimportEligible != null && message.hasOwnProperty("reimportEligible")) object.reimportEligible = message.reimportEligible; + if (message.generationFailureReason != null && message.hasOwnProperty("generationFailureReason")) + object.generationFailureReason = message.generationFailureReason; + if (message.externalDestructionFailureReason != null && message.hasOwnProperty("externalDestructionFailureReason")) + object.externalDestructionFailureReason = message.externalDestructionFailureReason; return object; }; @@ -5190,6 +6070,9 @@ * @property {number} DESTROY_SCHEDULED=4 DESTROY_SCHEDULED value * @property {number} PENDING_IMPORT=6 PENDING_IMPORT value * @property {number} IMPORT_FAILED=7 IMPORT_FAILED value + * @property {number} GENERATION_FAILED=8 GENERATION_FAILED value + * @property {number} PENDING_EXTERNAL_DESTRUCTION=9 PENDING_EXTERNAL_DESTRUCTION value + * @property {number} EXTERNAL_DESTRUCTION_FAILED=10 EXTERNAL_DESTRUCTION_FAILED value */ CryptoKeyVersion.CryptoKeyVersionState = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -5201,6 +6084,9 @@ values[valuesById[4] = "DESTROY_SCHEDULED"] = 4; values[valuesById[6] = "PENDING_IMPORT"] = 6; values[valuesById[7] = "IMPORT_FAILED"] = 7; + values[valuesById[8] = "GENERATION_FAILED"] = 8; + values[valuesById[9] = "PENDING_EXTERNAL_DESTRUCTION"] = 9; + values[valuesById[10] = "EXTERNAL_DESTRUCTION_FAILED"] = 10; return values; })(); diff --git a/packages/google-cloud-kms/protos/protos.json b/packages/google-cloud-kms/protos/protos.json index 7b248f1317d..ab899061bd4 100644 --- a/packages/google-cloud-kms/protos/protos.json +++ b/packages/google-cloud-kms/protos/protos.json @@ -100,6 +100,44 @@ "(google.api.method_signature)": "ekm_connection,update_mask" } ] + }, + "GetEkmConfig": { + "requestType": "GetEkmConfigRequest", + "responseType": "EkmConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/ekmConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/ekmConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateEkmConfig": { + "requestType": "UpdateEkmConfigRequest", + "responseType": "EkmConfig", + "options": { + "(google.api.http).patch": "/v1/{ekm_config.name=projects/*/locations/*/ekmConfig}", + "(google.api.http).body": "ekm_config", + "(google.api.method_signature)": "ekm_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{ekm_config.name=projects/*/locations/*/ekmConfig}", + "body": "ekm_config" + } + }, + { + "(google.api.method_signature)": "ekm_config,update_mask" + } + ] } } }, @@ -216,6 +254,36 @@ } } }, + "GetEkmConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/EkmConfig" + } + } + } + }, + "UpdateEkmConfigRequest": { + "fields": { + "ekmConfig": { + "type": "EkmConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "Certificate": { "fields": { "rawDer": { @@ -315,6 +383,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "keyManagementMode": { + "type": "KeyManagementMode", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cryptoSpacePath": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -351,6 +433,36 @@ } } } + }, + "KeyManagementMode": { + "values": { + "KEY_MANAGEMENT_MODE_UNSPECIFIED": 0, + "MANUAL": 1, + "CLOUD_KMS": 2 + } + } + } + }, + "EkmConfig": { + "options": { + "(google.api.resource).type": "cloudkms.googleapis.com/EkmConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/ekmConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultEkmConnection": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/EkmConnection" + } } } }, @@ -624,6 +736,20 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "generationFailureReason": { + "type": "string", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalDestructionFailureReason": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "externalProtectionLevelOptions": { "type": "ExternalProtectionLevelOptions", "id": 17 @@ -679,7 +805,10 @@ "DESTROYED": 3, "DESTROY_SCHEDULED": 4, "PENDING_IMPORT": 6, - "IMPORT_FAILED": 7 + "IMPORT_FAILED": 7, + "GENERATION_FAILED": 8, + "PENDING_EXTERNAL_DESTRUCTION": 9, + "EXTERNAL_DESTRUCTION_FAILED": 10 } }, "CryptoKeyVersionView": { diff --git a/packages/google-cloud-kms/samples/README.md b/packages/google-cloud-kms/samples/README.md index bc64bbfe975..15aadb58ca4 100644 --- a/packages/google-cloud-kms/samples/README.md +++ b/packages/google-cloud-kms/samples/README.md @@ -13,8 +13,10 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) * [Ekm_service.create_ekm_connection](#ekm_service.create_ekm_connection) + * [Ekm_service.get_ekm_config](#ekm_service.get_ekm_config) * [Ekm_service.get_ekm_connection](#ekm_service.get_ekm_connection) * [Ekm_service.list_ekm_connections](#ekm_service.list_ekm_connections) + * [Ekm_service.update_ekm_config](#ekm_service.update_ekm_config) * [Ekm_service.update_ekm_connection](#ekm_service.update_ekm_connection) * [Key_management_service.asymmetric_decrypt](#key_management_service.asymmetric_decrypt) * [Key_management_service.asymmetric_sign](#key_management_service.asymmetric_sign) @@ -77,6 +79,23 @@ __Usage:__ +### Ekm_service.get_ekm_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_config.js` + + +----- + + + + ### Ekm_service.get_ekm_connection View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_connection.js). @@ -111,6 +130,23 @@ __Usage:__ +### Ekm_service.update_ekm_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_config.js` + + +----- + + + + ### Ekm_service.update_ekm_connection View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_connection.js). diff --git a/packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_config.js b/packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_config.js new file mode 100644 index 00000000000..1bd4b4ca6fc --- /dev/null +++ b/packages/google-cloud-kms/samples/generated/v1/ekm_service.get_ekm_config.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudkms_v1_generated_EkmService_GetEkmConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name google.cloud.kms.v1.EkmConfig.name of the + * EkmConfig google.cloud.kms.v1.EkmConfig to get. + */ + // const name = 'abc123' + + // Imports the Kms library + const {EkmServiceClient} = require('@google-cloud/kms').v1; + + // Instantiates a client + const kmsClient = new EkmServiceClient(); + + async function callGetEkmConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await kmsClient.getEkmConfig(request); + console.log(response); + } + + callGetEkmConfig(); + // [END cloudkms_v1_generated_EkmService_GetEkmConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_config.js b/packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_config.js new file mode 100644 index 00000000000..58d479ffd12 --- /dev/null +++ b/packages/google-cloud-kms/samples/generated/v1/ekm_service.update_ekm_config.js @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(ekmConfig, updateMask) { + // [START cloudkms_v1_generated_EkmService_UpdateEkmConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. EkmConfig google.cloud.kms.v1.EkmConfig with updated values. + */ + // const ekmConfig = {} + /** + * Required. List of fields to be updated in this request. + */ + // const updateMask = {} + + // Imports the Kms library + const {EkmServiceClient} = require('@google-cloud/kms').v1; + + // Instantiates a client + const kmsClient = new EkmServiceClient(); + + async function callUpdateEkmConfig() { + // Construct request + const request = { + ekmConfig, + updateMask, + }; + + // Run request + const response = await kmsClient.updateEkmConfig(request); + console.log(response); + } + + callUpdateEkmConfig(); + // [END cloudkms_v1_generated_EkmService_UpdateEkmConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-kms/samples/generated/v1/snippet_metadata.google.cloud.kms.v1.json b/packages/google-cloud-kms/samples/generated/v1/snippet_metadata.google.cloud.kms.v1.json index 12a819b124e..463f13253dd 100644 --- a/packages/google-cloud-kms/samples/generated/v1/snippet_metadata.google.cloud.kms.v1.json +++ b/packages/google-cloud-kms/samples/generated/v1/snippet_metadata.google.cloud.kms.v1.json @@ -199,6 +199,90 @@ } } }, + { + "regionTag": "cloudkms_v1_generated_EkmService_GetEkmConfig_async", + "title": "EkmService getEkmConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project and location.", + "canonical": true, + "file": "ekm_service.get_ekm_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEkmConfig", + "fullName": "google.cloud.kms.v1.EkmService.GetEkmConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.kms.v1.EkmConfig", + "client": { + "shortName": "EkmServiceClient", + "fullName": "google.cloud.kms.v1.EkmServiceClient" + }, + "method": { + "shortName": "GetEkmConfig", + "fullName": "google.cloud.kms.v1.EkmService.GetEkmConfig", + "service": { + "shortName": "EkmService", + "fullName": "google.cloud.kms.v1.EkmService" + } + } + } + }, + { + "regionTag": "cloudkms_v1_generated_EkmService_UpdateEkmConfig_async", + "title": "EkmService updateEkmConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project and location.", + "canonical": true, + "file": "ekm_service.update_ekm_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEkmConfig", + "fullName": "google.cloud.kms.v1.EkmService.UpdateEkmConfig", + "async": true, + "parameters": [ + { + "name": "ekm_config", + "type": ".google.cloud.kms.v1.EkmConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.kms.v1.EkmConfig", + "client": { + "shortName": "EkmServiceClient", + "fullName": "google.cloud.kms.v1.EkmServiceClient" + }, + "method": { + "shortName": "UpdateEkmConfig", + "fullName": "google.cloud.kms.v1.EkmService.UpdateEkmConfig", + "service": { + "shortName": "EkmService", + "fullName": "google.cloud.kms.v1.EkmService" + } + } + } + }, { "regionTag": "cloudkms_v1_generated_KeyManagementService_ListKeyRings_async", "title": "EkmService listKeyRings Sample", diff --git a/packages/google-cloud-kms/src/v1/ekm_service_client.ts b/packages/google-cloud-kms/src/v1/ekm_service_client.ts index fd260617e78..6301a34a7b1 100644 --- a/packages/google-cloud-kms/src/v1/ekm_service_client.ts +++ b/packages/google-cloud-kms/src/v1/ekm_service_client.ts @@ -200,6 +200,9 @@ export class EkmServiceClient { cryptoKeyVersionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}' ), + ekmConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ekmConfig' + ), ekmConnectionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/ekmConnections/{ekm_connection}' ), @@ -282,6 +285,8 @@ export class EkmServiceClient { 'getEkmConnection', 'createEkmConnection', 'updateEkmConnection', + 'getEkmConfig', + 'updateEkmConfig', ]; for (const methodName of ekmServiceStubMethods) { const callPromise = this.ekmServiceStub.then( @@ -637,6 +642,177 @@ export class EkmServiceClient { this.initialize(); return this.innerApiCalls.updateEkmConnection(request, options, callback); } + /** + * Returns the {@link google.cloud.kms.v1.EkmConfig|EkmConfig} singleton resource + * for a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link google.cloud.kms.v1.EkmConfig.name|name} of the + * {@link google.cloud.kms.v1.EkmConfig|EkmConfig} to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.kms.v1.EkmConfig | EkmConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/ekm_service.get_ekm_config.js + * region_tag:cloudkms_v1_generated_EkmService_GetEkmConfig_async + */ + getEkmConfig( + request?: protos.google.cloud.kms.v1.IGetEkmConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IGetEkmConfigRequest | undefined, + {} | undefined + ] + >; + getEkmConfig( + request: protos.google.cloud.kms.v1.IGetEkmConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IGetEkmConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + getEkmConfig( + request: protos.google.cloud.kms.v1.IGetEkmConfigRequest, + callback: Callback< + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IGetEkmConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + getEkmConfig( + request?: protos.google.cloud.kms.v1.IGetEkmConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IGetEkmConfigRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IGetEkmConfigRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IGetEkmConfigRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEkmConfig(request, options, callback); + } + /** + * Updates the {@link google.cloud.kms.v1.EkmConfig|EkmConfig} singleton resource + * for a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.kms.v1.EkmConfig} request.ekmConfig + * Required. {@link google.cloud.kms.v1.EkmConfig|EkmConfig} with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. List of fields to be updated in this request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.kms.v1.EkmConfig | EkmConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/ekm_service.update_ekm_config.js + * region_tag:cloudkms_v1_generated_EkmService_UpdateEkmConfig_async + */ + updateEkmConfig( + request?: protos.google.cloud.kms.v1.IUpdateEkmConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IUpdateEkmConfigRequest | undefined, + {} | undefined + ] + >; + updateEkmConfig( + request: protos.google.cloud.kms.v1.IUpdateEkmConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IUpdateEkmConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + updateEkmConfig( + request: protos.google.cloud.kms.v1.IUpdateEkmConfigRequest, + callback: Callback< + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IUpdateEkmConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + updateEkmConfig( + request?: protos.google.cloud.kms.v1.IUpdateEkmConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IUpdateEkmConfigRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IUpdateEkmConfigRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.kms.v1.IEkmConfig, + protos.google.cloud.kms.v1.IUpdateEkmConfigRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'ekm_config.name': request.ekmConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEkmConfig(request, options, callback); + } /** * Lists {@link google.cloud.kms.v1.EkmConnection|EkmConnections}. @@ -1264,6 +1440,44 @@ export class EkmServiceClient { ).crypto_key_version; } + /** + * Return a fully-qualified ekmConfig resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + ekmConfigPath(project: string, location: string) { + return this.pathTemplates.ekmConfigPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from EkmConfig resource. + * + * @param {string} ekmConfigName + * A fully-qualified path representing EkmConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEkmConfigName(ekmConfigName: string) { + return this.pathTemplates.ekmConfigPathTemplate.match(ekmConfigName) + .project; + } + + /** + * Parse the location from EkmConfig resource. + * + * @param {string} ekmConfigName + * A fully-qualified path representing EkmConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEkmConfigName(ekmConfigName: string) { + return this.pathTemplates.ekmConfigPathTemplate.match(ekmConfigName) + .location; + } + /** * Return a fully-qualified ekmConnection resource name string. * diff --git a/packages/google-cloud-kms/src/v1/ekm_service_client_config.json b/packages/google-cloud-kms/src/v1/ekm_service_client_config.json index 583df8ce1d9..3e97e7e12e9 100644 --- a/packages/google-cloud-kms/src/v1/ekm_service_client_config.json +++ b/packages/google-cloud-kms/src/v1/ekm_service_client_config.json @@ -39,6 +39,14 @@ "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" + }, + "GetEkmConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEkmConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-kms/src/v1/gapic_metadata.json b/packages/google-cloud-kms/src/v1/gapic_metadata.json index 587790c2d1d..449ae15ed7e 100644 --- a/packages/google-cloud-kms/src/v1/gapic_metadata.json +++ b/packages/google-cloud-kms/src/v1/gapic_metadata.json @@ -25,6 +25,16 @@ "updateEkmConnection" ] }, + "GetEkmConfig": { + "methods": [ + "getEkmConfig" + ] + }, + "UpdateEkmConfig": { + "methods": [ + "updateEkmConfig" + ] + }, "ListEkmConnections": { "methods": [ "listEkmConnections", @@ -52,6 +62,16 @@ "updateEkmConnection" ] }, + "GetEkmConfig": { + "methods": [ + "getEkmConfig" + ] + }, + "UpdateEkmConfig": { + "methods": [ + "updateEkmConfig" + ] + }, "ListEkmConnections": { "methods": [ "listEkmConnections", diff --git a/packages/google-cloud-kms/src/v1/key_management_service_client.ts b/packages/google-cloud-kms/src/v1/key_management_service_client.ts index df4ebb18347..76a7be17d69 100644 --- a/packages/google-cloud-kms/src/v1/key_management_service_client.ts +++ b/packages/google-cloud-kms/src/v1/key_management_service_client.ts @@ -207,6 +207,9 @@ export class KeyManagementServiceClient { cryptoKeyVersionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}' ), + ekmConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ekmConfig' + ), ekmConnectionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/ekmConnections/{ekm_connection}' ), @@ -4179,6 +4182,44 @@ export class KeyManagementServiceClient { ).crypto_key_version; } + /** + * Return a fully-qualified ekmConfig resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + ekmConfigPath(project: string, location: string) { + return this.pathTemplates.ekmConfigPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from EkmConfig resource. + * + * @param {string} ekmConfigName + * A fully-qualified path representing EkmConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEkmConfigName(ekmConfigName: string) { + return this.pathTemplates.ekmConfigPathTemplate.match(ekmConfigName) + .project; + } + + /** + * Parse the location from EkmConfig resource. + * + * @param {string} ekmConfigName + * A fully-qualified path representing EkmConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEkmConfigName(ekmConfigName: string) { + return this.pathTemplates.ekmConfigPathTemplate.match(ekmConfigName) + .location; + } + /** * Return a fully-qualified ekmConnection resource name string. * diff --git a/packages/google-cloud-kms/test/gapic_ekm_service_v1.ts b/packages/google-cloud-kms/test/gapic_ekm_service_v1.ts index 976db784ece..83433e03521 100644 --- a/packages/google-cloud-kms/test/gapic_ekm_service_v1.ts +++ b/packages/google-cloud-kms/test/gapic_ekm_service_v1.ts @@ -621,6 +621,270 @@ describe('v1.EkmServiceClient', () => { }); }); + describe('getEkmConfig', () => { + it('invokes getEkmConfig without error', async () => { + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.kms.v1.GetEkmConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.kms.v1.GetEkmConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.kms.v1.EkmConfig() + ); + client.innerApiCalls.getEkmConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getEkmConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEkmConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEkmConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEkmConfig without error using callback', async () => { + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.kms.v1.GetEkmConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.kms.v1.GetEkmConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.kms.v1.EkmConfig() + ); + client.innerApiCalls.getEkmConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEkmConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.kms.v1.IEkmConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEkmConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEkmConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEkmConfig with error', async () => { + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.kms.v1.GetEkmConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.kms.v1.GetEkmConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEkmConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getEkmConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEkmConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEkmConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEkmConfig with closed client', async () => { + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.kms.v1.GetEkmConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.kms.v1.GetEkmConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEkmConfig(request), expectedError); + }); + }); + + describe('updateEkmConfig', () => { + it('invokes updateEkmConfig without error', async () => { + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.kms.v1.UpdateEkmConfigRequest() + ); + request.ekmConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.kms.v1.UpdateEkmConfigRequest', + ['ekmConfig', 'name'] + ); + request.ekmConfig.name = defaultValue1; + const expectedHeaderRequestParams = `ekm_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.kms.v1.EkmConfig() + ); + client.innerApiCalls.updateEkmConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateEkmConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEkmConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEkmConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEkmConfig without error using callback', async () => { + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.kms.v1.UpdateEkmConfigRequest() + ); + request.ekmConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.kms.v1.UpdateEkmConfigRequest', + ['ekmConfig', 'name'] + ); + request.ekmConfig.name = defaultValue1; + const expectedHeaderRequestParams = `ekm_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.kms.v1.EkmConfig() + ); + client.innerApiCalls.updateEkmConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEkmConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.kms.v1.IEkmConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEkmConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEkmConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEkmConfig with error', async () => { + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.kms.v1.UpdateEkmConfigRequest() + ); + request.ekmConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.kms.v1.UpdateEkmConfigRequest', + ['ekmConfig', 'name'] + ); + request.ekmConfig.name = defaultValue1; + const expectedHeaderRequestParams = `ekm_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEkmConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateEkmConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEkmConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEkmConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEkmConfig with closed client', async () => { + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.kms.v1.UpdateEkmConfigRequest() + ); + request.ekmConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.kms.v1.UpdateEkmConfigRequest', + ['ekmConfig', 'name'] + ); + request.ekmConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEkmConfig(request), expectedError); + }); + }); + describe('listEkmConnections', () => { it('invokes listEkmConnections without error', async () => { const client = new ekmserviceModule.v1.EkmServiceClient({ @@ -1614,6 +1878,55 @@ describe('v1.EkmServiceClient', () => { }); }); + describe('ekmConfig', () => { + const fakePath = '/rendered/path/ekmConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new ekmserviceModule.v1.EkmServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ekmConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ekmConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ekmConfigPath', () => { + const result = client.ekmConfigPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ekmConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEkmConfigName', () => { + const result = client.matchProjectFromEkmConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ekmConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEkmConfigName', () => { + const result = client.matchLocationFromEkmConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ekmConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('ekmConnection', () => { const fakePath = '/rendered/path/ekmConnection'; const expectedParameters = { diff --git a/packages/google-cloud-kms/test/gapic_key_management_service_v1.ts b/packages/google-cloud-kms/test/gapic_key_management_service_v1.ts index eca5d7f8b27..251f6d29c68 100644 --- a/packages/google-cloud-kms/test/gapic_key_management_service_v1.ts +++ b/packages/google-cloud-kms/test/gapic_key_management_service_v1.ts @@ -5194,6 +5194,56 @@ describe('v1.KeyManagementServiceClient', () => { }); }); + describe('ekmConfig', () => { + const fakePath = '/rendered/path/ekmConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new keymanagementserviceModule.v1.KeyManagementServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ekmConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ekmConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ekmConfigPath', () => { + const result = client.ekmConfigPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ekmConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEkmConfigName', () => { + const result = client.matchProjectFromEkmConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ekmConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEkmConfigName', () => { + const result = client.matchLocationFromEkmConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ekmConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('ekmConnection', () => { const fakePath = '/rendered/path/ekmConnection'; const expectedParameters = {