Summary
Add support for the Conjur Batch Secret Retrieval API to the Java SDK.
Motivation
Currently the Java SDK only supports retrieving secrets one at a time via retrieveSecret(String variableId). Applications that need multiple secrets must make N separate HTTP calls, which is inefficient at scale. The Conjur REST API already supports batch retrieval, and the other SDKs (Python, Ruby, Go) expose it.
Proposed Changes
- ResourceProvider: Add
retrieveBatchSecrets(String... variableIds) to the interface
- ResourceClient: Implement batch retrieval with proper URL encoding and JSON response parsing
- Variables / Conjur: Expose the batch method through the existing delegation chain
- Endpoints: Refactor to use
(applianceUrl, account) as primary inputs so all service URIs are derived cleanly. Add getBatchSecretsUri().
- Tests: Comprehensive unit tests using Mockito (26 tests covering encoding, error codes, edge cases)
API Example
Conjur conjur = new Conjur();
Map<String, String> secrets = conjur.retrieveBatchSecrets(
"prod/db/password",
"prod/db/username",
"prod/api/key"
);
Implementation
I have a working implementation with full test coverage ready to submit as a PR.
Summary
Add support for the Conjur Batch Secret Retrieval API to the Java SDK.
Motivation
Currently the Java SDK only supports retrieving secrets one at a time via
retrieveSecret(String variableId). Applications that need multiple secrets must make N separate HTTP calls, which is inefficient at scale. The Conjur REST API already supports batch retrieval, and the other SDKs (Python, Ruby, Go) expose it.Proposed Changes
retrieveBatchSecrets(String... variableIds)to the interface(applianceUrl, account)as primary inputs so all service URIs are derived cleanly. AddgetBatchSecretsUri().API Example
Implementation
I have a working implementation with full test coverage ready to submit as a PR.