Skip to content

feat(docs): add authentication decision guide and SDK auth reference#250

Merged
marythought merged 10 commits intomainfrom
DSPX-2388/auth-decision-guide
Mar 26, 2026
Merged

feat(docs): add authentication decision guide and SDK auth reference#250
marythought merged 10 commits intomainfrom
DSPX-2388/auth-decision-guide

Conversation

@marythought
Copy link
Copy Markdown
Contributor

@marythought marythought commented Mar 18, 2026

Preview

https://opentdf-docs-pr-250.surge.sh/
https://opentdf-docs-pr-250.surge.sh/guides/authentication-guide
https://opentdf-docs-pr-250.surge.sh/sdks/authentication

Summary

  • Adds Authentication Decision Guide (docs/guides/authentication-guide.md) — a decision flowchart, scenario matrix, dev vs production checklist, and common pitfalls for developers new to OpenTDF or figuring out how to authenticate with their setup.
  • Adds SDK Authentication Reference (docs/sdks/authentication.mdx) — documents all auth methods (client credentials, token exchange, refresh token, certificate exchange, custom token source, DPoP, session encryption) with Go/Java/JS code examples.

Addresses the gap identified in the Go SDK docs audit (DSPX-2476) where auth methods like WithTokenExchange, WithTLSCredentials, WithOAuthAccessTokenSource, and WithCustomAccessTokenSource had godoc but were not surfaced in the docs site.

Test plan

  • Verify both pages render correctly in the sidebar (SDK > Authentication, Guides > Authentication Decision Guide)
  • Verify mermaid flowchart and sequence diagram render in the decision guide
  • Verify code examples in tabs display correctly on the SDK auth page
  • Cross-check SDK code examples against current API signatures
  • Verify all internal links resolve (e.g., decision guide → SDK auth sections)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive SDK authentication docs covering client credentials, token exchange, JS refresh, mTLS, custom token sources, and DPoP behavior/configuration.
    • Introduced an Authentication Decision Guide with flowchart, scenario matrix, getting-started steps, dev defaults, production checklist, and troubleshooting.
    • Added Session Encryption guidance.
    • Updated SDK doc titles/sidebar ordering and minor site/head metadata.

@marythought marythought requested review from a team as code owners March 18, 2026 16:21
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 OpenTDF documentation by providing two new, crucial resources for developers. It introduces a decision guide to help users navigate the various authentication options available within the platform, alongside a detailed reference for implementing these methods across different SDKs. These additions aim to streamline the developer experience by clarifying authentication choices and providing practical code examples, thereby improving usability and reducing common integration challenges.

Highlights

  • Authentication Decision Guide Added: A new guide (docs/guides/authentication-guide.md) has been introduced, featuring a decision flowchart, scenario matrix, dev vs production checklist, and common pitfalls to help developers choose the appropriate OpenTDF authentication method.
  • SDK Authentication Reference Provided: A comprehensive reference (docs/sdks/authentication.mdx) has been added, detailing all supported authentication methods (client credentials, token exchange, refresh token, certificate exchange, custom token source, DPoP, session encryption) with code examples for Go, Java, and JavaScript SDKs.
  • Documentation Gap Addressed: This pull request closes a previously identified documentation gap (DSPX-2476) by surfacing SDK authentication methods that previously only had godoc entries, making them accessible on the main documentation site.

🧠 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.

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.

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
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 introduces two new markdown files to enhance the documentation: an Authentication Decision Guide and an SDK Authentication Reference. The changes aim to provide developers with clear guidance on authentication methods within the OpenTDF platform, including decision-making flowcharts and code examples across multiple SDKs (Go, Java, JavaScript). I have added a review comment to improve the clarity of the documentation.

Comment thread docs/guides/authentication-guide.mdx
@github-actions
Copy link
Copy Markdown
Contributor

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

@marythought
Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds two new authentication-focused docs (SDK auth reference and decision guide), introduces a session-encryption section in TDF docs, adjusts frontmatter/titles/sidebar positions across several SDK pages, and marks the Osano CMP script async in Docusaurus config. All changes are documentation-only.

Changes

Cohort / File(s) Summary
Authentication docs (new)
docs/sdks/authentication.mdx, docs/guides/authentication-guide.mdx
Adds comprehensive authentication documentation: OIDC flows (Client Credentials, RFC 8693 Token Exchange, JS refresh-token flow, mTLS certificate exchange), Custom Token Source patterns, DPoP behavior and per-SDK configuration, and a decision guide with flowchart, checklist, and troubleshooting.
TDF docs update
docs/sdks/tdf.mdx
Introduces a "Session Encryption" section describing custom RSA session-key option (sdk.WithSessionEncryptionRSA) with a Go example; notes SDK auto-generates session key when omitted.
SDK frontmatter/title edits
docs/sdks/authorization.mdx, docs/sdks/discovery.mdx, docs/sdks/platform-client.mdx, docs/sdks/policy.mdx, docs/sdks/troubleshooting.mdx
Standardizes and updates frontmatter titles and sidebar_position values; adjusts a primary page heading for consistency.
Site config
docusaurus.config.ts
Adds async: "true" attribute to the Osano CMP script tag in headTags via an attributes addition.

Sequence Diagram(s)

(omitted — documentation-only changes; no sequence diagram generated)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • CMP Update #258 — modifies Osano/consent script and related site consent behavior; likely related to the docusaurus.config.ts headTags change.

Poem

🐰 Hopping through docs with a nib so spry,

Tokens, DPoP, and TLS under sky,
A guide for choices, a checklist to keep,
Session keys tucked in a burrowed heap,
Hop on, dev friend—auth’s tidy and spry! 🌿🔐

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding an authentication decision guide and SDK authentication reference documentation.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch DSPX-2388/auth-decision-guide

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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/openapi/check-vendored-yaml.ts (1)

74-82: ⚠️ Potential issue | 🟠 Major

Handle non-200 responses in fetchText to prevent silent false negatives.

At Line 81, the function resolves body content regardless of HTTP status. If raw fetch returns 404/429/5xx, hasApiPaths can misclassify the file and skip a real error path.

🔧 Proposed fix
 function fetchText(url: string): Promise<string> {
   return new Promise((resolve, reject) => {
     import('https').then(https => {
       const headers: Record<string, string> = { 'User-Agent': 'opentdf-docs-check-vendored-yaml' };
       if (GITHUB_TOKEN) {
         headers['Authorization'] = `token ${GITHUB_TOKEN}`;
       }
       https.get(url, { headers } as any, (response: any) => {
         let data = '';
-        response.on('data', (chunk: string) => { data += chunk; });
-        response.on('end', () => resolve(data));
+        response.on('data', (chunk: string) => { data += chunk; });
+        response.on('end', () => {
+          if (response.statusCode !== 200) {
+            reject(new Error(
+              `GitHub raw request failed: ${url}\n` +
+              `  Status: ${response.statusCode}\n` +
+              `  Response: ${data.slice(0, 200)}`
+            ));
+            return;
+          }
+          resolve(data);
+        });
       }).on('error', reject);
     }).catch(reject);
   });
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openapi/check-vendored-yaml.ts` around lines 74 - 82, The fetchText
function currently resolves the response body regardless of HTTP status; update
the https.get response handler in fetchText to inspect response.statusCode
(and/or response.status) and reject the Promise for non-2xx statuses (e.g.,
404/429/5xx) including status code and body/response message in the error so
callers like hasApiPaths don't get silent false negatives; keep the existing
headers logic (GITHUB_TOKEN) and still accumulate data on 'data' events, but on
'end' check status and call reject(...) for non-success codes, while resolving
only for successful 200-level responses.
🧹 Nitpick comments (4)
src/openapi/check-vendored-yaml.ts (1)

43-46: Consider centralizing GitHub header construction.

Both fetch paths duplicate the same header logic; a small helper would prevent drift.

♻️ Suggested refactor
 const GITHUB_TOKEN = process.env.GITHUB_TOKEN || '';
+
+function githubHeaders(): Record<string, string> {
+  const headers: Record<string, string> = { 'User-Agent': 'opentdf-docs-check-vendored-yaml' };
+  if (GITHUB_TOKEN) headers['Authorization'] = `token ${GITHUB_TOKEN}`;
+  return headers;
+}
...
-      const headers: Record<string, string> = { 'User-Agent': 'opentdf-docs-check-vendored-yaml' };
-      if (GITHUB_TOKEN) {
-        headers['Authorization'] = `token ${GITHUB_TOKEN}`;
-      }
-      https.get(url, { headers } as any, (response: any) => {
+      https.get(url, { headers: githubHeaders() } as any, (response: any) => {
...
-      const headers: Record<string, string> = { 'User-Agent': 'opentdf-docs-check-vendored-yaml' };
-      if (GITHUB_TOKEN) {
-        headers['Authorization'] = `token ${GITHUB_TOKEN}`;
-      }
-      https.get(url, { headers } as any, (response: any) => {
+      https.get(url, { headers: githubHeaders() } as any, (response: any) => {

Also applies to: 74-77

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

In `@src/openapi/check-vendored-yaml.ts` around lines 43 - 46, The duplicated
GitHub header construction (creating headers with 'User-Agent' and optionally
'Authorization' using GITHUB_TOKEN) should be extracted into a small helper
(e.g., getGitHubHeaders or buildGitHubHeaders) that returns
Record<string,string> and is reused in both places where headers is currently
built (the places using the headers variable and GITHUB_TOKEN). Replace the
inline header creation with a call to that helper, keeping the same header keys
('User-Agent' and 'Authorization') and behavior when GITHUB_TOKEN is present.
docs/sdks/discovery.mdx (1)

3-3: Optional: keep title and H1 wording aligned.

Line 3 sets title to Discovery, while the page heading remains “Attribute Discovery”. Aligning both can reduce naming drift in docs UX.

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

In `@docs/sdks/discovery.mdx` at line 3, The page title metadata currently reads
`title: Discovery` while the document H1 is “Attribute Discovery”; update one to
match the other for consistency—either change the frontmatter title to
`Attribute Discovery` or rename the H1 to `Discovery` (look for the `title:
Discovery` frontmatter and the H1 string "Attribute Discovery" and make them
identical).
docs/sdks/platform-client.mdx (1)

3-3: Consider aligning frontmatter title with the page H1.

Line 3 uses Architecture, while the visible H1 is “SDK Architecture: Core vs. Service Client”. Keeping both identical improves navigation/search consistency.

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

In `@docs/sdks/platform-client.mdx` at line 3, The frontmatter title currently
reads "Architecture" but the page H1 is "SDK Architecture: Core vs. Service
Client"; update the frontmatter title to match the visible H1 (set title: "SDK
Architecture: Core vs. Service Client") or alternatively change the H1 to match
the frontmatter so both the frontmatter title and the H1 are identical for
consistent navigation/search.
docs/sdks/authentication.mdx (1)

39-45: Standardize endpoint format across SDK examples for consistency.

Java examples consistently use host-only endpoints (e.g., platformEndpoint("localhost:8080")) while Go and JavaScript examples use full URLs with schemes (e.g., http://localhost:8080). Although the Java SDK likely infers the scheme from context (e.g., the useInsecurePlaintextConnection() flag), updating Java examples to match the explicit format of other SDKs improves clarity and follows a uniform pattern across the documentation.

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

In `@docs/sdks/authentication.mdx` around lines 39 - 45, Update the Java SDK
example to use a full URL for the endpoint to match other SDK docs: change the
SDKBuilder call that sets platformEndpoint(...) so it receives an explicit
scheme (e.g., "http://localhost:8080") instead of just "localhost:8080"; keep
the useInsecurePlaintextConnection(true) flag as-is to indicate a dev-only
insecure connection. Ensure the example still uses SDKBuilder, platformEndpoint,
clientSecret, and useInsecurePlaintextConnection so readers can locate the
snippet easily.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/guides/authentication-guide.md`:
- Line 171: Update the phrasing in the bullet that starts with "Self-signed
certs in dev:" by replacing both occurrences of "dev" with "development" (the
line referencing useInsecurePlaintextConnection(true) should read "Self-signed
certs in development:" and mention trusting the development CA) to satisfy style
linting and maintain consistency.

In `@docs/sdks/authentication.mdx`:
- Line 68: The copy duplicates the adverb "only" in the sentences that reference
clientSecretAuthProvider; edit the text around the symbol
clientSecretAuthProvider to remove the redundant "only" (e.g., change either
"should only be used in Node.js or server-side environments" to "should be used
in Node.js or server-side environments" or change "currently available only" to
"currently available"), and make the same single-word edit at the other
occurrence that references clientSecretAuthProvider so both places are
consistent.

---

Outside diff comments:
In `@src/openapi/check-vendored-yaml.ts`:
- Around line 74-82: The fetchText function currently resolves the response body
regardless of HTTP status; update the https.get response handler in fetchText to
inspect response.statusCode (and/or response.status) and reject the Promise for
non-2xx statuses (e.g., 404/429/5xx) including status code and body/response
message in the error so callers like hasApiPaths don't get silent false
negatives; keep the existing headers logic (GITHUB_TOKEN) and still accumulate
data on 'data' events, but on 'end' check status and call reject(...) for
non-success codes, while resolving only for successful 200-level responses.

---

Nitpick comments:
In `@docs/sdks/authentication.mdx`:
- Around line 39-45: Update the Java SDK example to use a full URL for the
endpoint to match other SDK docs: change the SDKBuilder call that sets
platformEndpoint(...) so it receives an explicit scheme (e.g.,
"http://localhost:8080") instead of just "localhost:8080"; keep the
useInsecurePlaintextConnection(true) flag as-is to indicate a dev-only insecure
connection. Ensure the example still uses SDKBuilder, platformEndpoint,
clientSecret, and useInsecurePlaintextConnection so readers can locate the
snippet easily.

In `@docs/sdks/discovery.mdx`:
- Line 3: The page title metadata currently reads `title: Discovery` while the
document H1 is “Attribute Discovery”; update one to match the other for
consistency—either change the frontmatter title to `Attribute Discovery` or
rename the H1 to `Discovery` (look for the `title: Discovery` frontmatter and
the H1 string "Attribute Discovery" and make them identical).

In `@docs/sdks/platform-client.mdx`:
- Line 3: The frontmatter title currently reads "Architecture" but the page H1
is "SDK Architecture: Core vs. Service Client"; update the frontmatter title to
match the visible H1 (set title: "SDK Architecture: Core vs. Service Client") or
alternatively change the H1 to match the frontmatter so both the frontmatter
title and the H1 are identical for consistent navigation/search.

In `@src/openapi/check-vendored-yaml.ts`:
- Around line 43-46: The duplicated GitHub header construction (creating headers
with 'User-Agent' and optionally 'Authorization' using GITHUB_TOKEN) should be
extracted into a small helper (e.g., getGitHubHeaders or buildGitHubHeaders)
that returns Record<string,string> and is reused in both places where headers is
currently built (the places using the headers variable and GITHUB_TOKEN).
Replace the inline header creation with a call to that helper, keeping the same
header keys ('User-Agent' and 'Authorization') and behavior when GITHUB_TOKEN is
present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 836ad35d-db3d-49b1-b784-83e69ca6a7e6

📥 Commits

Reviewing files that changed from the base of the PR and between 21b88e5 and 54a9a9a.

📒 Files selected for processing (9)
  • docs/guides/authentication-guide.md
  • docs/sdks/authentication.mdx
  • docs/sdks/authorization.mdx
  • docs/sdks/discovery.mdx
  • docs/sdks/platform-client.mdx
  • docs/sdks/policy.mdx
  • docs/sdks/tdf.mdx
  • docs/sdks/troubleshooting.mdx
  • src/openapi/check-vendored-yaml.ts

Comment thread docs/guides/authentication-guide.md Outdated
Comment thread docs/sdks/authentication.mdx Outdated
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 `@docs/guides/authentication-guide.md`:
- Around line 1-4: This new docs page is using .md but must be .mdx and follow
naming conventions: rename docs/guides/authentication-guide.md to a kebab-case
.mdx filename (e.g., authentication-decision-guide.mdx) or to index.mdx if it
should be a section landing page, and update any internal links/sidebars that
reference the old filename; ensure the frontmatter (title: Authentication
Decision Guide) stays intact and the file content is valid MDX.
- Line 132: Replace the Vale-failing phrase "Disabled (plaintext)" with a
spelling-friendly alternative in the docs—e.g., change it to "Disabled (plain
text)" (or "Disabled (unencrypted)") in the table cell currently showing "TLS |
Disabled (plaintext)"; update both occurrences referenced (the instances at the
positions corresponding to Line 132 and Line 160) so the wording is consistent
and passes Vale checks.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b15b3419-fd6e-4acb-b401-b6d60e7d474c

📥 Commits

Reviewing files that changed from the base of the PR and between 54a9a9a and c085d3e.

📒 Files selected for processing (1)
  • docs/guides/authentication-guide.md

Comment thread docs/guides/authentication-guide.mdx
Comment thread docs/guides/authentication-guide.mdx
marythought and others added 7 commits March 25, 2026 08:32
Add two new pages to help developers choose and configure authentication:

- docs/guides/authentication-guide.md: Decision flowchart, scenario matrix,
  dev vs production checklist, and common pitfalls for developers new to
  OpenTDF or figuring out how to authenticate with their specific setup.

- docs/sdks/authentication.mdx: SDK reference documenting all auth methods
  (client credentials, token exchange, refresh token, certificate exchange,
  custom token source, DPoP, session encryption) with Go/Java/JS examples.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use consistent noun-based titles and fix duplicate/gapped sidebar positions:
- "SDK Architecture: Core vs. Service Client" → "Architecture" (pos 3)
- Add missing title frontmatter to TDF, Policy, Authorization
- "Attribute Discovery" → "Discovery" (pos 7)
- Fix duplicate sidebar_position 4 (TDF=4, Policy=5)
- Tighten position gaps (was 2-10, now 1-8)

Final order: Authentication, Quickstart, Architecture, TDF, Policy,
Authorization, Discovery, Troubleshooting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Link OIDC, OAuth2, and mTLS to external reference docs
- Fix quickstart link to /quickstart (platform getting-started slug)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename authentication-guide.md to .mdx per project conventions
- Add http:// scheme to Java platformEndpoint for cross-SDK consistency
- Fix duplicate "only" adverb in authentication.mdx
- Align H1 headings with frontmatter titles in discovery and architecture pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@marythought marythought force-pushed the DSPX-2388/auth-decision-guide branch from c085d3e to f6fd8c9 Compare March 25, 2026 15:47
Comment thread docs/guides/authentication-guide.mdx Outdated
Comment thread docs/guides/authentication-guide.mdx Outdated
Comment thread docs/guides/authentication-guide.mdx Outdated
Comment thread docs/guides/authentication-guide.mdx Outdated
Comment thread docs/guides/authentication-guide.mdx Outdated
Comment thread docs/guides/authentication-guide.mdx
Comment thread docs/guides/authentication-guide.mdx
Comment thread docs/guides/authentication-guide.mdx Outdated
Comment thread docs/guides/authentication-guide.mdx
- Clarify that valid OIDC token alone isn't sufficient (audience, claims, scopes matter)
- Reframe browser auth as OIDC login flow, not just "refresh token"
- Explain access token + optional refresh token from IdP /token endpoint
- Add OIDC Authorization Code flow reference link
- Add print-access-token CLI example
- Note that OpenTDF doesn't prescribe deployment strategy
- Add CORS to production checklist and common pitfalls
- Expand audience check troubleshooting with jwt.io and YAML config tips

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: 1

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

Inline comments:
In `@docs/sdks/authentication.mdx`:
- Around line 24-320: This page contains many long inline code examples (e.g.,
the Go client creation using sdk.New with WithClientCredentials, token exchange
example using sdk.WithTokenExchange, JS examples using
AuthProviders.clientSecretAuthProvider / AuthProviders.externalAuthProvider /
AuthProviders.refreshAuthProvider, mTLS tls.Config + sdk.WithTLSCredentials,
custom token source using oauth2.StaticTokenSource or
sdk.WithOAuthAccessTokenSource, and session encryption using
sdk.WithSessionEncryptionRSA) which should be moved into separate files under
code_samples/ and referenced from the MDX using imports and <CodeBlock> (e.g.,
create client-credentials.go, token-exchange.go, refresh-token.ts, mtls.go,
custom-token-source.go, session-encryption.go in code_samples/sdks/auth/, export
them as raw and replace the inline blocks with mdx-code-block imports as shown
in the suggested pattern); update each embedded block accordingly so the docs
import the sample files instead of including long inline snippets.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ae638502-a2fd-4f15-975c-1c31911d7802

📥 Commits

Reviewing files that changed from the base of the PR and between c085d3e and 995377a.

📒 Files selected for processing (8)
  • docs/guides/authentication-guide.mdx
  • docs/sdks/authentication.mdx
  • docs/sdks/authorization.mdx
  • docs/sdks/discovery.mdx
  • docs/sdks/platform-client.mdx
  • docs/sdks/policy.mdx
  • docs/sdks/tdf.mdx
  • docs/sdks/troubleshooting.mdx
✅ Files skipped from review due to trivial changes (7)
  • docs/sdks/platform-client.mdx
  • docs/sdks/troubleshooting.mdx
  • docs/sdks/tdf.mdx
  • docs/sdks/policy.mdx
  • docs/sdks/discovery.mdx
  • docs/sdks/authorization.mdx
  • docs/guides/authentication-guide.mdx

Comment thread docs/sdks/authentication.mdx Outdated
eugenioenko
eugenioenko previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@eugenioenko eugenioenko left a comment

Choose a reason for hiding this comment

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

🎉

Docs looks great!

Comment thread docs/sdks/authentication.mdx
Comment thread docs/sdks/authentication.mdx
Comment thread docs/sdks/authentication.mdx Outdated
The synchronous Osano script blocks Docusaurus client-side hydration when
the consent service is unreachable (e.g., local development), breaking all
interactive components including tabs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Session encryption is about KAS rewrap key lifecycle, not authentication.
Also fixes the code example to show where the RSA private key comes from.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@marythought marythought changed the title docs: add authentication decision guide and SDK auth reference feat(docs): add authentication decision guide and SDK auth reference Mar 26, 2026
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: 1

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

Inline comments:
In `@docs/sdks/authentication.mdx`:
- Around line 99-104: The Java snippets use
SDKBuilder.platformEndpoint("localhost:8080") which is inconsistent with other
docs; update all occurrences (e.g., the SDKBuilder usage in the examples around
SDK, SDKBuilder, and platformEndpoint) to use an absolute URL like
"http://localhost:8080" (including the scheme) so copy/paste clients get a valid
endpoint; apply this change to both the snippet shown and the other instance
mentioned (lines ~258-261).
🪄 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: 7672a606-4cb4-4f82-99ed-5eb87fa569c7

📥 Commits

Reviewing files that changed from the base of the PR and between b10d206 and 6ec3883.

📒 Files selected for processing (2)
  • docs/sdks/authentication.mdx
  • docs/sdks/tdf.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/sdks/tdf.mdx

Comment thread docs/sdks/authentication.mdx
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.

3 participants