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
|
Like the other PR, 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-13116. |
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.
Closes #128
Builds on #127
Summary
Adds support for the Conjur List Resources API (
GET /resources/{account}) to the Java SDK. This builds on the Endpoints refactor and infrastructure introduced in #127 (batch secret retrieval).Changes
New files
ConjurResource.java— Model class for resources returned by the API. Includes fields forid,created_at,owner,policy,permissions,annotations,secrets, andpolicy_versions. Inner classesPermissionandAnnotationfor nested objects. Helper methodsgetKind()andgetIdentifier()to parse the{account}:{kind}:{identifier}resource ID format.Modified files
Endpoints.java— AddedgetResourcesUri()returning{applianceUrl}/resources/{account}ResourceProvider.java— AddedlistResources()(3 overloads) andcountResources()as default interface methods for backward compatibilityResourceClient.java— Full HTTP implementation: builds query parameters (kind,search,limit,offset,count), parses JSON arrays via Gson intoList<ConjurResource>, handles both JSON{"count":N}and plain integer count response formatsVariables.java— Delegation to ResourceClientConjur.java— Convenience methods on the entry point classResourceClientTest.java— 17 new unit tests covering: list all resources, filter by kind, text search, pagination, combined parameters, empty results, 401/403 error handling, full field parsing (permissions, annotations), special character encoding in search, count with JSON format, count with plain integer format, count by kind, count with search, count 401 error, and Endpoints URI derivationAPI
Testing