Skip to content

KeyManagementServiceClient is leaked on each call to sign or getPublicKey #6

@nedgar

Description

@nedgar

In src/util/gcp-kms-utils.ts it instantiates a new KeyManagementServiceClient each time sign or getPublicKey is called.
See:

const kms = new KeyManagementServiceClient();

const kms = new KeyManagementServiceClient();

The client maintains a gRPC channel, plus one in its referenced IAM client. close() should be called on the client when it's no longer needed.

The logical lifetime of the client is that of the GcpKmsSigner. I suggest changing it to instantiate the KeyManagementServiceClient, and pass that to the util methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions