Skip to content

docs: publish authentication and function guides - #170

Merged
swkeever merged 7 commits into
mainfrom
skeever/sdk-public-guides
Sep 18, 2026
Merged

swkeever merged 7 commits into
mainfrom
skeever/sdk-public-guides

Conversation

@swkeever

Copy link
Copy Markdown
Collaborator

Add published authentication and function guides for the Python SDK. The authentication guide covers the existing facade's account, email, OAuth, profile, session adoption, refresh, and revocation behavior. The function guide explains invocation credentials, endpoint resolution, response values, and platform-versus-function errors. Link both from the quickstart and correct the stale README claim that a version header establishes dispatch.

Docs lint and all 30 native-language code blocks pass syntax validation. Examples were checked against the current handwritten facades; no API, wire contract, or shared scenario changes. Hosting #1127 remains the cumulative parity integration PR and merges last.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review. Please review code and security on the current head. This adds published authentication and function guides using the existing native facade and verified README examples. Docs lint and every Python/Ruby code block parse locally. Pay particular attention to session ownership/revocation, OAuth state validation, invocation credentials, and error classification. No wire, runtime, or shared-scenario changes. Hosting #1127 remains the integration PR and merges last.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T20:47:01.210449Z e0ab0ca Manual request
🔒 Security Review ✅ Completed 2026-09-18T20:47:43.778049Z e0ab0ca Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 6b834f998f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b834f998f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/authentication.md Outdated

```python
result = client.auth.sign_up(
email="new-user@example.com", password="secret", sign_in_when_allowed=True

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use policy-compliant passwords in authentication examples

Replace this password and the new-secret literal in the reset example with values of at least 15 characters. The API schema enforces a minimum configurable password length of 15 (openapi/openapi.yaml lines 11490-11495), so the documented signup always fails validation with secret, and the reset workflow likewise fails with its 10-character example.

Useful? React with 👍 / 👎.

Comment thread docs/functions.md
Comment on lines +7 to +8
Invoke a deployed function by its name.
This example assumes a public function named `hello` that accepts a JSON object.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Configure anonymous invocation permission for the example

When VOLCANO_ANON_KEY has the default auth-only permissions, making hello public is not enough for this example to run: anonymous invocation additionally requires the key's explicit functions.invoke permission (openapi/openapi.yaml lines 2781-2784 and 9652-9655), otherwise resolution or invocation returns 403. The standalone guide should tell users to enable that permission or construct the example client with a user/service credential.

Useful? React with 👍 / 👎.

Comment thread docs/authentication.md
Comment on lines +393 to +395
On success, `refresh_session()` replaces the in-memory session and returns the immutable new
snapshot. An authentication failure clears the session that initiated the request. Server and
transport failures preserve it, and a late response never replaces a newer session. The SDK does

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit the refresh-clearing guarantee to rejected tokens

This guarantee does not hold for every AuthenticationError: when returned refresh credentials fail the user/session continuity checks, or supplied credentials lack a usable session identifier, refresh_session() raises AuthenticationError while preserving the current session (src/volcano_sdk/auth.py lines 1129-1146). Callers may reasonably use the documented error classification to decide whether local credentials were cleared, so narrow this statement to an authentication rejection from the refresh endpoint and document that local continuity-validation failures preserve the session.

Useful? React with 👍 / 👎.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review. Please rerun code and security reviews on the new head. Examples now use passwords longer than the 15-character minimum, explicitly require anonymous functions.invoke permission, consume stored OAuth and hosted-auth callback state once before validation, distinguish server-rejected refreshes from local continuity-validation failures, and limit typed pre-dispatch errors to platform HTTP failures. Matching README guidance was corrected too. Docs lint and all Python/Ruby code blocks parse.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 188a64762f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 188a64762f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/authentication.md
session = client.auth.adopt_hosted_auth_session(
returned_session,
state=returned_state,
expected_state=hosted_state,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pass the consumed state to hosted-auth validation

When the redirect and callback are handled by separate requests, this example still passes the generation-time hosted_state rather than the value atomically fetched and deleted from the server-side session. A reader following the code can therefore validate without proving that the stored nonce existed or was consumed, allowing a hosted-auth callback to be replayed despite the preceding guidance. Mirror the OAuth example by assigning the consumed value (for example, stored_hosted_state) and passing that as expected_state.

Useful? React with 👍 / 👎.

Comment thread docs/authentication.md Outdated
Comment on lines +58 to +60
Successful `get_user()`, `update_user()`, `convert_anonymous()`, and
`confirm_email_change()` calls update that local snapshot without changing tokens
or emitting an auth-state event. Previously returned sessions remain immutable.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Account for refresh in profile-operation guarantees

When any of these profile operations receives HTTP 401 while a usable refresh token exists, Auth._session_request() refreshes the session before replaying the operation; this replaces both tokens and emits TOKEN_REFRESHED. A successful get_user(), update_user(), convert_anonymous(), or confirm_email_change() can therefore do exactly what this paragraph says it never does, which can cause callers to miss persisting or reacting to refreshed credentials. Qualify this guarantee as applying only when no automatic refresh is needed, or document the refresh side effect.

Useful? React with 👍 / 👎.

Comment thread docs/authentication.md

## Use hosted authentication

Build a managed hosted-auth URL:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the managed-auth prerequisite

For a project using the default configuration, managed_auth_enabled is false and the hosted page returned by this helper responds with HTTP 404. The guide currently moves directly from ordinary authentication setup to constructing the URL, so the hosted-auth workflow fails for readers who have not separately enabled managed hosted pages. State that managed authentication must be enabled before using this section.

Useful? React with 👍 / 👎.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review. Please rerun code and security reviews on the new head. Examples now use passwords longer than the 15-character minimum, explicitly require anonymous functions.invoke permission, consume stored OAuth and hosted-auth callback state once before validation, distinguish server-rejected refreshes from local continuity-validation failures, and limit typed pre-dispatch errors to platform HTTP failures. Matching README guidance was corrected too. Docs lint and all Python/Ruby code blocks parse.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review. Please review code and security on the current head. The guides and matching README now qualify credential changes during automatic refresh, document readable session-ID requirements and opaque-token sign-out fallback, use a longer anonymous-conversion password, and state Ruby callback exception behavior precisely. Python Markdown examples also pass Ruff formatting. No runtime or wire changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d819bc8675

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/authentication.md Outdated
Comment on lines +428 to +429
in transition order after the state lock is released, and callback failures cannot interrupt auth
operations. Unsubscribing prevents queued and future delivery; a callback already selected for

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Qualify the callback failure guarantee

Limit this guarantee to ordinary Exception subclasses. _notify_auth_state_change() deliberately re-raises non-Exception BaseException values after dispatch, and test_auth_state_dispatch_recovers_after_a_base_exception confirms that a callback raising KeyboardInterrupt causes sign_in() to raise even though the session transition completed. As written, callers may incorrectly assume that every callback failure is isolated from the initiating auth call.

Useful? React with 👍 / 👎.

Comment thread docs/authentication.md Outdated
Comment on lines +321 to +323
The request uses the current access token. Deleting that token's own session clears local
credentials, including when the request outcome is uncertain; deleting another session preserves
them. If another authentication operation replaces the session before deletion finishes, the method

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Qualify self-deletion clearing for readable session IDs

When the active access token is opaque or its JWT lacks a readable UUID session_id, delete_session() cannot recognize that the supplied ID is current: session_id_from_access_token() returns None, deletes_current remains false, and a successful server deletion preserves the now-revoked local credentials. This can occur when callers select the is_current entry returned by list_sessions(), so qualify the clearing guarantee—and its matching README text—with the readable-session-ID requirement.

Useful? React with 👍 / 👎.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review. Please rerun code and security on the current head. The guides and README now require readable session IDs for supplied-credential refresh and self-deletion recognition, qualify other-session deletion during automatic refresh, specify supplied-token precedence for function calls, and distinguish ordinary callback exceptions from process-control exceptions. Matched these claims against the native auth/session and function implementations; docs lint, code-block syntax, and Python formatting pass.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42ad4e7235

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/authentication.md Outdated
Comment on lines +323 to +324
Without that identifier, the SDK cannot recognize self-deletion. Other deletions retain the
local session, though automatic HTTP 401 recovery can rotate credentials and emit `TOKEN_REFRESHED`. If another authentication operation replaces the session before deletion finishes, the method

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Qualify retention when automatic refresh is rejected

When deletion of another session receives HTTP 401 and the refresh endpoint rejects the refresh token, Auth._perform_refresh() clears the captured local session before delete_session() raises the original authentication error. The new qualification covers successful refresh rotation only, so the unconditional statement that other deletions retain the local session remains false for this recovery-failure path; limit it to requests not followed by a rejected refresh or document that rejection clears credentials.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 42ad4e7235

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review. Please rerun code and security on the current head. Clarified the remaining other-session deletion edge: the deletion itself does not clear local state, while automatic recovery can rotate credentials or clear the captured session when the server rejects refresh. README and guide agree. Formatting and docs lint pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 0b7c9d0f22

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex security review. Please rerun security review on current head 0b7c9d0 and report the result. The summary marks the previous security review completed but says finding details are still loading; there is no current-head security result or inline finding visible through the complete GitHub comment/review APIs. Code review and CI are clean. We are holding the merge until the current-head security result is clear.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review. Please review code and security on the new head after rebasing onto merged function recovery #173. The authentication corrections are unchanged; the function guide now documents pre-dispatch 401 recovery, captured session/payload, and non-retry boundaries. The README retains the merged runtime PR guidance. Docs lint, code-block syntax and Ruff formatting pass.

@swkeever
swkeever force-pushed the skeever/sdk-public-guides branch from 0b7c9d0 to e0ab0ca Compare September 18, 2026 20:43
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: e0ab0caa7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: e0ab0caa7e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@swkeever
swkeever marked this pull request as ready for review September 18, 2026 20:51
@swkeever
swkeever merged commit 73b195c into main Sep 18, 2026
6 checks passed
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.

1 participant