@pands/gateway 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/dist/index.js +5 -1
- package/package.json +8 -8
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @pands/gateway
|
|
2
|
+
|
|
3
|
+
> Reverse proxy gateway, OpenAPI specification merger, rate limiting, and internal JWT signer for the **Pand Application Platform**.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@pands/gateway)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
`@pands/gateway` sits in front of all microservices, routing incoming requests, managing public-to-private API namespaces, enforcing rate limits, validating session authentication, and injecting verified internal identity JWTs.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @pands/gateway
|
|
16
|
+
# or with npm:
|
|
17
|
+
npm install @pands/gateway
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Create Gateway App
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { createGatewayApp } from "@pands/gateway";
|
|
28
|
+
|
|
29
|
+
const app = createGatewayApp({
|
|
30
|
+
title: "Acme API Gateway",
|
|
31
|
+
version: "0.1.0",
|
|
32
|
+
services: {
|
|
33
|
+
core: { target: "http://localhost:3010", prefix: "/api/v1/core" },
|
|
34
|
+
billing: { target: "http://localhost:3011", prefix: "/api/v1/billing" },
|
|
35
|
+
},
|
|
36
|
+
authServiceTarget: "http://localhost:3010",
|
|
37
|
+
internalSecret: process.env.PAND_INTERNAL_SECRET || "dev-internal-secret",
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export default app;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT © [Mehdi Nosrati](https://github.com/MehdiNosrati)
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import crypto from "crypto";
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import path from "path";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
authTables,
|
|
7
|
+
createPandAuth,
|
|
8
|
+
resolveRequestActor
|
|
9
|
+
} from "@pands/auth";
|
|
6
10
|
import { resolveProjectPorts } from "@pands/config";
|
|
7
11
|
import { createDb } from "@pands/db";
|
|
8
12
|
import { createLogger } from "@pands/logger";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pands/gateway",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"@hono/node-server": "^1.13.8",
|
|
16
16
|
"@scalar/hono-api-reference": "^0.5.170",
|
|
17
17
|
"hono": "^4.7.2",
|
|
18
|
-
"@pands/
|
|
19
|
-
"@pands/
|
|
20
|
-
"@pands/
|
|
21
|
-
"@pands/
|
|
22
|
-
"@pands/
|
|
23
|
-
"@pands/
|
|
18
|
+
"@pands/config": "0.1.1",
|
|
19
|
+
"@pands/service": "0.1.1",
|
|
20
|
+
"@pands/db": "0.1.1",
|
|
21
|
+
"@pands/telemetry": "0.1.1",
|
|
22
|
+
"@pands/auth": "0.1.1",
|
|
23
|
+
"@pands/logger": "0.1.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@pands/testing": "0.1.
|
|
26
|
+
"@pands/testing": "0.1.1"
|
|
27
27
|
},
|
|
28
28
|
"description": "Reverse proxy, routing, and Better Auth authentication gateway for Pand",
|
|
29
29
|
"license": "MIT",
|