Open
Conversation
- Implemented batch secret retrieval methods in ResourceClient, Variables, and ResourceProvider. - Enhanced Endpoints class to support batch retrieval URI. - Added comprehensive unit tests for batch secret retrieval in ResourceClientTest.
Author
|
Ignore close, I mixed up tabs and closed the wrong PR. |
Author
|
I also created a manual full integration test of this code but wasn't sure if it fit in the repo. I can add it if wanted. |
Contributor
|
Thank you for the PR! We've added it to our backlog to review. Tracking internally as CNJR-13117. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for the Conjur Batch Secret Retrieval API (
GET /secrets?variable_ids=...) to the Java SDK.Closes #126
Changes
New: Batch Secret Retrieval
ResourceProvider: AddedretrieveBatchSecrets(String... variableIds)as a default interface methodResourceClient: Full implementation — builds thevariable_idsquery parameter with proper percent-encoding (slashes,@,+,&, spaces as%20), parses the JSON map response via Gson, and strips the{account}:variable:prefix from response keysVariables/Conjur: Expose the batch method through the existing delegation chainRefactored: Endpoints
Endpoints(String applianceUrl, String account)— all service URIs are derived from these two valuesEndpoints(String applianceUrl, String account, String authnUrl)for custom authenticators (LDAP, OIDC, etc.)getBatchSecretsUri()returning{applianceUrl}/secretsfromSystemProperties()andfromCredentials()simplified to thin wrappersgetServiceUri()static helper that re-read system propertiesTests
ResourceClientTestusing Mockito to mock the JAX-RS client stack@,+,&, spaces), all error codes (401/403/404/422), null/empty args, deeply nested paths, response order preservation,buildBatchQueryParamhelper, single secret retrieval, and Endpoints URI derivationAPI Usage
Testing
mvn test)