asyx 0.11.0 → 0.11.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/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asyx",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Asyx tunnel CLI — secure localhost exposure (HTTP, TCP, UDP)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/asyx-ai/asyx",
|
|
9
|
+
"directory": "packages/asyx"
|
|
10
|
+
},
|
|
6
11
|
"type": "module",
|
|
7
12
|
"homepage": "https://www.asyx.ai/docs",
|
|
8
13
|
"bugs": {
|
|
@@ -5,6 +5,12 @@ export function sendAppCreate(o) {
|
|
|
5
5
|
export function sendAppStatus(o) {
|
|
6
6
|
return sendIdentityCommand('status', 'app_status', { timeoutMs: 20000, ...o });
|
|
7
7
|
}
|
|
8
|
+
export function sendAppRotate(o) {
|
|
9
|
+
return sendIdentityCommand('rotate', 'app_rotate', { timeoutMs: 45000, ...o });
|
|
10
|
+
}
|
|
11
|
+
export function sendAppRotateConfirm(o) {
|
|
12
|
+
return sendIdentityCommand('rotate_confirm', 'app_rotate_confirm', { timeoutMs: 20000, ...o });
|
|
13
|
+
}
|
|
8
14
|
async function sendIdentityCommand(topicOp, op, o) {
|
|
9
15
|
const { credentials, command, logger, timeoutMs = 45000 } = o;
|
|
10
16
|
const { MqttCore } = await import('@asyx/mqtt-core');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRemoteJWKSet, jwtVerify } from 'jose';
|
|
2
2
|
import logger from './logger.js';
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const JWKS_URL = 'https://auth.asyx.ai/.well-known/jwks.json';
|
|
4
|
+
let keySourceForTests = null;
|
|
5
5
|
const EXPECTED_ISSUER = 'https://auth.asyx.ai';
|
|
6
6
|
const EXPECTED_AUDIENCE = 'tunnel-relay';
|
|
7
7
|
let jwksCache = null;
|
|
@@ -16,11 +16,8 @@ async function initializeJWKS() {
|
|
|
16
16
|
}
|
|
17
17
|
jwksInitPromise = (async () => {
|
|
18
18
|
try {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const jwksUrlOverride = process.env.ASYX_JWKS_URL;
|
|
22
|
-
const finalJwksUrl = jwksUrlOverride || jwksUrl;
|
|
23
|
-
logger.debug('jwt.jwks.initializing', { jwksUrl: finalJwksUrl, env });
|
|
19
|
+
const finalJwksUrl = keySourceForTests || JWKS_URL;
|
|
20
|
+
logger.debug('jwt.jwks.initializing', { jwksUrl: finalJwksUrl });
|
|
24
21
|
jwksCache = createRemoteJWKSet(new URL(finalJwksUrl));
|
|
25
22
|
jwksInitialized = true;
|
|
26
23
|
logger.info('jwt.jwks.initialized', { jwksUrl: finalJwksUrl });
|
|
@@ -175,3 +172,7 @@ export function resetJWKS() {
|
|
|
175
172
|
jwksInitialized = false;
|
|
176
173
|
jwksInitPromise = null;
|
|
177
174
|
}
|
|
175
|
+
export function setKeySourceForTests(url) {
|
|
176
|
+
keySourceForTests = url || null;
|
|
177
|
+
resetJWKS();
|
|
178
|
+
}
|