Skip to content

Feat: DSPX-2418 add SDK convenience/discovery method documentation#186

Open
marythought wants to merge 6 commits intomainfrom
feat/dspx-2418-discovery-methods
Open

Feat: DSPX-2418 add SDK convenience/discovery method documentation#186
marythought wants to merge 6 commits intomainfrom
feat/dspx-2418-discovery-methods

Conversation

@marythought
Copy link
Contributor

@marythought marythought commented Feb 17, 2026

Preview

https://opentdf-docs-preview-dspx-2418.surge.sh/sdks/discovery

Summary

  • New page: Attribute Discovery (docs/sdks/discovery.mdx) — Documents five convenience
    methods in the Go, Java, and JavaScript SDKs for discovering and validating attributes before
    encryption:
    • ListAttributes — returns all active attributes on the platform with optional namespace
      filtering; auto-paginates through all results
    • ValidateAttributes — checks a list of attribute value FQNs exist before calling
      CreateTDF, surfacing missing attributes at encryption time rather than decryption time;
      accepts up to 250 FQNs per call
    • ValidateAttributeExists — single-FQN convenience wrapper around ValidateAttributes
    • ValidateAttributeValue — fetches an attribute definition and checks whether a candidate
      value is permitted; handles both enumerated attributes (value must match the registered list,
      case-insensitively) and dynamic attributes (any non-empty value accepted)
    • GetEntityAttributes — returns the FQNs assigned to a specific entity (PE or NPE),
      identified by email, username, client ID, or UUID
  • Updated: Troubleshooting (docs/sdks/troubleshooting.mdx) — Added a prevention note to
    the "Resource Not Found" section pointing to ValidateAttributes as a way to surface missing
    attributes at encryption time rather than decryption time

Each method includes side-by-side Go/Java/JavaScript code examples, an end-to-end
"putting it all together" pattern, and a callout noting these wrap the lower-level service
clients available in all SDKs.

Test plan

  • Preview deployed and visually verified at opentdf-docs-preview-dspx-2418.surge.sh
  • npm run build completes successfully
  • All code examples reviewed for accuracy against Go and Java SDK implementations
  • Links to troubleshooting anchors resolve correctly

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @marythought, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the developer experience for users of the Go and Java SDKs by introducing comprehensive documentation for new attribute discovery and validation methods. These methods empower developers to proactively manage and verify attributes before data encryption, thereby preventing cryptic runtime errors and improving the robustness of applications interacting with the platform's attribute-based access control.

Highlights

  • New documentation page for Attribute Discovery: Introduced docs/sdks/discovery.mdx detailing four new convenience methods (ListAttributes, ValidateAttributes, ValidateAttributeValue, and GetEntityAttributes) available in the Go and Java SDKs for discovering and validating attributes. The page includes side-by-side code examples and an end-to-end usage pattern.
  • Enhanced Troubleshooting documentation: Updated docs/sdks/troubleshooting.mdx by adding a prevention note to the "Resource Not Found" section, recommending the use of ValidateAttributes to identify missing attributes at encryption time rather than decryption time.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/sdks/discovery.mdx
    • Added a new documentation page titled "Attribute Discovery".
    • Included detailed explanations and code examples for ListAttributes, ValidateAttributes, ValidateAttributeValue, and GetEntityAttributes.
    • Provided context on why attribute validation is crucial before encryption.
    • Demonstrated a common pattern for integrating these methods into an application workflow.
  • docs/sdks/troubleshooting.mdx
    • Inserted a new "Prevention" note within the "Resource Not Found" section.
    • Linked to the new ValidateAttributes documentation as a proactive measure.
Activity
  • Preview deployment verified visually at opentdf-docs-preview-dspx-2418.surge.sh.
  • npm run build command successfully completed.
  • Accuracy of all code examples against Go and Java SDK implementations was reviewed.
  • Resolution of links to troubleshooting anchors was confirmed.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces new documentation for SDK convenience methods related to attribute discovery and validation in Go and Java. It also updates the troubleshooting guide to reference these new methods. The changes are well-structured and provide clear examples for both languages. The documentation effectively highlights the benefits of using these methods for early error detection.

Comment on lines +35 to +39
fmt.Printf(" %s (%s)\n", a.GetFqn(), a.GetRule())
for _, v := range a.GetValues() {
fmt.Printf(" value: %s\n", v.GetValue())
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Go example for ListAttributes prints both FQN and rule, and then iterates through values. The Java example only prints FQN and then iterates through values. For consistency and completeness, the Java example should also print the rule of the attribute.

    System.out.printf("  %s (%s)%n", a.getFqn(), a.getRule());
    for (Value v : a.getValuesList()) {
        System.out.printf("    value: %s%n", v.getValue());
    }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The troubleshooting guide adds a prevention note for the Go SDK, but the new ValidateAttributes method is also available in the Java SDK. For completeness, a similar prevention note should be added for the Java SDK.

**Prevention (Go SDK)**: Use [`ValidateAttributes`](/sdks/discovery#validateattributes) before calling `CreateTDF` to catch missing attributes immediately instead of at decryption time.

**Prevention (Java SDK)**: Use [`validateAttributes`](/sdks/discovery#validateattributes) before calling `createTDF` to catch missing attributes immediately instead of at decryption time.

marythought and others added 3 commits February 17, 2026 14:14
Add JavaScript (TypeScript) code examples for all four discovery methods
alongside the existing Go and Java tabs. Remove the "Go and Java only"
caveat now that the JavaScript SDK also supports these methods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Mary Dickson <mary.dickson@virtru.com>
…add ValidateAttributeValue

Update discovery.mdx to reflect the method rename and new semantics:
- Rename "ValidateAttributeValue" section → "ValidateAttributeExists" with
  updated code examples using the new method name in all 3 SDKs.
- Add new "ValidateAttributeValue" section documenting the two-argument form
  that handles both enumerated and dynamic attribute types, with examples
  for Go, Java, and JavaScript.
- Add tip explaining dynamic vs. enumerated attribute behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and prevention note to all SDKs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

## ValidateAttributeValue

Checks that a value string is permitted for a given attribute, handling both **enumerated** and **dynamic** attribute types:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please share more about this block here between dynamic and enumerated attributes? I'm not sure I see how that fits into the underlying platform attribute objects (namespace, definition, value) or the any_of, all_of, hierarchy rules of attribute definitions. 🤔

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments