Skip to content

Add list resources API support #128

@miewest

Description

@miewest

Summary

Add support for the Conjur List Resources API (GET /resources/{account}) to the Java SDK.

Motivation

The Conjur REST API provides a list resources endpoint that allows clients to discover available resources (variables, hosts, policies, etc.) by kind, search term, and with pagination. The Java SDK currently has no way to enumerate resources — callers must already know the exact variable IDs to retrieve secrets. Adding resource listing enables use cases like:

  • Discovering available secrets at runtime
  • Building admin/audit tooling that inventories accessible resources
  • Implementing search/autocomplete against Conjur resource names
  • Paginating through large resource sets efficiently

Missing Capabilities

  • List resources: GET /resources/{account} with no filters returns all visible resources
  • Filter by kind: ?kind=variable to list only variables, hosts, policies, etc.
  • Text search: ?search=... to filter resources by identifier substring
  • Pagination: ?limit=N&offset=N for paginated access to large result sets
  • Count: ?count=true to get the number of matching resources without fetching them all

Expected API Shape

Conjur conjur = new Conjur();

// List all resources
List<ConjurResource> all = conjur.listResources();

// List only variables
List<ConjurResource> variables = conjur.listResources("variable");

// Search with pagination
List<ConjurResource> page = conjur.listResources("variable", "prod", 100, 0);

// Count resources
int count = conjur.countResources("variable", null);

Each ConjurResource should expose the fields from the API response: id, created_at, owner, policy, permissions, annotations, secrets, and policy_versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions