-
Notifications
You must be signed in to change notification settings - Fork 16
Add batch secret retrieval support #126
Copy link
Copy link
Open
Description
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. AddgetBatchSecretsUri(). - 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels