feat: Update Python and Node SDKs for OSS gateway compatibility#4
Merged
Conversation
BREAKING CHANGE: SDK endpoints updated from enterprise to OSS gateway.
Python SDK:
- agent_client.py: Replace identity-based badge-in with X-Admin-Token auth
- /v1/mint → POST /api/capability/mint (with X-Admin-Token header)
- /v1/mint/delegate → POST /api/capability/delegate
- Add support for pre-existing tokens via 'token' param or SATGATE_TOKEN env
- Add ping() and validate_token() convenience methods
- client.py: Rewrite for OSS endpoints
- tokens.mint() → POST /api/capability/mint {scope, duration}
- tokens.validate() → POST /api/capability/validate
- tokens.delegate() → POST /api/capability/delegate
- governance.ban() → POST /api/governance/ban
- governance.get_graph() → GET /api/governance/graph
- governance.reset() → POST /api/governance/reset
- health() → GET /health
- Remove enterprise-only: ConfigService, StatsService, tokens.list/get/revoke
- langchain.py: Update to use admin_token/token instead of identity providers
- models.py: Simplify to match OSS response shapes, add GraphData model
- __init__.py: Update exports (remove identity providers, add GraphData)
Node SDK:
- client.ts: Rewrite for OSS endpoints (same endpoint changes as Python)
- Add ping() method for token verification
- Remove enterprise-only: ConfigService, StatsService, tokens.list/get/revoke
- agent-client.ts: Replace identity-based auth with admin token auth
- Add adminToken/token options, SATGATE_ADMIN_TOKEN/SATGATE_TOKEN env support
- Add ping(), validateToken(), delegate() convenience methods
- types.ts: Simplify to match OSS types, add GraphData/GraphStats
- index.ts: Update exports
Docs:
- Add docs/guides/langchain-integration.md with practical examples:
- SatGateTool single tool usage
- SatGateToolkit for multiple tools with shared budget
- Budget-aware agent patterns
- Delegation for worker agents (least-privilege)
- L402 Lightning payment integration
- REST API tool for flexible access
- Full research agent example
Housekeeping:
- Add .gitignore (sdk/python/venv/, sdk/python/dist/, dist/, node_modules/)
- Remove sdk/python/venv/ and sdk/python/dist/ from git tracking
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates both SDKs to work with the SatGate OSS gateway endpoints instead of the enterprise endpoints that don't exist in the OSS build.
Breaking Changes
All SDK endpoints have been updated from enterprise paths to OSS paths:
/v1/mint→POST /api/capability/mint/v1/mint/delegate→POST /api/capability/delegate/api/v1/tokens→POST /api/capability/mint/api/v1/governance/ban→POST /api/governance/ban/api/v1/governance/banlist→GET /api/governance/graph/healthz→GET /healthEnterprise-only services removed:
ConfigService,StatsService,tokens.list/get/revoke,governance.unbanAuthentication changed from identity-based badge-in to
X-Admin-Tokenheader for minting.Python SDK Changes
agent_client.py: Admin token auth (X-Admin-Token), env vars (SATGATE_ADMIN_TOKEN,SATGATE_TOKEN)client.py: Rewritten for OSS endpoints withTokensService(mint/validate/delegate) andGovernanceService(ban/get_graph/reset)langchain.py: Updated to use admin_token/token paramsmodels.py: Simplified to match OSS response shapes, addedGraphDatasdk/python/venv/andsdk/python/dist/from git trackingNode SDK Changes
client.ts: Rewritten for OSS endpoints, addedping()methodagent-client.ts: Admin token auth, addedping(),validateToken(),delegate()types.ts: AddedGraphData,GraphStats, simplified typesNew: LangChain Integration Guide
docs/guides/langchain-integration.mdHousekeeping
.gitignore(venv, dist, node_modules, IDE files)