@suveren/gateway 0.8.1 → 0.8.3
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/content/integrations/deploy-github.json +3 -5
- package/dist/mcp-server/http.mjs +77 -66
- package/dist/ui/assets/{index-BFnSVa9N.js → index-76gJM-3o.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/node_modules/jose/dist/types/index.d.ts +1 -2
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -11
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +13 -16
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -11
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -19
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +10 -16
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +18 -21
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -1
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +4 -6
- package/node_modules/jose/dist/types/jwks/local.d.ts +5 -4
- package/node_modules/jose/dist/types/jwks/remote.d.ts +20 -21
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +4 -4
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +8 -11
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +8 -11
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +10 -14
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +11 -17
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +14 -11
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +24 -22
- package/node_modules/jose/dist/types/jwt/sign.d.ts +3 -7
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -6
- package/node_modules/jose/dist/types/jwt/verify.d.ts +13 -6
- package/node_modules/jose/dist/types/key/export.d.ts +6 -6
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +9 -14
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +10 -10
- package/node_modules/jose/dist/types/key/import.d.ts +19 -18
- package/node_modules/jose/dist/types/types.d.ts +152 -247
- package/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +6 -1
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -3
- package/node_modules/jose/dist/types/util/errors.d.ts +29 -40
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +1 -2
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +9 -26
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +3 -3
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +11 -30
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +6 -6
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -57
- package/node_modules/jose/dist/webapi/jwk/embedded.js +3 -4
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +3 -6
- package/node_modules/jose/dist/webapi/jwks/local.js +16 -10
- package/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +2 -4
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +2 -2
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +8 -15
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +4 -14
- package/node_modules/jose/dist/webapi/jws/general/sign.js +4 -11
- package/node_modules/jose/dist/webapi/jws/general/verify.js +5 -7
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +2 -3
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +11 -25
- package/node_modules/jose/dist/webapi/jwt/sign.js +1 -1
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +1 -2
- package/node_modules/jose/dist/webapi/jwt/verify.js +4 -4
- package/node_modules/jose/dist/webapi/key/export.js +12 -16
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +4 -13
- package/node_modules/jose/dist/webapi/key/generate_secret.js +1 -1
- package/node_modules/jose/dist/webapi/key/import.js +5 -9
- package/node_modules/jose/dist/webapi/lib/asn1.js +2 -4
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +35 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +21 -29
- package/node_modules/jose/dist/webapi/lib/deflate.js +9 -19
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +0 -4
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +21 -54
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +26 -59
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +29 -43
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +37 -45
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
- package/node_modules/jose/dist/webapi/lib/key.js +119 -59
- package/node_modules/jose/dist/webapi/lib/key_management.js +45 -80
- package/node_modules/jose/dist/webapi/lib/{options.js → validate.js} +64 -3
- package/node_modules/jose/dist/webapi/util/base64url.js +5 -19
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
- package/node_modules/jose/package.json +1 -1
- package/package.json +1 -1
- package/profiles/deploy/0.10.profile.json +178 -0
- package/profiles/index.json +1 -0
- package/node_modules/jose/dist/webapi/lib/base64.js +0 -20
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -27
- package/node_modules/jose/dist/webapi/lib/helpers.js +0 -45
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -12
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -10
- package/node_modules/jose/dist/webapi/lib/key_options.js +0 -8
- package/node_modules/jose/dist/webapi/lib/signing.js +0 -22
- package/node_modules/jose/dist/webapi/lib/type_checks.js +0 -30
|
@@ -103,8 +103,7 @@
|
|
|
103
103
|
"risk": "low",
|
|
104
104
|
"mode": "automatic",
|
|
105
105
|
"bounds": {
|
|
106
|
-
"release_daily_max": "0"
|
|
107
|
-
"rollback_allowed": "no"
|
|
106
|
+
"release_daily_max": "0"
|
|
108
107
|
},
|
|
109
108
|
"context": {
|
|
110
109
|
"allowed_repos": "",
|
|
@@ -121,12 +120,11 @@
|
|
|
121
120
|
},
|
|
122
121
|
{
|
|
123
122
|
"name": "Release to production, review",
|
|
124
|
-
"description": "Make an existing build live after approval. Three a day
|
|
123
|
+
"description": "Make an existing build live after approval. Three a day.",
|
|
125
124
|
"risk": "high",
|
|
126
125
|
"mode": "review",
|
|
127
126
|
"bounds": {
|
|
128
|
-
"release_daily_max": "3"
|
|
129
|
-
"rollback_allowed": "no"
|
|
127
|
+
"release_daily_max": "3"
|
|
130
128
|
},
|
|
131
129
|
"context": {
|
|
132
130
|
"allowed_repos": "",
|
package/dist/mcp-server/http.mjs
CHANGED
|
@@ -3416,31 +3416,74 @@ var IntegrationRegistry = class {
|
|
|
3416
3416
|
|
|
3417
3417
|
// src/lib/integration-manager.ts
|
|
3418
3418
|
import { homedir as homedir8 } from "os";
|
|
3419
|
-
import { join as
|
|
3420
|
-
import { existsSync as
|
|
3419
|
+
import { join as join10, delimiter } from "path";
|
|
3420
|
+
import { existsSync as existsSync10, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7, readFileSync as readFileSync10, rmSync } from "fs";
|
|
3421
3421
|
import { execFile } from "child_process";
|
|
3422
3422
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
3423
3423
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
3424
3424
|
import { getProfile as getProfile5 } from "@hap/core";
|
|
3425
|
-
|
|
3426
|
-
|
|
3425
|
+
|
|
3426
|
+
// src/lib/manifest-loader.ts
|
|
3427
|
+
import { readFileSync as readFileSync9, existsSync as existsSync9 } from "fs";
|
|
3428
|
+
import { join as join9, resolve } from "path";
|
|
3429
|
+
var manifests = /* @__PURE__ */ new Map();
|
|
3430
|
+
function loadManifests(integrationsDir) {
|
|
3431
|
+
const dir = resolve(
|
|
3432
|
+
integrationsDir ?? process.env.SUVEREN_MANIFESTS_DIR ?? join9(import.meta.dirname ?? __dirname, "..", "..", "..", "..", "content", "integrations")
|
|
3433
|
+
);
|
|
3434
|
+
const indexPath = join9(dir, "index.json");
|
|
3435
|
+
if (!existsSync9(indexPath)) {
|
|
3436
|
+
console.error(`[ManifestLoader] No index.json found at ${indexPath}, skipping manifest loading`);
|
|
3437
|
+
return 0;
|
|
3438
|
+
}
|
|
3439
|
+
let index;
|
|
3440
|
+
try {
|
|
3441
|
+
index = JSON.parse(readFileSync9(indexPath, "utf-8"));
|
|
3442
|
+
} catch (err) {
|
|
3443
|
+
console.error(`[ManifestLoader] Failed to parse ${indexPath}:`, err);
|
|
3444
|
+
return 0;
|
|
3445
|
+
}
|
|
3446
|
+
let loaded = 0;
|
|
3447
|
+
for (const [id, relativePath] of Object.entries(index.integrations)) {
|
|
3448
|
+
const manifestPath = join9(dir, relativePath);
|
|
3449
|
+
try {
|
|
3450
|
+
const manifest = JSON.parse(readFileSync9(manifestPath, "utf-8"));
|
|
3451
|
+
manifests.set(id, manifest);
|
|
3452
|
+
loaded++;
|
|
3453
|
+
} catch (err) {
|
|
3454
|
+
console.error(`[ManifestLoader] Failed to load manifest ${id} from ${manifestPath}:`, err);
|
|
3455
|
+
}
|
|
3456
|
+
}
|
|
3457
|
+
console.error(`[ManifestLoader] Loaded ${loaded} integration manifest(s) from ${dir}`);
|
|
3458
|
+
return loaded;
|
|
3459
|
+
}
|
|
3460
|
+
function getManifest(id) {
|
|
3461
|
+
return manifests.get(id);
|
|
3462
|
+
}
|
|
3463
|
+
function getAllManifests() {
|
|
3464
|
+
return Array.from(manifests.values());
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
// src/lib/integration-manager.ts
|
|
3468
|
+
var DEFAULT_DATA_DIR2 = process.env.SUVEREN_DATA_DIR ?? join10(homedir8(), ".suveren");
|
|
3469
|
+
var INTEGRATIONS_DIR = process.env.SUVEREN_INTEGRATIONS_DIR ?? join10(DEFAULT_DATA_DIR2, "integrations");
|
|
3427
3470
|
var installLock = Promise.resolve();
|
|
3428
3471
|
function withInstallLock(task) {
|
|
3429
3472
|
const run = installLock.then(task, task);
|
|
3430
3473
|
installLock = run.then(() => void 0, () => void 0);
|
|
3431
3474
|
return run;
|
|
3432
3475
|
}
|
|
3433
|
-
var INTEGRATIONS_BIN =
|
|
3476
|
+
var INTEGRATIONS_BIN = join10(INTEGRATIONS_DIR, "node_modules", ".bin");
|
|
3434
3477
|
function buildPath() {
|
|
3435
3478
|
const base = process.env.PATH ?? "";
|
|
3436
3479
|
return [INTEGRATIONS_BIN, base].join(delimiter);
|
|
3437
3480
|
}
|
|
3438
3481
|
function ensureIntegrationsDir() {
|
|
3439
|
-
if (!
|
|
3482
|
+
if (!existsSync10(INTEGRATIONS_DIR)) {
|
|
3440
3483
|
mkdirSync7(INTEGRATIONS_DIR, { recursive: true });
|
|
3441
3484
|
}
|
|
3442
|
-
const pkgPath =
|
|
3443
|
-
if (!
|
|
3485
|
+
const pkgPath = join10(INTEGRATIONS_DIR, "package.json");
|
|
3486
|
+
if (!existsSync10(pkgPath)) {
|
|
3444
3487
|
writeFileSync7(pkgPath, JSON.stringify({ name: "suveren-integrations", version: "1.0.0", private: true }, null, 2));
|
|
3445
3488
|
}
|
|
3446
3489
|
}
|
|
@@ -3507,19 +3550,19 @@ var IntegrationManager = class {
|
|
|
3507
3550
|
* exist, and treat anything else as not-installed (and reinstallable).
|
|
3508
3551
|
*/
|
|
3509
3552
|
isUsableInstall(npmPackage) {
|
|
3510
|
-
const pkgDir =
|
|
3511
|
-
const pkgJson =
|
|
3512
|
-
if (!
|
|
3553
|
+
const pkgDir = join10(INTEGRATIONS_DIR, "node_modules", ...npmPackage.split("/"));
|
|
3554
|
+
const pkgJson = join10(pkgDir, "package.json");
|
|
3555
|
+
if (!existsSync10(pkgDir) || !existsSync10(pkgJson)) return false;
|
|
3513
3556
|
try {
|
|
3514
|
-
const pkg = JSON.parse(
|
|
3557
|
+
const pkg = JSON.parse(readFileSync10(pkgJson, "utf8"));
|
|
3515
3558
|
const defaultBinName = (pkg.name ?? npmPackage).split("/").pop() ?? "";
|
|
3516
3559
|
const binMap = typeof pkg.bin === "string" ? { [defaultBinName]: pkg.bin } : pkg.bin ?? {};
|
|
3517
3560
|
const binEntries = Object.entries(binMap);
|
|
3518
3561
|
for (const [binName, target] of binEntries) {
|
|
3519
|
-
if (!
|
|
3562
|
+
if (!existsSync10(join10(pkgDir, target))) return false;
|
|
3520
3563
|
if (!this.binShimExists(binName)) return false;
|
|
3521
3564
|
}
|
|
3522
|
-
if (binEntries.length === 0 && pkg.main && !
|
|
3565
|
+
if (binEntries.length === 0 && pkg.main && !existsSync10(join10(pkgDir, pkg.main))) return false;
|
|
3523
3566
|
return true;
|
|
3524
3567
|
} catch {
|
|
3525
3568
|
return false;
|
|
@@ -3533,7 +3576,7 @@ var IntegrationManager = class {
|
|
|
3533
3576
|
binShimExists(binName) {
|
|
3534
3577
|
if (!binName) return false;
|
|
3535
3578
|
const candidates = process.platform === "win32" ? [binName, `${binName}.cmd`, `${binName}.CMD`, `${binName}.ps1`] : [binName];
|
|
3536
|
-
return candidates.some((c) =>
|
|
3579
|
+
return candidates.some((c) => existsSync10(join10(INTEGRATIONS_BIN, c)));
|
|
3537
3580
|
}
|
|
3538
3581
|
/**
|
|
3539
3582
|
* Install an npm package into the managed integrations directory if not
|
|
@@ -3557,8 +3600,8 @@ var IntegrationManager = class {
|
|
|
3557
3600
|
}
|
|
3558
3601
|
/** The actual install. Callers MUST hold the install lock. */
|
|
3559
3602
|
async installNow(npmPackage) {
|
|
3560
|
-
const pkgDir =
|
|
3561
|
-
if (
|
|
3603
|
+
const pkgDir = join10(INTEGRATIONS_DIR, "node_modules", ...npmPackage.split("/"));
|
|
3604
|
+
if (existsSync10(pkgDir)) {
|
|
3562
3605
|
console.error(`[IntegrationManager] Removing unusable install of ${npmPackage}`);
|
|
3563
3606
|
try {
|
|
3564
3607
|
rmSync(pkgDir, { recursive: true, force: true });
|
|
@@ -3887,6 +3930,15 @@ var IntegrationManager = class {
|
|
|
3887
3930
|
env[envVar] = creds[key];
|
|
3888
3931
|
}
|
|
3889
3932
|
}
|
|
3933
|
+
const manifest = getManifest(config.id);
|
|
3934
|
+
for (const [envVar, credKey] of Object.entries(manifest?.credentials?.envMapping ?? {})) {
|
|
3935
|
+
if (envVar in env) continue;
|
|
3936
|
+
if (envVar in config.envKeys || envVar in (config.optionalEnvKeys ?? {})) continue;
|
|
3937
|
+
const creds = this.serviceCredentials.get(config.id);
|
|
3938
|
+
if (creds && credKey in creds) {
|
|
3939
|
+
env[envVar] = creds[credKey];
|
|
3940
|
+
}
|
|
3941
|
+
}
|
|
3890
3942
|
return env;
|
|
3891
3943
|
}
|
|
3892
3944
|
/**
|
|
@@ -3974,28 +4026,28 @@ var IntegrationManager = class {
|
|
|
3974
4026
|
};
|
|
3975
4027
|
|
|
3976
4028
|
// src/lib/profile-loader.ts
|
|
3977
|
-
import { readFileSync as
|
|
3978
|
-
import { join as
|
|
4029
|
+
import { readFileSync as readFileSync11, existsSync as existsSync11 } from "fs";
|
|
4030
|
+
import { join as join11, resolve as resolve2 } from "path";
|
|
3979
4031
|
import { registerProfile } from "@hap/core";
|
|
3980
4032
|
function loadProfiles(profilesDir) {
|
|
3981
|
-
const dir =
|
|
3982
|
-
const indexPath =
|
|
3983
|
-
if (!
|
|
4033
|
+
const dir = resolve2(profilesDir ?? process.env.SUVEREN_PROFILES_DIR ?? join11(import.meta.dirname ?? __dirname, "..", "..", "..", "..", "..", "hap-profiles"));
|
|
4034
|
+
const indexPath = join11(dir, "index.json");
|
|
4035
|
+
if (!existsSync11(indexPath)) {
|
|
3984
4036
|
warnNoProfiles(`No index.json at ${indexPath}`);
|
|
3985
4037
|
return 0;
|
|
3986
4038
|
}
|
|
3987
4039
|
let index;
|
|
3988
4040
|
try {
|
|
3989
|
-
index = JSON.parse(
|
|
4041
|
+
index = JSON.parse(readFileSync11(indexPath, "utf-8"));
|
|
3990
4042
|
} catch (err) {
|
|
3991
4043
|
console.error(`[ProfileLoader] Failed to parse ${indexPath}:`, err);
|
|
3992
4044
|
return 0;
|
|
3993
4045
|
}
|
|
3994
4046
|
let loaded = 0;
|
|
3995
4047
|
for (const [profileId, relativePath] of Object.entries(index.profiles)) {
|
|
3996
|
-
const profilePath =
|
|
4048
|
+
const profilePath = join11(dir, relativePath);
|
|
3997
4049
|
try {
|
|
3998
|
-
const profile = JSON.parse(
|
|
4050
|
+
const profile = JSON.parse(readFileSync11(profilePath, "utf-8"));
|
|
3999
4051
|
registerProfile(profileId, profile);
|
|
4000
4052
|
const shortName = profileId.split("/").pop()?.replace(/@.*$/, "");
|
|
4001
4053
|
if (shortName && shortName !== profileId) {
|
|
@@ -4027,47 +4079,6 @@ function warnNoProfiles(reason) {
|
|
|
4027
4079
|
);
|
|
4028
4080
|
}
|
|
4029
4081
|
|
|
4030
|
-
// src/lib/manifest-loader.ts
|
|
4031
|
-
import { readFileSync as readFileSync11, existsSync as existsSync11 } from "fs";
|
|
4032
|
-
import { join as join11, resolve as resolve2 } from "path";
|
|
4033
|
-
var manifests = /* @__PURE__ */ new Map();
|
|
4034
|
-
function loadManifests(integrationsDir) {
|
|
4035
|
-
const dir = resolve2(
|
|
4036
|
-
integrationsDir ?? process.env.SUVEREN_MANIFESTS_DIR ?? join11(import.meta.dirname ?? __dirname, "..", "..", "..", "..", "content", "integrations")
|
|
4037
|
-
);
|
|
4038
|
-
const indexPath = join11(dir, "index.json");
|
|
4039
|
-
if (!existsSync11(indexPath)) {
|
|
4040
|
-
console.error(`[ManifestLoader] No index.json found at ${indexPath}, skipping manifest loading`);
|
|
4041
|
-
return 0;
|
|
4042
|
-
}
|
|
4043
|
-
let index;
|
|
4044
|
-
try {
|
|
4045
|
-
index = JSON.parse(readFileSync11(indexPath, "utf-8"));
|
|
4046
|
-
} catch (err) {
|
|
4047
|
-
console.error(`[ManifestLoader] Failed to parse ${indexPath}:`, err);
|
|
4048
|
-
return 0;
|
|
4049
|
-
}
|
|
4050
|
-
let loaded = 0;
|
|
4051
|
-
for (const [id, relativePath] of Object.entries(index.integrations)) {
|
|
4052
|
-
const manifestPath = join11(dir, relativePath);
|
|
4053
|
-
try {
|
|
4054
|
-
const manifest = JSON.parse(readFileSync11(manifestPath, "utf-8"));
|
|
4055
|
-
manifests.set(id, manifest);
|
|
4056
|
-
loaded++;
|
|
4057
|
-
} catch (err) {
|
|
4058
|
-
console.error(`[ManifestLoader] Failed to load manifest ${id} from ${manifestPath}:`, err);
|
|
4059
|
-
}
|
|
4060
|
-
}
|
|
4061
|
-
console.error(`[ManifestLoader] Loaded ${loaded} integration manifest(s) from ${dir}`);
|
|
4062
|
-
return loaded;
|
|
4063
|
-
}
|
|
4064
|
-
function getManifest(id) {
|
|
4065
|
-
return manifests.get(id);
|
|
4066
|
-
}
|
|
4067
|
-
function getAllManifests() {
|
|
4068
|
-
return Array.from(manifests.values());
|
|
4069
|
-
}
|
|
4070
|
-
|
|
4071
4082
|
// bin/http.ts
|
|
4072
4083
|
import { decodeAttestationBlob as decodeAttestationBlob3 } from "@hap/core";
|
|
4073
4084
|
|