Skip to content

Planner.fetchBaseKey ignores structured platform base keys #430

Open

Description

@marythought

Summary

Reported with OpenTDF Java SDK 0.19.1: Planner.fetchBaseKey does not parse the platform's structured configuration.base_key response and returns Optional.empty() for a valid base key.

Reproduction

Return the following shape from GetWellKnownConfiguration (values are illustrative):

{
  "configuration": {
    "base_key": {
      "kas_id": "00000000-0000-0000-0000-000000000001",
      "kas_uri": "https://kas.example.com/kas",
      "public_key": {
        "algorithm": "rsa:2048",
        "kid": "example-key-id",
        "pem": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\n"
      }
    }
  }
}

Call Planner.fetchBaseKey with that configuration. The protobuf Value is a struct, so getStringValue() returns "" and Gson produces no base key. The old mapping also expects kas_url instead of kas_uri and a protobuf algorithm enum name instead of the wire-format rsa:2048.

Expected behavior

Read the nested struct, use kas_uri, and convert wire-format algorithms such as rsa:2048 to the corresponding policy enum. A valid base key should remain available to the planner.

The Go SDK demonstrates this behavior:

Affected Java implementation: Planner.java at v0.19.1.

Fix

Tracked for posterity; the fix is proposed in #429 (currently open). That PR reads structured configuration, uses kas_uri, maps wire-format algorithms, and adds regression tests. This issue does not imply that the fix has already shipped.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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