Skip to content

docs: document credentialFile.structure support - #25786

Open
dvdksn wants to merge 2 commits into
docker:mainfrom
dvdksn:codex/sbx-credential-structure
Open

docs: document credentialFile.structure support#25786
dvdksn wants to merge 2 commits into
docker:mainfrom
dvdksn:codex/sbx-credential-structure

Conversation

@dvdksn

@dvdksn dvdksn commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Update the kit spec reference for Docker Sandboxes v0.39.0 to document credentialFile.structure alongside credentialFile.template. Show the declarative structure form in the OAuth example and document its supported placeholders, typed JSON output, and precedence when both fields are set, as implemented by docker/sandboxes#4830.

@netlify /ai/sandboxes/customize/kit-reference/

Preview the updated kit spec reference

Generated by Codex

@dvdksn dvdksn added this to the sbx/v0.39.0 milestone Aug 11, 2026
@dvdksn dvdksn added the status/review Pull requests that are ready for review label Aug 11, 2026
@dvdksn
dvdksn requested a review from a team August 11, 2026 14:22
@dvdksn
dvdksn force-pushed the codex/sbx-credential-structure branch from 5f87b5f to 6c523e4 Compare August 11, 2026 14:24
@dvdksn dvdksn changed the title docs: prefer credentialFile.structure in kit reference docs: document credentialFile.structure support Aug 11, 2026
The kit reference marked credentialFile.structure as unsupported even though Docker Sandboxes 0.39.0 implements its runtime rendering.

Update the OAuth example and field reference to document structure alongside template, including typed JSON output and precedence when both fields are set.
@dvdksn
dvdksn force-pushed the codex/sbx-credential-structure branch from 6c523e4 to 1f169e1 Compare August 11, 2026 14:27

@docker-agent docker-agent left a comment

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.

Assessment: 🔴 CRITICAL

One high-severity and one medium-severity issue found in the new credentialFile.structure documentation.

Comment thread content/manuals/ai/sandboxes/customize/kit-reference.md
Comment thread content/manuals/ai/sandboxes/customize/kit-reference.md
The placeholder descriptions overexplained implementation distinctions and made the reference difficult to scan.

List the supported placeholders directly and keep the behavior explanation focused on rendered JSON and precedence.
@dvdksn
dvdksn force-pushed the codex/sbx-credential-structure branch from 27847a6 to a36eded Compare August 11, 2026 14:33
@dvdksn
dvdksn requested a review from mdelapenya August 11, 2026 14:54
@dvdksn
dvdksn marked this pull request as ready for review August 11, 2026 14:54

@docker-agent docker-agent left a comment

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.

Assessment: 🟢 APPROVE

The changes accurately document credentialFile.structure support alongside credentialFile.template. The YAML example is updated correctly, the table rows reflect the right precedence rule, and the placeholder syntax ({{.Scopes}} / {{.ExpiresAt}} as quoted strings) is intentional and correct — the runtime replaces those YAML strings with native typed values before JSON encoding. No style guide violations, vendored content, missing redirects, or broken markdown found.

@docker-agent docker-agent left a comment

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.

Assessment: 🟡 NEEDS ATTENTION

| `credentialFile.template` | Go template used to render the credential file. Supports `{{.AccessToken}}`, `{{.RefreshToken}}`, `{{.ExpiresAt}}`, `{{.Scopes}}`, and `{{.ScopesJSON}}`. Use `{{.ScopesJSON}}` for a JSON array. |
| `credentialFile.structure` | Declarative JSON shape defined by schema v2 but not supported by the `sbx` engine. A structure-only kit fails validation. Use `credentialFile.template`. |
| `credentialFile.structure` | Declarative JSON shape. Supports `{{.AccessToken}}`, `{{.RefreshToken}}`, `{{.ExpiresAt}}`, and `{{.Scopes}}`. |
| `credentialFile.template` | Go template. Supports `{{.AccessToken}}`, `{{.RefreshToken}}`, `{{.ExpiresAt}}`, `{{.Scopes}}`, and `{{.ScopesJSON}}`. |

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] Guidance on using {{.ScopesJSON}} for JSON array in template removed

The previous credentialFile.template description included: "Use {{.ScopesJSON}} for a JSON array." That hint is now gone.

In template context, {{.Scopes}} renders as a Go slice ([scope1 scope2]), which is not valid JSON. {{.ScopesJSON}} renders as a proper JSON array (["scope1","scope2"]). Without this guidance, a user writing a JSON credential file using template who reaches for {{.Scopes}} (which is now listed in both fields' descriptions) will produce malformed JSON.

Consider restoring the distinguishing note, for example:

| `credentialFile.template` | Go template. Supports `{{.AccessToken}}`, `{{.RefreshToken}}`, `{{.ExpiresAt}}`, `{{.Scopes}}`, and `{{.ScopesJSON}}`. Use `{{.ScopesJSON}}` to render scopes as a JSON array. |

@docker-agent docker-agent left a comment

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.

Assessment: 🟡 NEEDS ATTENTION

accessToken: "{{.AccessToken}}"
refreshToken: "{{.RefreshToken}}"
expiresAt: "{{.ExpiresAt}}"
scopes: "{{.Scopes}}"

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] Quoted {{.Scopes}} placeholder in YAML example is misleading without explanation of array promotion

The example shows scopes: "{{.Scopes}}" as a quoted YAML string, but the runtime promotes this value to a native JSON array before encoding. A kit author reading the example would naturally expect a JSON string for scopes and might reach for {{.ScopesJSON}} (which the table correctly notes is only supported by template, not structure) or manually construct a YAML sequence — both of which would produce a broken configuration.

Consider adding a brief note near the example or in the prose paragraph below the table explaining that when a structure value consists solely of a placeholder, the runtime replaces it with the native typed value: expiresAt becomes a JSON number and scopes becomes a JSON array.

| `responseFields` | Overrides the default field names the proxy reads from the token response. |
| `passthrough` | If `true`, the proxy passes the token response through unchanged instead of replacing the tokens with sentinels. |

`credentialFile.structure` provides a declarative alternative to

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] No explanation of typed JSON promotion for quoted structure placeholders

The prose states "The engine renders it as well-formed JSON" but does not explain the runtime's typed-promotion behavior: when a structure value consists only of a placeholder (e.g., "{{.ExpiresAt}}"), the engine replaces the YAML string with the native typed value before JSON encoding — so expiresAt becomes a JSON number and scopes becomes a JSON array, not JSON strings.

Without this explanation, readers who see quoted-string placeholders in the YAML example have no way to understand the resulting JSON shape. A single clarifying sentence here (or a > [!NOTE] callout) would close the gap.

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

Labels

area/ai status/review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants