@rstreamlabs/tunnels 1.0.1 → 1.0.2
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 +14 -6
- package/dist/index.d.mts +2047 -36
- package/dist/index.d.ts +2047 -36
- package/dist/index.js +113 -69
- package/dist/index.mjs +112 -69
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,6 +61,9 @@ const { token } = await client.auth.createAuthToken({ expires_in: 60 });
|
|
|
61
61
|
|
|
62
62
|
## Fine-Grained Tokens
|
|
63
63
|
|
|
64
|
+
Use `scopes` for a global grant, or `tunnelsGrants` when the token must be restricted
|
|
65
|
+
to specific workspaces or projects.
|
|
66
|
+
|
|
64
67
|
```ts
|
|
65
68
|
import { RstreamTunnelsClient } from "@rstreamlabs/tunnels";
|
|
66
69
|
|
|
@@ -74,13 +77,18 @@ const admin = new RstreamTunnelsClient({
|
|
|
74
77
|
|
|
75
78
|
const { token } = await admin.auth.createAuthToken({
|
|
76
79
|
expires_in: 60,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
tunnelsGrants: [
|
|
81
|
+
{
|
|
82
|
+
projects: ["project-id"],
|
|
83
|
+
scopes: {
|
|
84
|
+
tunnels: {
|
|
85
|
+
create: { filters: { protocol: { oneof: ["http"] } } },
|
|
86
|
+
connect: { params: { path: { regex: "^/api" } } },
|
|
87
|
+
list: { select: { id: true, name: true, protocol: true } },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
82
90
|
},
|
|
83
|
-
|
|
91
|
+
],
|
|
84
92
|
});
|
|
85
93
|
```
|
|
86
94
|
|