Skip to content

chore(docs): SDK page cleanup — sidebar, examples, tab naming, code structure#277

Closed
marythought wants to merge 27 commits intomainfrom
chore/274-sdk-page-cleanup
Closed

chore(docs): SDK page cleanup — sidebar, examples, tab naming, code structure#277
marythought wants to merge 27 commits intomainfrom
chore/274-sdk-page-cleanup

Conversation

@marythought
Copy link
Copy Markdown
Contributor

@marythought marythought commented Apr 7, 2026

Summary

Comprehensive SDK documentation cleanup addressing #274 and beyond.

Issue #274 Tasks

  1. Sidebar order — rearranged to logical flow: Architecture → Authentication → Quickstart → TDF → Policy → Obligations → Authorization → Discovery → Troubleshooting
  2. TDF example placement — moved usage examples after Parameters (before Returns/Errors) for CreateTDF, LoadTDF, IsValidTdf, and BulkDecrypt. Renamed Quick Start to Setup.
  3. JS/TS tab naming — standardized all tabs to "JavaScript"
  4. Code example structure — setup+snippets pattern for Policy, Obligations, Authentication, Authorization, Discovery, and TDF pages. Stripped SDK init boilerplate from all inline examples and imported code samples. Extracted Obligations into its own page.

Structured API Reference

Added Signature → Parameters → Example → Returns to every operation:

  • Policy — all 28 operations across Namespaces (5), Attributes (5), Attribute Values (6), Subject Condition Sets (6), Subject Mappings (6)
  • Authorization — GetEntitlements, GetDecision, GetDecisionBulk with v1 legacy in collapsible blocks
  • Discovery — ListAttributes, AttributeExists, AttributeValueExists, ValidateAttributes, GetEntityAttributes

Type References

  • Policy page: Namespace, Attribute, Attribute Value, Subject Condition Set (with full condition tree: SubjectSet → ConditionGroup → Condition), Subject Mapping, Action, SubjectProperty, Metadata, Pagination
  • Authorization page: Decision, ResourceDecision, Resource, EntityEntitlements, EntityIdentifier (with cross-language comparison table), GetDecisionMultiResourceResponse
  • Discovery: Returns linked to Policy type references

Architecture Page

  • Response Objects section showing getter patterns across Go/Java/JS with four examples (GetAttributeValue, ListAttributeValues, GetDecision, GetEntitlements)

Other Improvements

  • Linked DEK reference to protocol spec on TDF assertions page
  • Updated Entitlements with Scope to use v2 API (was incorrectly documented as v1-only)
  • Replaced Go import comments with actual import statements
  • Documented standard actions (read, create, update, delete) and custom action support
  • Added namespace filter params to ListSubjectConditionSets and ListSubjectMappings
  • Vendored OpenAPI YAML specs updated

Closes #274

Test plan

  • Verify sidebar order in surge preview
  • Verify TDF page: Setup section, examples appear after Parameters
  • Verify tab labels all say "JavaScript"
  • Verify Policy page renders all 28 operations with Signature/Parameters/Example/Returns
  • Verify type reference tables render correctly and internal links resolve
  • Verify Authorization page structure with EntityIdentifier docs
  • Verify Discovery page links to Policy type references
  • Verify Architecture page Response Objects examples
  • Verify Obligations page renders as standalone page
  • Spot-check code snippets have correct Go imports

🤖 Generated with Claude Code

…tructure (#274)

1. Sidebar: reorder to logical flow — Architecture → Authentication →
   Quickstart → TDF → Policy → Obligations → Authorization → Discovery →
   Troubleshooting

2. TDF: rename Quick Start to Setup, move usage examples after Parameters
   (before Returns/Errors) for CreateTDF, LoadTDF, IsValidTdf, BulkDecrypt

3. Tab naming: standardize all JS/TS tabs to "JavaScript"

4. Code structure: add Setup sections to Authentication, TDF, Policy, and
   Obligations pages. Strip SDK init boilerplate from all Policy inline
   examples and imported code samples. Extract Obligations into its own
   page (different service accessor, Go + JS only).

Closes #274

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@marythought marythought requested review from a team as code owners April 7, 2026 02:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f9c06191-e154-4285-9ed5-66b29d433c19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Standardizes SDK docs: renames TypeScript tabs to JavaScript, centralizes/assumes shared setup (removes inline auth/client boilerplate), restructures several SDK pages (authorization, discovery, tdf), adds Signature/Parameters/Returns blocks, adjusts sidebar ordering, adds Obligations SDK page, and extends OpenAPI with attribute-sorting schemas.

Changes

Cohort / File(s) Summary
Tab/Label & small sample fixes
code_samples/authorization/get_decision.mdx, code_samples/authorization/get_entitlements.mdx
Renamed JavaScript tab labels from TypeScript/Javascript variants to JavaScript (label/text-only changes).
Policy code sample simplification
code_samples/policy_code/create_attribute.mdx, code_samples/policy_code/create_namespace.mdx, code_samples/policy_code/create_subject_condition_set.mdx, code_samples/policy_code/create_subject_mapping.mdx, code_samples/policy_code/list_attributes.mdx, code_samples/policy_code/list_namespaces.mdx, code_samples/policy_code/list_subject_mapping.mdx
Replaced runnable boilerplate with concise call-site snippets; added Signature/Parameters/Returns sections; removed inline client/auth setup and assume preexisting client/platform/ctx.
SDK pages: restructure & setup
docs/sdks/authentication.mdx, docs/sdks/authorization.mdx, docs/sdks/discovery.mdx, docs/sdks/tdf.mdx
Added a shared “Setup” pattern, moved/renamed sections (e.g., Quick Start→Setup), introduced per-method Signature/Parameters/Returns, condensed examples, and removed repeated auth/client boilerplate.
New content: Obligations SDK
docs/sdks/obligations.mdx
Added a new Obligations SDK page covering lifecycle and value/trigger management with Go and JavaScript examples.
Sidebar & ordering metadata
docs/sdks/platform-client.mdx, docs/sdks/troubleshooting.mdx, docs/sdks/quickstart/_category_.json
Adjusted frontmatter sidebar_position values and quickstart category position to reorder SDK docs.
Small docs adjustments
docs/sdks/authorization.mdx (additional edits)
Rewrote authorization page to emphasize Entitlements/Decisions/GetDecisionBulk, added helper references and streamlined middleware/error examples.
OpenAPI: authorization param docs
specs/authorization/authorization.openapi.yaml
Clarified descriptions for timestamp query parameters (seconds, nanos) — wording only, no type/format changes.
OpenAPI: attribute sorting
specs/policy/attributes/attributes.openapi.yaml
Added policy.SortDirection, policy.attributes.SortAttributesType, policy.attributes.AttributesSort schemas and a sort field (array, maxItems: 1) to ListAttributesRequest to support attribute sorting.

Sequence Diagram(s)

(No sequence diagrams generated — changes are documentation and schema additions without new multi-component runtime control flow to visualize.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • elizabethhealy
  • jp-ayyappan
  • eugenioenko

Poem

🐰
I hopped through tabs to tidy the lair,
Swapped labels, trimmed boilerplate hair,
Setup shared, snippets lean and bright,
Obligations added — docs take flight! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: SDK documentation cleanup addressing sidebar organization, examples, tab naming, and code structure.
Linked Issues check ✅ Passed All four objectives from issue #274 are fully implemented: sidebar reordered, TDF examples repositioned, JS/TS tabs standardized to 'JavaScript', and consistent setup+snippets pattern applied across SDK pages.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #274 requirements: sidebar restructuring, example placement, tab naming standardization, and setup+snippets pattern. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/274-sdk-page-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

📄 Preview deployed to https://opentdf-docs-pr-277.surge.sh

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
docs/sdks/obligations.mdx (1)

46-46: Use javascript code fence under JavaScript tabs

The tab is labeled “JavaScript”, but the fence is typescript. Since these snippets are plain JS, switching to javascript will avoid mixed signaling.

Suggested change
-```typescript
+```javascript
 import { PlatformClient } from '@opentdf/sdk/platform';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/sdks/obligations.mdx` at line 46, The JavaScript tab in
docs/sdks/obligations.mdx currently uses a ```typescript code fence; change that
fence to ```javascript so the snippet (e.g., the import line "import {
PlatformClient } from '@opentdf/sdk/platform';") is correctly labeled as
JavaScript; update any matching opening/closing fences in the same snippet to
maintain consistent fences within the JavaScript tab.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@code_samples/policy_code/create_subject_mapping.mdx`:
- Around line 25-29: The if-statement that checks the result of
client.SubjectMapping.CreateSubjectMapping (the block starting with "if err !=
nil {") is missing its closing brace; fix by adding the matching "}" after the
log.Fatal(err) line so the error-handling block around err and log.Fatal is
properly closed for CreateSubjectMapping.

In `@code_samples/policy_code/list_attributes.mdx`:
- Around line 19-25: The outer for loop iterating over attrs.GetAttributes() is
missing its closing brace; add a closing "}" after the inner loop (after the
log.Printf for each value) to close the block that starts with "for _, attr :=
range attrs.GetAttributes()" so the snippet compiles correctly; locate the loop
by the identifier attrs.GetAttributes(), the loop variable attr, and the inner
loop over attr.Values.

In `@code_samples/policy_code/list_namespaces.mdx`:
- Around line 17-20: The Go snippet opens a for loop over
namespaces.GetNamespaces() but never closes it; add the missing closing brace
'}' immediately after the log.Printf("Namespace: %s\n", namespace.GetName())
line to properly terminate the for loop that iterates using namespace.GetName()
and namespaces.GetNamespaces().

---

Nitpick comments:
In `@docs/sdks/obligations.mdx`:
- Line 46: The JavaScript tab in docs/sdks/obligations.mdx currently uses a
```typescript code fence; change that fence to ```javascript so the snippet
(e.g., the import line "import { PlatformClient } from
'@opentdf/sdk/platform';") is correctly labeled as JavaScript; update any
matching opening/closing fences in the same snippet to maintain consistent
fences within the JavaScript tab.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2b3c66c-6f87-465e-bade-c451b6e1f670

📥 Commits

Reviewing files that changed from the base of the PR and between 7d49ef7 and 4d4a2c1.

📒 Files selected for processing (18)
  • code_samples/authorization/get_decision.mdx
  • code_samples/authorization/get_entitlements.mdx
  • code_samples/policy_code/create_attribute.mdx
  • code_samples/policy_code/create_namespace.mdx
  • code_samples/policy_code/create_subject_condition_set.mdx
  • code_samples/policy_code/create_subject_mapping.mdx
  • code_samples/policy_code/list_attributes.mdx
  • code_samples/policy_code/list_namespaces.mdx
  • code_samples/policy_code/list_subject_mapping.mdx
  • docs/sdks/authentication.mdx
  • docs/sdks/authorization.mdx
  • docs/sdks/discovery.mdx
  • docs/sdks/obligations.mdx
  • docs/sdks/platform-client.mdx
  • docs/sdks/policy.mdx
  • docs/sdks/quickstart/_category_.json
  • docs/sdks/tdf.mdx
  • docs/sdks/troubleshooting.mdx

Comment thread code_samples/policy_code/create_subject_mapping.mdx
Comment thread code_samples/policy_code/list_attributes.mdx Outdated
Comment thread code_samples/policy_code/list_namespaces.mdx Outdated
Copy link
Copy Markdown
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

This pull request updates the SDK documentation by adding a new page for Obligations, reorganizing sidebar positions, and simplifying Go code snippets across various policy code samples. It also standardizes the labeling of JavaScript code blocks. Review feedback correctly identified several syntax errors in the updated Go snippets, specifically missing closing braces for conditional statements and loops in the 'create_subject_mapping', 'list_attributes', and 'list_namespaces' samples.

Comment on lines +26 to +28
if err != nil {
log.Fatal(err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The if statement in the Go code snippet is missing its closing brace, which will cause a syntax error if the code is used.

if err != nil {
	log.Fatal(err)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a subsequent commit.

Comment on lines 19 to 24
for _, attr := range attrs.GetAttributes() {
log.Printf("Attribute: %s, ID: %s, ", attr.GetName(), attr.GetId())
for _, value := range attr.Values {
log.Printf("Value: %s, ID: %s", value.GetValue(), value.GetId())
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The outer for loop in the Go code snippet is missing its closing brace.

for _, attr := range attrs.GetAttributes() {
	log.Printf("Attribute: %s, ID: %s, ", attr.GetName(), attr.GetId())
	for _, value := range attr.Values {
		log.Printf("Value: %s, ID: %s", value.GetValue(), value.GetId())
	}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a subsequent commit.

Comment on lines +17 to +19
for _, namespace := range namespaces.GetNamespaces() {
log.Printf("Namespace: %s\n", namespace.GetName())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The for loop in the Go code snippet is missing its closing brace.

for _, namespace := range namespaces.GetNamespaces() {
	log.Printf("Namespace: %s\n", namespace.GetName())
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a subsequent commit.

marythought and others added 3 commits April 6, 2026 20:18
…#274)

- Add Signature, Parameters table, and Returns description to all 5
  namespace operations (Create, List, Get, Update, Deactivate) as a
  proof of concept for the structured pattern used on the TDF page
- Link DEK reference to protocol spec on TDF assertions page
- Link Policy intro to concept overview page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…#274)

Replace abbreviated `// Imports: namespaces` comments with full Go
import paths so each snippet shows the correct platform protocol import.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update authorization and attributes specs from opentdf/platform main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

❌ Surge preview build failed — no preview was deployed. Check the workflow logs for details.

Once the build passes, the preview will be at: https://opentdf-docs-pr-277.surge.sh

Common cause: If the build failed on vendored YAML validation, run the following locally and commit the result:

npm run update-vendored-yaml
git add specs/
git commit -m "chore(deps): update vendored OpenAPI specs"

marythought and others added 6 commits April 6, 2026 20:25
- Rename "Authentication Setup" to "Setup" for consistency
- Strip package-specific imports from Setup section
- Add actual Go import statements to each code example where packages
  are used (authorization, authorizationv2, entity, policy, proto)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WithComprehensiveHierarchy is available in the v2 API — the comment
claiming it was v1-only was incorrect. Update Go example to use
authorizationv2.ForEmail() helper and client.AuthorizationV2.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename sections to method names: GetEntitlements, GetDecision,
  GetDecisionBulk
- Add Signature, Parameters, and Returns to each method
- Merge "Entitlements with Scope" into GetEntitlements as a second
  example rather than a separate section
- Merge token-based example into GetDecision
- Move Entity Identifier Helpers table into Setup section
- Consolidate Real-World Examples into Best Practices
- Simplify Error Handling section

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add Setup section with client init for Go, Java, JS
- Add Signature, Parameters, and Returns to all 5 methods
  (ListAttributes, AttributeExists, AttributeValueExists,
  ValidateAttributes, GetEntityAttributes)
- Strip inline JS auth setup from examples (now in Setup)
- Strip client init from "Putting It Together" examples
- Keep method-name headings (already correct)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…up (#274)

- Add Namespace, Attribute, Attribute Value, Subject Condition Set, and
  Subject Mapping object reference tables to Policy page
- Add shared Metadata section explaining the labels structure
- Simplify parameter types (MetadataMutable → object, ActiveStateEnum →
  string, MetadataUpdateEnum → string with actual enum values)
- Add metadata and pagination examples to Create/List Namespace
- Link DEK reference to protocol spec on TDF page
- Restructure Discovery page with Setup + Signature/Parameters/Returns
- Restructure Authorization page with method-name headings
- Update Entitlements with Scope to use v2 API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ions (#274)

Add structured documentation to all 11 attribute operations:
- Create, List, Get, Update, Deactivate Attribute
- Create, List, Get, Get by FQNs, Update, Deactivate Attribute Value

Each operation now has Signature, Parameters table, Example, and
Returns with links to type reference tables. Stray JS auth imports
removed from snippets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@code_samples/policy_code/create_attribute.mdx`:
- Around line 30-35: The sample uses rand.Text()[:4] (in the attrRequest
creation) which requires Go 1.24+; replace that call with a Go 1.21-compatible
random suffix (for example, generate 4 random bytes via crypto/rand.Read and
encode them (hex or base64) then take the needed prefix) when building the Name
("role-" + <suffix>), or alternatively update the quickstart docs to require Go
1.24+; update the CreateAttributeRequest Name construction to use the new suffix
method and keep the rest of attrRequest (NamespaceId, Rule, Values) unchanged.

In `@code_samples/policy_code/list_namespaces.mdx`:
- Around line 64-72: The example uses policy.PageRequest in the ListNamespaces
call but the code sample's imports do not include the policy package, causing a
compile error; fix by adding the proper import for the policy package used by
PageRequest (or update the reference to the fully-qualified package alias) so
that ListNamespaces(context.Background(), &namespaces.ListNamespacesRequest{
State: common.ActiveStateEnum_ACTIVE_STATE_ENUM_INACTIVE, Pagination:
&policy.PageRequest{ ... } }) resolves—ensure the package alias matches the rest
of the file and the PageRequest type (e.g., import the package that defines
PageRequest or change policy.PageRequest to the correct package alias).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b139876e-f841-41dc-86b9-981372e79964

📥 Commits

Reviewing files that changed from the base of the PR and between 4d4a2c1 and d786360.

📒 Files selected for processing (13)
  • code_samples/policy_code/create_attribute.mdx
  • code_samples/policy_code/create_namespace.mdx
  • code_samples/policy_code/create_subject_condition_set.mdx
  • code_samples/policy_code/create_subject_mapping.mdx
  • code_samples/policy_code/list_attributes.mdx
  • code_samples/policy_code/list_namespaces.mdx
  • code_samples/policy_code/list_subject_mapping.mdx
  • docs/sdks/authorization.mdx
  • docs/sdks/discovery.mdx
  • docs/sdks/policy.mdx
  • docs/sdks/tdf.mdx
  • specs/authorization/authorization.openapi.yaml
  • specs/policy/attributes/attributes.openapi.yaml
✅ Files skipped from review due to trivial changes (2)
  • specs/authorization/authorization.openapi.yaml
  • docs/sdks/authorization.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
  • code_samples/policy_code/create_subject_mapping.mdx
  • docs/sdks/discovery.mdx
  • docs/sdks/tdf.mdx

Comment thread code_samples/policy_code/create_attribute.mdx Outdated
Comment thread code_samples/policy_code/list_namespaces.mdx
marythought and others added 4 commits April 6, 2026 21:03
#274)

Add structured documentation to all Subject Condition Set operations
(Create, List, Get, Update, Delete, Delete All Unmapped) and all
Subject Mapping operations (Create, List, Get, Update, Delete, Match).

Each operation now has Signature, Parameters table, Example, and
Returns with links to type reference tables. Stray JS auth imports
removed from snippets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…example

CodeRabbit flagged that policy.PageRequest was used without importing
the policy package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document the PageResponse fields (currentOffset, nextOffset, total)
in a shared Pagination section. Link all List operation Returns to it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@code_samples/policy_code/create_attribute.mdx`:
- Line 40: The `values` parameter description in the table is a sentence
fragment; update the text for the `values` row so it reads as a complete
sentence (for example: "Initial values to create with the attribute. Values can
also be added later via Create an Attribute Value.") so the second clause is a
full sentence and references the Create an Attribute Value anchor.

In `@code_samples/policy_code/create_subject_mapping.mdx`:
- Around line 67-69: The snippet calling
client.SubjectMapping.CreateSubjectMapping currently uses "_, err = ..." which
fails because err isn't declared; change the assignment to use short declaration
"_, err :=" so the CreateSubjectMapping call
(client.SubjectMapping.CreateSubjectMapping(context.Background(),
subjectMapping)) declares and assigns err in one statement, making the example
self-contained and copy-paste runnable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6fd347b8-2c90-4820-925b-d6785d37d640

📥 Commits

Reviewing files that changed from the base of the PR and between d786360 and d1fb30a.

📒 Files selected for processing (7)
  • code_samples/policy_code/create_attribute.mdx
  • code_samples/policy_code/create_subject_condition_set.mdx
  • code_samples/policy_code/create_subject_mapping.mdx
  • code_samples/policy_code/list_attributes.mdx
  • code_samples/policy_code/list_namespaces.mdx
  • code_samples/policy_code/list_subject_mapping.mdx
  • docs/sdks/policy.mdx
✅ Files skipped from review due to trivial changes (1)
  • code_samples/policy_code/list_subject_mapping.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • code_samples/policy_code/list_namespaces.mdx
  • code_samples/policy_code/list_attributes.mdx

Comment thread code_samples/policy_code/create_attribute.mdx
Comment thread code_samples/policy_code/create_subject_mapping.mdx
marythought and others added 7 commits April 6, 2026 21:35
Add Response Objects section to the Architecture page showing how to
access fields in Go (Get* getters), Java (get* getters), and JS
(direct property access). Four examples: GetAttributeValue,
ListAttributeValues, GetDecision, GetEntitlements.

Also: fix short-form enum refs, add FQN uniqueness note, add
SubjectProperty type reference, and various small cleanups.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add detailed type references for SubjectSet, ConditionGroup, and
Condition with an ASCII tree showing how they nest, evaluation logic
explanation, operator reference table, and a concrete JSON example.

This is the part of policy that confuses people the most — now it's
fully documented.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…274)

- Add "Related Objects in Responses" section to Architecture page
  showing the GetSubjectConditionSet → associatedSubjectMappings
  pattern with examples in all 3 languages
- Add missing namespaceId/namespaceFqn filter params to
  ListSubjectConditionSets and ListSubjectMappings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only one API uses this pattern — better documented on the Policy page
where GetSubjectConditionSet lives.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace opaque SubjectConditionSetCreate type with object description
and link to the Condition Structure docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace all `object` type references for metadata with linked
`Metadata` type pointing to the shared Metadata section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
marythought and others added 3 commits April 6, 2026 21:50
Document the four standard actions (read, create, update, delete) and
custom action support. Show the name-based API for all three languages.
Link Subject Mapping Object and parameter tables to the Action type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document the EntityIdentifier structure for all three languages —
Go helpers, Java proto builders, and JS oneof syntax. Include a
cross-reference table mapping entity types to each SDK's API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document Decision, ResourceDecision, Resource, EntityEntitlements,
and GetDecisionMultiResourceResponse with field tables and code
examples. Link all Returns sections to the type references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
code_samples/policy_code/create_subject_mapping.mdx (1)

67-69: ⚠️ Potential issue | 🔴 Critical

Declare err in the Go snippet before assignment.

Line 67 uses _, err = ... but err is not declared in this snippet. Use short declaration to keep the example self-contained.

Proposed fix
-_, err = client.SubjectMapping.CreateSubjectMapping(context.Background(), subjectMapping)
+_, err := client.SubjectMapping.CreateSubjectMapping(context.Background(), subjectMapping)
 if err != nil {
 	log.Fatal(err)
 }
#!/bin/bash
# Verify the undeclared-assignment pattern in the snippet.
nl -ba code_samples/policy_code/create_subject_mapping.mdx | sed -n '60,72p'
rg -nP '_,\s*err\s*=' code_samples/policy_code/create_subject_mapping.mdx
rg -nP '\berr\s*:=' code_samples/policy_code/create_subject_mapping.mdx

Expected: one _, err = match and no local err := before it in this snippet block.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@code_samples/policy_code/create_subject_mapping.mdx` around lines 67 - 69,
The snippet uses an assignment to err without declaring it; change the call to
CreateSubjectMapping so err is declared locally (e.g., use short declaration for
the result from client.SubjectMapping.CreateSubjectMapping) or declare a var err
error before the call; update the line invoking
client.SubjectMapping.CreateSubjectMapping(context.Background(), subjectMapping)
accordingly so the err variable is properly defined in this snippet.
code_samples/policy_code/create_attribute.mdx (1)

40-40: ⚠️ Potential issue | 🟡 Minor

Fix the sentence fragment in the values description.

Line 40 still reads as an incomplete sentence; make the second clause explicit.

Proposed wording tweak
-| `values` | `[]string` | No | Initial values to create with the attribute. Can also be added later via [Create an Attribute Value](`#create-attribute-value`). |
+| `values` | `[]string` | No | Initial values to create with the attribute. Values can also be added later via [Create an Attribute Value](`#create-attribute-value`). |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@code_samples/policy_code/create_attribute.mdx` at line 40, The table entry
for the `values` field currently ends with a sentence fragment; update the
description for `values` (the table cell under `values | []string`) to be a
complete sentence such as "Initial values to create with the attribute; these
can also be added later via Create an Attribute Value." Ensure the second clause
explicitly states that values can be added later and reference the "Create an
Attribute Value" anchor text verbatim.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@code_samples/policy_code/create_attribute.mdx`:
- Line 40: The table entry for the `values` field currently ends with a sentence
fragment; update the description for `values` (the table cell under `values |
[]string`) to be a complete sentence such as "Initial values to create with the
attribute; these can also be added later via Create an Attribute Value." Ensure
the second clause explicitly states that values can be added later and reference
the "Create an Attribute Value" anchor text verbatim.

In `@code_samples/policy_code/create_subject_mapping.mdx`:
- Around line 67-69: The snippet uses an assignment to err without declaring it;
change the call to CreateSubjectMapping so err is declared locally (e.g., use
short declaration for the result from
client.SubjectMapping.CreateSubjectMapping) or declare a var err error before
the call; update the line invoking
client.SubjectMapping.CreateSubjectMapping(context.Background(), subjectMapping)
accordingly so the err variable is properly defined in this snippet.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2e20d31c-0fdb-42f1-9f5f-2d3ae0272346

📥 Commits

Reviewing files that changed from the base of the PR and between d1fb30a and 08a1012.

📒 Files selected for processing (7)
  • code_samples/policy_code/create_attribute.mdx
  • code_samples/policy_code/create_namespace.mdx
  • code_samples/policy_code/create_subject_condition_set.mdx
  • code_samples/policy_code/create_subject_mapping.mdx
  • code_samples/policy_code/list_subject_mapping.mdx
  • docs/sdks/platform-client.mdx
  • docs/sdks/policy.mdx
✅ Files skipped from review due to trivial changes (1)
  • code_samples/policy_code/create_namespace.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/sdks/platform-client.mdx

marythought and others added 2 commits April 6, 2026 21:56
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ations (#274)

Full structured documentation for all 14 Obligations operations:
- Definitions: List, Get, Get by FQNs, Create, Update, Delete (6)
- Values: Get, Get by FQNs, Create, Update, Delete (5)
- Triggers: Add, List, Remove (3)

Each has Signature, Parameters table, Example, and Returns with links
to type references. Added Obligation, Obligation Value, and Obligation
Trigger object tables. Updated Setup to use interceptor auth pattern.
Fixed action names from "DECRYPT" to "read".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@marythought marythought marked this pull request as draft April 7, 2026 14:44
@marythought
Copy link
Copy Markdown
Contributor Author

Splitting into smaller PRs for easier review. Changes preserved — see follow-up PRs.

@marythought marythought closed this Apr 7, 2026
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.

chore(docs): SDK page cleanup — sidebar order, example placement, JS/TS naming

1 participant