Skip to content

docs: document ctx JSON object support for context-aware authorization#289

Open
samsternberg wants to merge 1 commit intoskyflowapi:mainfrom
samsternberg:feat/ctx-json-object-docs
Open

docs: document ctx JSON object support for context-aware authorization#289
samsternberg wants to merge 1 commit intoskyflowapi:mainfrom
samsternberg:feat/ctx-json-object-docs

Conversation

@samsternberg
Copy link
Copy Markdown

Summary

  • Documents the existing ctx JSON object support in bearer token and signed data token generation
  • The Node SDK already supports ctx as string | Record<string, any> (shipped in SK-2391), but the README and samples only showed string usage
  • Adds README examples showing both string context (ctx: 'user_12345') and object context (ctx: { role: 'admin', department: 'finance' })
  • Explains how ctx object keys map to Skyflow CEL policy variables (request.context.role, request.context.department)
  • Documents the context field on PathCredentials/StringCredentials for automatic token generation
  • Updates sample files to demonstrate both string and object approaches for bearer and signed data tokens

Test plan

  • Verify README renders correctly on GitHub
  • Verify sample code compiles with tsc
  • No code changes — documentation only

Resolves: DOCU-1441

🤖 Generated with Claude Code

The Node SDK already supports ctx as string | Record<string, any> (shipped
in SK-2391), but the README and samples only showed string usage. This adds:

- README: code examples for both string and object ctx patterns
- README: explains how ctx keys map to Skyflow CEL policy variables
  (request.context.role, request.context.department, etc.)
- README: documents context field on PathCredentials/StringCredentials
- README: signed data tokens section now shows object ctx usage
- Samples: bearer token example shows string, object, and creds approaches
- Samples: signed token example shows string and object approaches

Resolves: DOCU-1441

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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