Skip to content

v1.0.5

  • v1.0.5
  • d7b7d62
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
  • Choose a tag to compare

  • v1.0.5
  • d7b7d62
  • Choose a tag to compare

  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
@Suhaibinator Suhaibinator tagged this 21 May 05:59
* I've added mTLS support for parameter retrieval.

This change introduces mTLS support for both gRPC and REST clients, allowing for secure communication when you are retrieving parameters.

Key changes:

- `client/grpc_client.go`: I added `GrpcSimpleRetrieveWithMTLS` and `GrpcSimpleStoreWithMTLS` functions that accept client certificate, client key, and CA certificate paths to establish a secure gRPC connection.
- `client/rest_client.go`: I added a `NewAPIClientWithMTLS` function that configures the HTTP client with mTLS certificates. The `APIClient` struct and its methods were updated to use a configurable `http.Client`.
- `config/helper.go`: I updated `ParameterStoreConfig` to include optional fields for mTLS certificate paths (`ClientCertFile`, `ClientKeyFile`, `CACertFile`). The `Init` method now automatically uses gRPC with mTLS if these paths are provided.
- `README.md`: I added documentation explaining how to configure and use mTLS with gRPC, REST clients, and `ParameterStoreConfig`.
- I added unit tests for the new mTLS functionalities in `grpc_client_test.go`, `rest_client_test.go`, and `config_helper_test.go`, including the use of dummy certificate files for testing certificate loading paths.

This enhancement addresses the issue of lacking mTLS support, providing a more secure way for you to interact with the parameter store.

* Fix build errors

* fix build errors

* Fix mTLS tests by generating valid certs

* Update client/grpc_client.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor: Introduce ParameterStoreClient for config

This commit introduces a new ParameterStoreClient struct to encapsulate
parameter store connection details, including host, port, timeout,
mTLS certificate paths, and the parameter store secret.

The following functions and methods were refactored to use the
ParameterStoreClient:
- simpleRetrieveParameterWithTimeout
- setValueIfEmpty
- ParameterStoreConfig.Init

The ParameterStoreConfig struct was updated to remove the fields
ParameterStoreSecret, ClientCertFile, ClientKeyFile, and CACertFile,
as these are now managed by the ParameterStoreClient.

This change simplifies function signatures and centralizes client
configuration, improving code clarity and maintainability.

Unit tests in config/helper_test.go have been updated to reflect
these changes, and new tests for NewParameterStoreClient were added.
You will need to update your code to create and
pass a ParameterStoreClient when initializing ParameterStoreConfig.

* Fix: Correct test compilation error in config package

This commit fixes a "no new variables on left side of :="
compilation error in config/helper_test.go. The error was due to
duplicated variable declarations for 'testHost' and 'testPort'.

The redundant declarations have been removed, and all tests
now pass.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Assets 2
Loading