unkey 2.0.107-rc.3 → 2.0.144

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 CHANGED
@@ -1,24 +1,44 @@
1
1
  <div align="center">
2
2
  <h1 align="center">Unkey</h1>
3
- <h5>Open Source API authentication and authorization</h5>
3
+ <h5>The Developer Platform for Modern APIs</h5>
4
4
  </div>
5
5
 
6
6
  <div align="center">
7
- <a href="https://go.unkey.com">unkey.com</a>
7
+ <a href="https://go.unkey.com">unkey.com</a> ·
8
+ <a href="https://www.unkey.com/docs">Docs</a> ·
9
+ <a href="https://engineering.unkey.com">Engineering</a> ·
10
+ <a href="https://go.unkey.com/discord">Discord</a>
8
11
  </div>
9
12
  <br/>
10
13
 
11
- ## Contributing
14
+ ## What is Unkey?
12
15
 
13
- We welcome contributions! To ensure your work doesn't conflict with ongoing work, please:
16
+ **Unkey is the developer platform for modern APIs.** We unify your infrastructure so you can ship faster: deploy APIs instantly, route traffic through global gateways, and understand usage — all in one place.
14
17
 
15
- 1. Read our [contributing guide](https://engineering.unkey.com/docs/contributing)
16
- 2. **Discuss your ideas with us in public channels (GitHub/Discord) BEFORE starting development** (No private DMs)
17
- 3. Get approval from a core team member
18
+ - **Deploy** — push an API to production in seconds, with zero infrastructure to manage
19
+ - **Gateway** — route, authenticate, and shape traffic through globally distributed gateways
20
+ - **API Keys** — issue, verify, and revoke keys with fast global verification
21
+ - **Ratelimiting** — globally consistent, durable ratelimiting for any identifier
22
+ - **Permissions & RBAC** — per-key permissions, roles, and fine-grained access control
23
+ - **Analytics** — usage, latency, and per-key insights across every request
24
+ - **Audit logs** — immutable history of every action across your workspace
18
25
 
19
- This helps us align efforts and prevents duplicated or conflicting work.
20
26
 
21
- ## Let's talk
27
+ ## License
28
+
29
+ Please find the license under the [LICENSE](./LICENSE) file.
30
+
31
+ ## Pull requests
32
+
33
+ **Unkey is not accepting external pull requests at this time.**
34
+
35
+ Unkey has paused external code contributions while the team focuses on platform direction and stability. Pull requests opened by people outside the Unkey team will not be reviewed or merged.
36
+
37
+ Issues remain open for bug reports, feature requests, and documentation feedback. This repository remains public and source-available so you can read the code, fork it under the terms of the AGPL, and self-host. Unkey may revisit this policy in the future, and any change will be announced here.
38
+
39
+ If you've found a security issue, please email [security@unkey.com](mailto:security@unkey.com) instead of opening a public issue.
40
+
41
+ ## Let's Talk
22
42
 
23
43
  <a href="https://unkey.cal.com/unkey/user-interview?utm_source=banner&utm_campaign=oss"><img alt="Book us with Cal.com" src="https://cal.com/book-with-cal-dark.svg" /></a>
24
44
 
package/install.js CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  // This file was generated by GoReleaser. DO NOT EDIT.
4
4
 
5
- const { install } = require("./lib.js");
5
+ import { install } from "./lib.js";
6
6
  install();
package/lib.js CHANGED
@@ -1,15 +1,21 @@
1
1
  // This file was generated by GoReleaser. DO NOT EDIT.
2
- const { archives, name, version } = require("./package.json");
3
- const fs = require("fs");
4
- const crypto = require("crypto");
5
- const path = require("path");
6
- const JSZip = require("jszip");
7
- const tar = require("tar");
8
- const axios = require("axios");
9
- const { ProxyAgent } = require("proxy-agent");
10
- const { spawnSync } = require("child_process");
2
+ import fs from "fs";
3
+ import crypto from "crypto";
4
+ import http from "http";
5
+ import https from "https";
6
+ import path from "path";
7
+ import JSZip from "jszip";
8
+ import { x as tarExtract } from "tar";
9
+ import { ProxyAgent } from "proxy-agent";
10
+ import { spawnSync } from "child_process";
11
+ import { fileURLToPath } from "url";
12
+
13
+ const { archives, name, version } = JSON.parse(
14
+ fs.readFileSync(new URL("./package.json", import.meta.url), "utf8"),
15
+ );
11
16
 
12
17
  const agent = new ProxyAgent();
18
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
13
19
 
14
20
  const getArchive = () => {
15
21
  let target = `${process.platform}-${process.arch}`;
@@ -30,7 +36,7 @@ async function extractTar(tarPath, binaries, dir, wrappedIn) {
30
36
  )
31
37
  : binaries;
32
38
 
33
- await tar.x({
39
+ await tarExtract({
34
40
  file: tarPath,
35
41
  cwd: dir,
36
42
  filter: (path) => filesToExtract.includes(path),
@@ -173,7 +179,7 @@ const verify = (filename, checksum) => {
173
179
  }
174
180
  };
175
181
 
176
- const download = async (url, filename) => {
182
+ const download = async (url, filename, maxRedirects = 10) => {
177
183
  try {
178
184
  console.log(`Downloading ${url} to ${filename}...`);
179
185
  const dir = path.dirname(filename);
@@ -181,27 +187,56 @@ const download = async (url, filename) => {
181
187
  fs.mkdirSync(dir, { recursive: true });
182
188
  }
183
189
 
184
- const response = await axios({
185
- method: "GET",
186
- url: url,
187
- responseType: "stream",
188
- timeout: 300000, // 5min
189
- httpAgent: agent,
190
- httpsAgent: agent,
191
- });
190
+ return new Promise((resolve, reject) => {
191
+ const parsedUrl = new URL(url);
192
+ const mod = parsedUrl.protocol === "https:" ? https : http;
192
193
 
193
- const writer = fs.createWriteStream(filename);
194
- response.data.pipe(writer);
194
+ const request = mod.get(url, { agent }, (response) => {
195
+ if (
196
+ response.statusCode >= 300 &&
197
+ response.statusCode < 400 &&
198
+ response.headers.location
199
+ ) {
200
+ if (maxRedirects <= 0) {
201
+ reject(new Error("Too many redirects"));
202
+ return;
203
+ }
204
+ download(response.headers.location, filename, maxRedirects - 1)
205
+ .then(resolve)
206
+ .catch(reject);
207
+ return;
208
+ }
195
209
 
196
- return new Promise((resolve, reject) => {
197
- writer.on("finish", () => {
198
- console.log(`Download complete: ${filename}`);
199
- resolve(dir);
210
+ if (response.statusCode !== 200) {
211
+ reject(
212
+ new Error(
213
+ `HTTP ${response.statusCode}: ${response.statusMessage}`,
214
+ ),
215
+ );
216
+ return;
217
+ }
218
+
219
+ const writer = fs.createWriteStream(filename);
220
+ response.pipe(writer);
221
+
222
+ writer.on("finish", () => {
223
+ console.log(`Download complete: ${filename}`);
224
+ resolve(dir);
225
+ });
226
+
227
+ writer.on("error", (err) => {
228
+ console.error(`Error writing file: ${err.message}`);
229
+ reject(err);
230
+ });
231
+ });
232
+
233
+ request.on("error", (err) => {
234
+ reject(new Error(`Request failed: ${err.message}`));
200
235
  });
201
236
 
202
- writer.on("error", (err) => {
203
- console.error(`Error writing file: ${err.message}`);
204
- reject(err);
237
+ request.setTimeout(300000, () => {
238
+ request.destroy();
239
+ reject(new Error("Request timed out"));
205
240
  });
206
241
  });
207
242
  } catch (err) {
@@ -216,8 +251,9 @@ function exists(archive) {
216
251
  return archive.bins.every((bin) => fs.existsSync(path.join(binDir, bin)));
217
252
  }
218
253
 
219
- module.exports = {
254
+ export {
220
255
  install,
221
256
  run,
222
257
  getArchive,
258
+ download,
223
259
  };
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "unkey",
3
- "version": "2.0.107-rc.3",
3
+ "type": "module",
4
+ "version": "2.0.144",
4
5
  "description": "Unkey CLI",
5
6
  "scripts": {
6
7
  "postinstall": "node install.js",
@@ -18,58 +19,57 @@
18
19
  "unkey": "run-unkey.js"
19
20
  },
20
21
  "dependencies": {
21
- "axios": "^1.8.2",
22
- "jszip": "^3.10.1",
23
- "proxy-agent": "^6.5.0",
24
- "tar": "^7.4.3"
22
+ "jszip": "3.10.1",
23
+ "proxy-agent": "8.0.1",
24
+ "tar": "7.5.13"
25
25
  },
26
26
  "archives": {
27
27
  "darwin-arm64": {
28
28
  "name": "unkey_Darwin_arm64.tar.gz",
29
- "url": "https://github.com/unkeyed/unkey/releases/download/v2.0.107-rc.3/unkey_Darwin_arm64.tar.gz",
29
+ "url": "https://github.com/unkeyed/unkey/releases/download/v2.0.144/unkey_Darwin_arm64.tar.gz",
30
30
  "bins": [
31
31
  "unkey"
32
32
  ],
33
33
  "format": "tar.gz",
34
34
  "checksum": {
35
35
  "algorithm": "sha256",
36
- "digest": "ddd566be030315a8f9221d18b6dc1e67329224914cc2489b0a7c6aef78ffc4f1"
36
+ "digest": "1952e53e057fbeb1cd0c2e1bfcb75c7a4d5a6e7364086adc250445c907dd8f10"
37
37
  }
38
38
  },
39
39
  "darwin-x64": {
40
40
  "name": "unkey_Darwin_x86_64.tar.gz",
41
- "url": "https://github.com/unkeyed/unkey/releases/download/v2.0.107-rc.3/unkey_Darwin_x86_64.tar.gz",
41
+ "url": "https://github.com/unkeyed/unkey/releases/download/v2.0.144/unkey_Darwin_x86_64.tar.gz",
42
42
  "bins": [
43
43
  "unkey"
44
44
  ],
45
45
  "format": "tar.gz",
46
46
  "checksum": {
47
47
  "algorithm": "sha256",
48
- "digest": "e9e46941b4a66d24cbbe4ad53cfd2b6ed885a705fe44f6f1aab59581ed36aab4"
48
+ "digest": "9f5787407cd4197de12c7d013f6eed0ee0b1ab138cc7f3d5a0decdcccbacbb62"
49
49
  }
50
50
  },
51
51
  "linux-arm64": {
52
52
  "name": "unkey_Linux_arm64.tar.gz",
53
- "url": "https://github.com/unkeyed/unkey/releases/download/v2.0.107-rc.3/unkey_Linux_arm64.tar.gz",
53
+ "url": "https://github.com/unkeyed/unkey/releases/download/v2.0.144/unkey_Linux_arm64.tar.gz",
54
54
  "bins": [
55
55
  "unkey"
56
56
  ],
57
57
  "format": "tar.gz",
58
58
  "checksum": {
59
59
  "algorithm": "sha256",
60
- "digest": "6b5fa8f1a36a73c3c0a96c909f74769a32c5c70950908761f6be279f4d3410a7"
60
+ "digest": "5308f8448d4554a22a502210bf623cc2b2b4bfb47d1c70f4bb8f286142a54ce9"
61
61
  }
62
62
  },
63
63
  "linux-x64": {
64
64
  "name": "unkey_Linux_x86_64.tar.gz",
65
- "url": "https://github.com/unkeyed/unkey/releases/download/v2.0.107-rc.3/unkey_Linux_x86_64.tar.gz",
65
+ "url": "https://github.com/unkeyed/unkey/releases/download/v2.0.144/unkey_Linux_x86_64.tar.gz",
66
66
  "bins": [
67
67
  "unkey"
68
68
  ],
69
69
  "format": "tar.gz",
70
70
  "checksum": {
71
71
  "algorithm": "sha256",
72
- "digest": "0c1ecefce82fc5c67a2b862281940b2b92b5ca5920131ef9a338c54ba53a0403"
72
+ "digest": "833f452bb0ab0c33d8c82edea11b795998275385942718ec4cbb7966a0c9290b"
73
73
  }
74
74
  }
75
75
  }
package/run-unkey.js CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  // This file was generated by GoReleaser. DO NOT EDIT.
4
4
 
5
- const { run } = require("./lib.js");
5
+ import { run } from "./lib.js";
6
6
  run("unkey").then((code) => process.exit(code));