feat(docs): document WithPolicyFrom re-wrap helper#323
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds documentation for the WithPolicyFrom function in the Go SDK, which allows binding a source TDF's policy to a new TDF. Feedback was provided regarding an inconsistency in the documentation concerning the Init(ctx) requirement for Reader.DataAttributes. Additionally, the example code contains a logic error where a return statement is missing after a validation check, and the SDK client variable naming is inconsistent with the rest of the document.
|
❌ 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-323.surge.sh Common cause: If the build failed on vendored YAML validation, run the following locally and commit the result: |
Adds a tdf.mdx section for sdk.WithPolicyFrom, the option-builder helper landing as part of DSPX-2603. The function returns a TDFOption that binds the source TDF's policy (attribute FQNs) to a new TDF being created — useful in re-wrap pipelines where the policy should carry forward without callers handling base64+JSON manifest encoding. Demo output of the /docs-drift skill — example block is mined verbatim from the function's godoc, no inference. Section placed after IsValidTdf since both are re-wrap-flavored helpers. Skill's name-only sniff proposed a new with-policy-from.mdx file; placement overridden manually to match the existing tdf.mdx structure. Not for merge until the underlying sdk.WithPolicyFrom function lands in opentdf/platform. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Mary Dickson <mary.dickson@virtru.com>
- Reader.Init is not required; DataAttributes reads from the manifest which LoadTDF already populated. Calling Init triggers an unnecessary KAS rewrap. - Add missing return after IsValidTdf check - Add error handling for LoadTDF - Use `client` instead of `s` for consistency with the rest of the page Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Mary Dickson <mary.dickson@virtru.com>
e8f0d10 to
18221fc
Compare
|
❌ 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-323.surge.sh Common cause: If the build failed on vendored YAML validation, run the following locally and commit the result: |
|
❌ 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-323.surge.sh Common cause: If the build failed on vendored YAML validation, run the following locally and commit the result: |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Mary Dickson <mary.dickson@virtru.com>
Summary
Adds a
tdf.mdxsection forsdk.WithPolicyFrom, a newTDFOptionbuilder that binds the source TDF's policy — its attribute value FQNs — to a new TDF being created. Targets re-wrap pipelines where the source policy should carry forward without callers handling the manifest's base64 + JSON encoding themselves.Call site is a single line, matching the existing
With*option-builder idiom:Reader.Initis not required —DataAttributesreads the policy from the manifest, whichLoadTDFhas already populated.Companion PR
Documents the function landing in opentdf/platform#3476. Draft until that PR merges — the example references a symbol that doesn't exist in the SDK yet.
How this was drafted
Generated by the docs-drift skill mining the function's godoc example block verbatim. No example code was invented; the snippet shown is exactly what the function's author wrote in the godoc.
Test plan
tdf.mdxafterIsValidTdf, beforeBulkDecrypt)🤖 Generated with Claude Code