You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(docs): update Java/JS examples to use EntityIdentifier helpers (#291)
## Summary
- Add `EntityIdentifiers` helper tables and examples for Java and
JavaScript to the EntityIdentifier reference section (now in language
tabs)
- Update all Java examples to use `EntityIdentifiers.forEmail(...)`
instead of verbose `EntityIdentifier.newBuilder().setEntityChain(...)`
construction
- Update all JavaScript examples to use
`EntityIdentifiers.forEmail(...)` instead of verbose nested object
literals
- Update discovery page JS example to use helpers
- Move verbose construction patterns to collapsible `<details>` blocks
for reference
## Related
- opentdf/web-sdk#916 — namespaces JS helpers under `EntityIdentifiers`
(deprecates opentdf/web-sdk#911)
- opentdf/java-sdk#346 — Java `EntityIdentifiers` convenience
constructors
- opentdf/platform#3232 — Go `EntityIdentifier` helpers
## Test plan
- [x] Verify docs build (`npm run build`) passes
- [ ] Check surge preview for correct rendering of helper tables, code
examples, and details blocks
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Unified entity identification docs into language-specific tabs with
examples for Go/Java/JavaScript
* Replaced manual nested identifier examples with SDK helper-based
examples across Java and JavaScript; simplified sample payloads for
entitlements and decision requests
* Added JavaScript support for request-token identifiers; clarified when
manual construction (e.g., UUIDs) is still required
* Linked discovery guide examples to the new helper-based guidance
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -69,7 +69,8 @@ const platformClient = new PlatformClient({
69
69
70
70
Every authorization call requires an `EntityIdentifier` — the entity (user, service, etc.) you're asking about. The entity can be identified by email, username, client ID, JWT token, claims, or registered resource FQN.
| Claims | — | manual proto construction | manual object construction |
188
+
| Registered Resource | — | manual proto construction | manual object construction |
139
189
140
190
-**Claims** are used by the Entity Resolution Service (ERS) for custom claim-based entity resolution.
141
191
-**Registered Resource** identifies an entity by a [registered resource](/components/policy/registered_resources) value FQN stored in platform policy, where the resource acts as a single entity for authorization decisions.
|`entityIdentifier`|`EntityIdentifier`| Yes | The entity to query. In Go, use helpers like `authorizationv2.ForEmail("user@example.com")`. |
229
+
|`entityIdentifier`|`EntityIdentifier`| Yes | The entity to query. Use [helpers](#entityidentifier) like `ForEmail(...)` (Go) or `EntityIdentifiers.forEmail(...)` (Java/JS). |
180
230
|`withComprehensiveHierarchy`|`bool`| No | When true, returns all entitled values for attributes with hierarchy rules, propagating down from the entitled value. |
181
231
182
232
**Example**
@@ -279,18 +329,10 @@ for _, dr := range decisionResponse.GetDecisionResponses() {
|`entityIdentifier`|`EntityIdentifier`| Yes | The entity requesting access. In Go, use helpers like `authorizationv2.ForEmail(...)` or `authorizationv2.ForToken(jwt)`. |
420
+
|`entityIdentifier`|`EntityIdentifier`| Yes | The entity requesting access. Use [helpers](#entityidentifier) like `ForEmail(...)`(Go) or `EntityIdentifiers.forEmail(...)` (Java/JS). |
402
421
|`action`|`Action`| Yes | The action being performed (e.g., `decrypt`, `read`). |
403
422
|`resource`|`Resource`| Yes | The resource being accessed, identified by attribute value FQNs. |
404
423
@@ -534,18 +553,10 @@ for _, dr := range decisionResponse.GetDecisionResponses() {
EntityIdentifiers.forUserName('alice') // By username
605
+
EntityIdentifiers.forClientId('my-service') // By client ID (NPE / service account)
619
606
```
620
607
608
+
:::note
609
+
The JavaScript SDK does not currently provide a `forUuid` helper. To use UUID-based entity identifiers, construct the `EntityIdentifier` manually using the protobuf message types from `@opentdf/sdk/platform`.
0 commit comments