Skip to content

Conversation

@psasidhar
Copy link
Contributor

Description

Providing KeyStore implementation for GCP using Parameter Manager
Moving common code among Cloud Parameter storage into a static methond in a Util class that can be reused

Contribution Checklist:

  • The pull request does not introduce any breaking changes
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

@psasidhar psasidhar force-pushed the gcp_keystore branch 7 times, most recently from 8eb78fb to 80c4496 Compare August 5, 2025 01:56
private static final String ZTS_SERVICE = "zts";
private static final String MSD_SERVICE = "msd";

private static final String ATHENZ_PROP_ZMS_KEY_NAME = "athenz.aws.zms.key_name";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the key names, we should make them cloud specific. It's not right to say I have a keystore implementation for gcp but my property name is based on aws. So it should be:

"athenz." + cloud + "." + service + ".key_name"

add add the cloud as an argument to the getPrivateKeyFromCloudParameter method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Updated the code.

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.64.0</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not hard code the version here but use the version parameter from the main pom.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it

return ParameterManagerClient.create();
}

String apiEndpoint = String.format("parametermanager.googleapis.com:443", location);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is location used?

Copy link
Contributor Author

@psasidhar psasidhar Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oversight. Matched the non-global location endpoint with the documentation here.

https://cloud.google.com/secret-manager/parameter-manager/docs/list-parameter-versions

Still working with Google Support for testing this with real values in us-central1.

}

public static boolean isGlobalLocation(String location) {
return "global".equalsIgnoreCase(location);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use "global" in a couple of places so we should probably define as a static const

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<relativePath>../../../pom.xml</relativePath>
</parent>

<groupId>com.yahoo.athenz</groupId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let' define a code coverage block as well - hopefully with 100% coverage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@havetisyan havetisyan merged commit ce45057 into AthenZ:master Aug 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants