360 Secure SkillHub
360 安全技能中心

api-gateway

通过 Node.js 命令行脚本调用用户授权的外部 HTTPS API,支持以标准输入存入凭据、按主机精确授权、重试、限流与熔断统计、请求日志、回退配置和可选响应缓存;不跟随重定向,默认拦截带凭据的明文请求,状态文件保存在本地工作区。

分类:开发
jlacroix82
jlacroix82
热度 70.15
最近更新 2026-12-02 17:59:54

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add jlacroix82/api-proxy
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
api-gateway
description
Call approved external API endpoints with retries, rate tracking, and opt-in response caching. Credentials are sent only to configured HTTPS origins.
version
1.1.13
metadata
{"openclaw":{"requires":{"bins":["node"]},"envVars":[{"name":"API_GATEWAY_DIR","required":false,"description":"Alternate workspace for gateway state."},{"name":"API_GATEWAY_ALLOW_HTTP","required":false,"description":"Explicit opt-in to unauthenticated plaintext requests."}]}}

API Gateway

Run node {baseDir}/api-gateway.js. Send only user-approved endpoints and data. The caller must ensure prompt data and request bodies are appropriate for the named provider. The gateway does not follow redirects. Bearer credentials require HTTPS on the default port and an exact configured hostname. Configure replacement hosts explicitly if upgrading from a wildcard allowlist.

  • --keys add <provider> --stdin --allow-domain <hostname>: pipe a credential from an approved source. Repeat --allow-domain to add exact hostnames. A matching <PROVIDER>_API_KEY environment variable takes precedence over a saved value.
  • --keys, --keys remove <provider>: list or remove a configured provider. Approve removal first.
  • --call <provider> <https-url> [json] [--dry-run]: POST to the endpoint or inspect the destination and credential policy without sending.
  • --cache, --log, --status, --rate <provider>, --circuit: inspect gateway state.
  • --cache-full <provider>: explicitly enable storage of complete response bodies for that provider. They may contain sensitive data; entries expire after five minutes of reuse eligibility. --cache --clear removes stored cache data, and --log --clear clears request logs.
  • --fallback <provider> <alternate>: configure a fallback. The alternate must independently approve the same destination.

Keys stored on disk are plaintext. The store defaults to memory/api-gateway; use an owner-only workspace, including a restrictive ACL on Windows. Request logs hold provider, status class, time, and attempt. Metadata is cached by default; only opted-in complete responses can serve cache hits. API_GATEWAY_ALLOW_HTTP=1 is restricted to unauthenticated requests.

Version 1.1.13 blocks credentialed plaintext requests, scopes cache entries to endpoint and credential, uses private atomic state files, and replaces key values in command arguments with stdin.