
Security News
GPT-6 Astra Attempts Supply Chain Attacks Against Open Source Maintainers in Testing
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.
@grantex/gateway
Advanced tools
Zero-code reverse-proxy gateway that enforces Grantex grant tokens via YAML config
Zero-code reverse-proxy that enforces Grantex grant tokens in front of any API via YAML config.
npm install @grantex/gateway @grantex/sdk
1. Create gateway.yaml:
upstream: https://api.internal.example.com
jwksUri: https://your-auth-server/.well-known/jwks.json
port: 8080
upstreamHeaders:
X-Internal-Auth: "secret-key"
routes:
- path: /calendar/**
methods: [GET]
requiredScopes: [calendar:read]
- path: /calendar/**
methods: [POST, PUT, PATCH]
requiredScopes: [calendar:write]
- path: /payments/**
methods: [POST]
requiredScopes: [payments:initiate]
2. Start the gateway:
npx @grantex/gateway --config gateway.yaml
3. Make requests with grant tokens:
curl -H "Authorization: Bearer <grant-token>" \
http://localhost:8080/calendar/events
Client → Gateway (verify token + check scopes) → Upstream API
X-Grantex-* context headers, forwards to upstream| Field | Type | Required | Description |
|---|---|---|---|
upstream | string | Yes | Base URL of the upstream API |
jwksUri | string | Yes | JWKS endpoint for offline token verification |
port | number | No | Listen port (default: 8080) |
upstreamHeaders | object | No | Headers added to every upstream request |
grantexApiKey | string | No | API key for audit logging |
routes | array | Yes | Route definitions (see below) |
| Field | Type | Description |
|---|---|---|
path | string | URL path pattern (* = single segment, ** = any depth) |
methods | string[] | HTTP methods (GET, POST, PUT, PATCH, DELETE) |
requiredScopes | string[] | Scopes that must be present in the grant token |
The gateway adds these headers to upstream requests:
| Header | Value |
|---|---|
X-Grantex-Principal | Principal ID from the grant token |
X-Grantex-Agent | Agent DID from the grant token |
X-Grantex-GrantId | Grant ID from the grant token |
| Status | Error Code | When |
|---|---|---|
| 404 | ROUTE_NOT_FOUND | No route matches the request |
| 401 | TOKEN_MISSING | No Bearer token in Authorization header |
| 401 | TOKEN_INVALID | Token signature verification failed |
| 401 | TOKEN_EXPIRED | Token has expired |
| 403 | SCOPE_INSUFFICIENT | Grant doesn't include required scopes |
| 502 | UPSTREAM_ERROR | Upstream API is unreachable |
Use the gateway programmatically:
import { createGatewayServer, loadConfig } from '@grantex/gateway';
const config = loadConfig('./gateway.yaml');
const server = createGatewayServer(config);
await server.listen({ port: config.port });
docker build -t grantex-gateway packages/gateway/
docker run -p 8080:8080 -v ./gateway.yaml:/etc/grantex/gateway.yaml grantex-gateway
@grantex/sdk >= 0.1.0Apache-2.0
FAQs
Zero-code reverse-proxy gateway that enforces Grantex grant tokens via YAML config
We found that @grantex/gateway demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.