@solidxai/core 0.1.22-beta.4 → 0.1.22
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/CHANGELOG.md +808 -0
- package/dist/controllers/admin-embed.controller.d.ts +5 -0
- package/dist/controllers/admin-embed.controller.d.ts.map +1 -0
- package/dist/controllers/admin-embed.controller.js +58 -0
- package/dist/controllers/admin-embed.controller.js.map +1 -0
- package/dist/controllers/agent-registry.controller.d.ts +1 -7
- package/dist/controllers/agent-registry.controller.d.ts.map +1 -1
- package/dist/controllers/agent-registry.controller.js +1 -1
- package/dist/controllers/agent-session.controller.d.ts +1 -1
- package/dist/controllers/agent-session.controller.d.ts.map +1 -1
- package/dist/controllers/agent-session.controller.js +25 -3
- package/dist/controllers/agent-session.controller.js.map +1 -1
- package/dist/controllers/authentication.controller.d.ts +12 -1
- package/dist/controllers/authentication.controller.d.ts.map +1 -1
- package/dist/controllers/authentication.controller.js +26 -2
- package/dist/controllers/authentication.controller.js.map +1 -1
- package/dist/guards/access-token.guard.d.ts +3 -1
- package/dist/guards/access-token.guard.d.ts.map +1 -1
- package/dist/guards/access-token.guard.js +11 -2
- package/dist/guards/access-token.guard.js.map +1 -1
- package/dist/interfaces/active-user-data.interface.d.ts +1 -0
- package/dist/interfaces/active-user-data.interface.d.ts.map +1 -1
- package/dist/interfaces/active-user-data.interface.js.map +1 -1
- package/dist/resources/admin-embed/solid-admin-embed.js +133 -0
- package/dist/seeders/seed-data/solid-core-metadata.json +99 -2
- package/dist/services/agent-hub-process-manager.service.d.ts +13 -1
- package/dist/services/agent-hub-process-manager.service.d.ts.map +1 -1
- package/dist/services/agent-hub-process-manager.service.js +10 -2
- package/dist/services/agent-hub-process-manager.service.js.map +1 -1
- package/dist/services/agent-registry.service.d.ts +1 -7
- package/dist/services/agent-registry.service.d.ts.map +1 -1
- package/dist/services/agent-registry.service.js +5 -1
- package/dist/services/agent-registry.service.js.map +1 -1
- package/dist/services/api-key-portal-session.spec.d.ts +2 -0
- package/dist/services/api-key-portal-session.spec.d.ts.map +1 -0
- package/dist/services/api-key-portal-session.spec.js +71 -0
- package/dist/services/api-key-portal-session.spec.js.map +1 -0
- package/dist/services/api-key.service.d.ts +12 -0
- package/dist/services/api-key.service.d.ts.map +1 -1
- package/dist/services/api-key.service.js +58 -0
- package/dist/services/api-key.service.js.map +1 -1
- package/dist/services/authentication.service.d.ts +1 -0
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +14 -1
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/settings/default-settings-provider.service.d.ts +4 -4
- package/dist/services/settings/default-settings-provider.service.js +2 -2
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +2 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/testing/adapters/ui/playwright-adapter.d.ts.map +1 -1
- package/dist/testing/adapters/ui/playwright-adapter.js +3 -1
- package/dist/testing/adapters/ui/playwright-adapter.js.map +1 -1
- package/dist/testing/contracts/runtime-context.types.d.ts +7 -0
- package/dist/testing/contracts/runtime-context.types.d.ts.map +1 -1
- package/dist/testing/contracts/runtime-context.types.js.map +1 -1
- package/dist/testing/core/interpolation.d.ts.map +1 -1
- package/dist/testing/core/interpolation.js +14 -2
- package/dist/testing/core/interpolation.js.map +1 -1
- package/dist/testing/core/step-data.d.ts +5 -0
- package/dist/testing/core/step-data.d.ts.map +1 -0
- package/dist/testing/core/step-data.js +14 -0
- package/dist/testing/core/step-data.js.map +1 -0
- package/dist/testing/core/step-data.spec.d.ts +2 -0
- package/dist/testing/core/step-data.spec.d.ts.map +1 -0
- package/dist/testing/core/step-data.spec.js +48 -0
- package/dist/testing/core/step-data.spec.js.map +1 -0
- package/dist/testing/core/testing-engine.d.ts.map +1 -1
- package/dist/testing/core/testing-engine.js +13 -8
- package/dist/testing/core/testing-engine.js.map +1 -1
- package/dist/testing/reporter/lifecycle-events.types.d.ts +2 -1
- package/dist/testing/reporter/lifecycle-events.types.d.ts.map +1 -1
- package/dist/testing/reporter/lifecycle-events.types.js.map +1 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.d.ts +2 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.js +1 -0
- package/dist/testing/reporter/lifecycle-webhook-reporter.js.map +1 -1
- package/dist/testing/reporter/reporter.types.d.ts +2 -1
- package/dist/testing/reporter/reporter.types.d.ts.map +1 -1
- package/dist/testing/reporter/reporter.types.js.map +1 -1
- package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
- package/dist/testing/runner/run-from-metadata.js +39 -9
- package/dist/testing/runner/run-from-metadata.js.map +1 -1
- package/dist/testing/runner/run-from-metadata.spec.js +29 -0
- package/dist/testing/runner/run-from-metadata.spec.js.map +1 -1
- package/dist/testing/runner/scenario-graph.d.ts +9 -0
- package/dist/testing/runner/scenario-graph.d.ts.map +1 -1
- package/dist/testing/runner/scenario-graph.js +47 -13
- package/dist/testing/runner/scenario-graph.js.map +1 -1
- package/dist/testing/steps/ui/navigation.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/navigation.step.js +4 -1
- package/dist/testing/steps/ui/navigation.step.js.map +1 -1
- package/dist/testing/steps/util/random.step.d.ts.map +1 -1
- package/dist/testing/steps/util/random.step.js +4 -1
- package/dist/testing/steps/util/random.step.js.map +1 -1
- package/package.json +1 -1
- package/resources/admin-embed/solid-admin-embed.js +133 -0
- package/src/controllers/admin-embed.controller.ts +34 -0
- package/src/controllers/agent-session.controller.ts +19 -3
- package/src/controllers/authentication.controller.ts +20 -1
- package/src/guards/access-token.guard.ts +11 -1
- package/src/interfaces/active-user-data.interface.ts +3 -0
- package/src/seeders/seed-data/solid-core-metadata.json +100 -3
- package/src/services/agent-hub-process-manager.service.ts +12 -2
- package/src/services/agent-registry.service.ts +4 -1
- package/src/services/api-key-portal-session.spec.ts +75 -0
- package/src/services/api-key.service.ts +61 -0
- package/src/services/authentication.service.ts +16 -2
- package/src/services/settings/default-settings-provider.service.ts +2 -2
- package/src/solid-core.module.ts +2 -0
- package/src/testing/adapters/ui/playwright-adapter.ts +5 -1
- package/src/testing/contracts/runtime-context.types.ts +16 -0
- package/src/testing/core/interpolation.ts +11 -2
- package/src/testing/core/step-data.spec.ts +59 -0
- package/src/testing/core/step-data.ts +14 -0
- package/src/testing/core/testing-engine.ts +6 -1
- package/src/testing/reporter/lifecycle-events.types.ts +3 -1
- package/src/testing/reporter/lifecycle-webhook-reporter.ts +3 -1
- package/src/testing/reporter/reporter.types.ts +3 -1
- package/src/testing/runner/run-from-metadata.spec.ts +33 -0
- package/src/testing/runner/run-from-metadata.ts +53 -16
- package/src/testing/runner/scenario-graph.ts +55 -12
- package/src/testing/steps/ui/navigation.step.ts +4 -1
- package/src/testing/steps/util/random.step.ts +4 -1
- package/src/entities/media-migration-plan.md +0 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.step.js","sourceRoot":"","sources":["../../../../src/testing/steps/util/random.step.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"random.step.js","sourceRoot":"","sources":["../../../../src/testing/steps/util/random.step.ts"],"names":[],"mappings":";;AAWA,gDAcC;AAvBD,wDAAuD;AAEvD,oDAAsD;AAOtD,SAAgB,kBAAkB,CAAC,QAAsB;IACvD,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE,GAAgB,EAAE,IAAY,EAAE,EAAE;QACxE,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAgB,CAAC;QAC/C,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;QAC3E,CAAC;QACD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;QACnG,CAAC;QACD,MAAM,KAAK,GAAG,IAAA,2BAAa,EAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;QACzE,IAAA,0BAAc,EAAC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,KAAK,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACrI,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { TestContext } from \"../../contracts/runtime-context.types\";\nimport type { OpStep } from \"../../contracts/testing-metadata.types\";\nimport { randomDataFor } from \"../../core/random-data\";\nimport { StepRegistry } from \"../../core/step-registry\";\nimport { recordStepData } from \"../../core/step-data\";\n\ntype RandomInput = { generator: string; args?: Record<string, unknown> };\n\n// Generates one value and returns it, so `saveAs` can keep it: the same email can then be typed\n// in one step and asserted in another through ${res:<saveAs>}. An inline ${random:...} token\n// gives a new value each time it is resolved.\nexport function registerRandomStep(registry: StepRegistry): void {\n registry.register(\"util.random\", async (ctx: TestContext, step: OpStep) => {\n const input = (step.with ?? {}) as RandomInput;\n if (!input.generator) {\n throw new Error('Missing \"generator\" in step.with for op \"util.random\"');\n }\n const args = input.args ?? {};\n if (typeof args !== \"object\" || Array.isArray(args)) {\n throw new Error('\"args\" must be an object for op \"util.random\", e.g. { \"domain\": \"acme.test\" }');\n }\n const value = randomDataFor(ctx).generate(String(input.generator), args);\n recordStepData(ctx, { kind: \"random\", source: `random:${input.generator}`, value, ...(step.saveAs ? { saveAs: step.saveAs } : {}) });\n return value;\n });\n}\n"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const uiUrl = __SOLIDX_ADMIN_EMBED_UI_URL__;
|
|
5
|
+
const channel = "solidx-admin-embed";
|
|
6
|
+
const collectionViews = ["list", "kanban", "tree", "card"];
|
|
7
|
+
const kebabCase = (value) => value
|
|
8
|
+
.replace(/([A-Z])([A-Z][a-z])/g, "$1-$2")
|
|
9
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
10
|
+
.replace(/[_\s]+/g, "-")
|
|
11
|
+
.toLowerCase();
|
|
12
|
+
|
|
13
|
+
function getTarget(options) {
|
|
14
|
+
let route = options.route;
|
|
15
|
+
if (options.type === "solid") {
|
|
16
|
+
const { moduleName, modelName, view } = options;
|
|
17
|
+
if (typeof moduleName !== "string" || !/^[\w-]+$/.test(moduleName) ||
|
|
18
|
+
typeof modelName !== "string" || !/^[\w-]+$/.test(modelName) ||
|
|
19
|
+
!collectionViews.includes(view)) {
|
|
20
|
+
throw new Error("A SolidX view requires a moduleName, modelName, and list, kanban, tree, or card view.");
|
|
21
|
+
}
|
|
22
|
+
route = `/admin/core/${moduleName}/${kebabCase(modelName)}/${view}`;
|
|
23
|
+
} else if (options.type !== "custom") {
|
|
24
|
+
throw new Error("Set the SolidX embed type to custom or solid.");
|
|
25
|
+
}
|
|
26
|
+
if (typeof route !== "string" || !route.startsWith("/admin")) {
|
|
27
|
+
throw new Error("Provide a SolidX /admin route.");
|
|
28
|
+
}
|
|
29
|
+
const target = new URL(route, uiUrl);
|
|
30
|
+
if (target.origin !== new URL(uiUrl).origin || !/^\/admin(?:\/|$)/.test(target.pathname)) {
|
|
31
|
+
throw new Error("Provide a SolidX /admin route.");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Context provides defaults. The route query and explicit query options can override them.
|
|
35
|
+
for (const [name, value] of Object.entries(options.context || {})) {
|
|
36
|
+
if (value != null && !target.searchParams.has(name)) {
|
|
37
|
+
target.searchParams.set(name, typeof value === "object" ? JSON.stringify(value) : String(value));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (options.context && !target.searchParams.has("actionContext")) {
|
|
41
|
+
target.searchParams.set("actionContext", JSON.stringify(options.context));
|
|
42
|
+
}
|
|
43
|
+
const query = new URLSearchParams(options.query);
|
|
44
|
+
for (const name of new Set(query.keys())) {
|
|
45
|
+
target.searchParams.delete(name);
|
|
46
|
+
for (const value of query.getAll(name)) target.searchParams.append(name, value);
|
|
47
|
+
}
|
|
48
|
+
return target.pathname + target.search + target.hash;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function mount(options) {
|
|
52
|
+
const container = typeof options.container === "string"
|
|
53
|
+
? document.querySelector(options.container)
|
|
54
|
+
: options.container;
|
|
55
|
+
if (!(container instanceof Element)) throw new Error("Provide a SolidX embed container.");
|
|
56
|
+
if (typeof options.tokenEndpoint !== "string" || !options.tokenEndpoint) {
|
|
57
|
+
throw new Error("Provide a SolidX token endpoint on your application server.");
|
|
58
|
+
}
|
|
59
|
+
const tokenEndpoint = new URL(options.tokenEndpoint, window.location.href);
|
|
60
|
+
if (tokenEndpoint.origin !== window.location.origin || tokenEndpoint.username || tokenEndpoint.password) {
|
|
61
|
+
throw new Error("The SolidX token endpoint must be on your application's origin.");
|
|
62
|
+
}
|
|
63
|
+
const frameUrl = new URL(uiUrl);
|
|
64
|
+
if (frameUrl.origin === window.location.origin) throw new Error("Host the SolidX embed UI on a separate origin.");
|
|
65
|
+
const instanceId = crypto.randomUUID();
|
|
66
|
+
frameUrl.searchParams.set("parentOrigin", window.location.origin);
|
|
67
|
+
frameUrl.searchParams.set("instanceId", instanceId);
|
|
68
|
+
frameUrl.hash = getTarget(options);
|
|
69
|
+
|
|
70
|
+
const iframe = document.createElement("iframe");
|
|
71
|
+
iframe.title = options.title || "SolidX admin screen";
|
|
72
|
+
iframe.referrerPolicy = "no-referrer";
|
|
73
|
+
iframe.setAttribute("sandbox", "allow-scripts allow-same-origin allow-forms allow-downloads");
|
|
74
|
+
iframe.style.cssText = "display:block;width:100%;height:100%;border:0";
|
|
75
|
+
iframe.src = frameUrl.href;
|
|
76
|
+
|
|
77
|
+
const abort = new AbortController();
|
|
78
|
+
let pending;
|
|
79
|
+
const startupTimer = setTimeout(() => {
|
|
80
|
+
options.onError?.(new Error("The SolidX frame did not start. Check the route and framing policy."));
|
|
81
|
+
}, 30_000);
|
|
82
|
+
async function receive(event) {
|
|
83
|
+
const data = event.data;
|
|
84
|
+
if (event.source !== iframe.contentWindow || event.origin !== frameUrl.origin
|
|
85
|
+
|| data?.channel !== channel || data.instanceId !== instanceId
|
|
86
|
+
|| data.type !== "token_request" || typeof data.requestId !== "string") return;
|
|
87
|
+
clearTimeout(startupTimer);
|
|
88
|
+
const send = (type, session) => {
|
|
89
|
+
if (!abort.signal.aborted) {
|
|
90
|
+
iframe.contentWindow?.postMessage({ channel, instanceId, type, requestId: data.requestId, session }, frameUrl.origin);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const load = async () => {
|
|
94
|
+
const response = await fetch(tokenEndpoint, {
|
|
95
|
+
method: "POST",
|
|
96
|
+
credentials: "same-origin",
|
|
97
|
+
cache: "no-store",
|
|
98
|
+
redirect: "error",
|
|
99
|
+
headers: { "Content-Type": "application/json" },
|
|
100
|
+
body: "{}",
|
|
101
|
+
signal: abort.signal,
|
|
102
|
+
});
|
|
103
|
+
if (!response.ok) throw new Error("The SolidX token endpoint rejected the request.");
|
|
104
|
+
const payload = await response.json();
|
|
105
|
+
const session = payload?.data ?? payload;
|
|
106
|
+
if (typeof session?.accessToken !== "string" || !session.user) {
|
|
107
|
+
throw new Error("The SolidX token endpoint returned an invalid session.");
|
|
108
|
+
}
|
|
109
|
+
return { accessToken: session.accessToken, user: session.user };
|
|
110
|
+
};
|
|
111
|
+
try {
|
|
112
|
+
pending ??= load().finally(() => { pending = undefined; });
|
|
113
|
+
send("token", await pending);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
send("token_error");
|
|
116
|
+
if (!abort.signal.aborted) options.onError?.(error);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
window.addEventListener("message", receive);
|
|
121
|
+
container.append(iframe);
|
|
122
|
+
return {
|
|
123
|
+
destroy() {
|
|
124
|
+
abort.abort();
|
|
125
|
+
clearTimeout(startupTimer);
|
|
126
|
+
window.removeEventListener("message", receive);
|
|
127
|
+
iframe.remove();
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
window.SolidXAdminEmbed = { mount };
|
|
133
|
+
})();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Controller, Get, Res } from '@nestjs/common';
|
|
2
|
+
import { Response } from 'express';
|
|
3
|
+
import { existsSync, readFileSync } from 'fs';
|
|
4
|
+
import { resolve } from 'path';
|
|
5
|
+
import { Public } from '../decorators/public.decorator';
|
|
6
|
+
|
|
7
|
+
@Controller('admin-embed')
|
|
8
|
+
export class AdminEmbedController {
|
|
9
|
+
@Public()
|
|
10
|
+
@Get('sdk.js')
|
|
11
|
+
sdk(@Res() response: Response): void {
|
|
12
|
+
let embedUrl: URL;
|
|
13
|
+
try {
|
|
14
|
+
// Falls back to the agent embed's UI URL: both point at the same hosted SolidX UI.
|
|
15
|
+
const ui = new URL(process.env.ADMIN_EMBED_UI_URL || process.env.AGENT_EMBED_UI_URL || '');
|
|
16
|
+
if (!['http:', 'https:'].includes(ui.protocol) || ui.username || ui.password || ui.search || ui.hash) {
|
|
17
|
+
throw new Error('Invalid admin embed UI URL');
|
|
18
|
+
}
|
|
19
|
+
ui.pathname = `${ui.pathname.replace(/\/$/, '')}/embed/admin`;
|
|
20
|
+
embedUrl = ui;
|
|
21
|
+
} catch {
|
|
22
|
+
response.status(503).type('text/plain').send('Admin embed UI is not configured.');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const packaged = resolve(__dirname, '../resources/admin-embed/solid-admin-embed.js');
|
|
27
|
+
const source = resolve(__dirname, '../../resources/admin-embed/solid-admin-embed.js');
|
|
28
|
+
const sdk = readFileSync(existsSync(packaged) ? packaged : source, 'utf8');
|
|
29
|
+
response.type('application/javascript');
|
|
30
|
+
response.setHeader('Cache-Control', 'no-cache');
|
|
31
|
+
response.setHeader('Cross-Origin-Resource-Policy', 'cross-origin');
|
|
32
|
+
response.send(sdk.replace('__SOLIDX_ADMIN_EMBED_UI_URL__', () => JSON.stringify(embedUrl.href)));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -22,10 +22,26 @@ export class AgentSessionController {
|
|
|
22
22
|
@ApiBearerAuth('jwt')
|
|
23
23
|
@Get('inbox')
|
|
24
24
|
listInbox(@Headers('authorization') authorization: string, @Query('review') review: string,
|
|
25
|
-
@Query('offset') offset: string)
|
|
25
|
+
@Query('offset') offset: string, @Query('limit') limit: string,
|
|
26
|
+
@Query('agent') agent: string, @Query('status') status: string,
|
|
27
|
+
@Query('trigger') trigger: string, @Query('runtime') runtime: string,
|
|
28
|
+
@Query('startedFrom') startedFrom: string, @Query('startedTo') startedTo: string,
|
|
29
|
+
@Query('q') search: string, @Query('sort') sort: string) {
|
|
26
30
|
const start = Number(offset);
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
const pageSize = Number(limit);
|
|
32
|
+
return this.manager.listJobSessions(this.bearer(authorization), {
|
|
33
|
+
review: review === 'true',
|
|
34
|
+
offset: Number.isSafeInteger(start) && start > 0 ? start : 0,
|
|
35
|
+
limit: Number.isSafeInteger(pageSize) && pageSize > 0 ? Math.min(pageSize, 100) : 25,
|
|
36
|
+
agent: agent?.trim() || undefined,
|
|
37
|
+
status: status?.trim() || undefined,
|
|
38
|
+
trigger: trigger?.trim() || undefined,
|
|
39
|
+
runtime: runtime?.trim() || undefined,
|
|
40
|
+
startedFrom: startedFrom?.trim() || undefined,
|
|
41
|
+
startedTo: startedTo?.trim() || undefined,
|
|
42
|
+
search: search?.trim() || undefined,
|
|
43
|
+
sort: sort?.trim() || undefined,
|
|
44
|
+
});
|
|
29
45
|
}
|
|
30
46
|
|
|
31
47
|
@ApiBearerAuth('jwt')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Body, Controller, Get, HttpCode, HttpStatus, Logger, Param, ParseIntPipe, Patch, Post, Res, Headers } from '@nestjs/common';
|
|
1
|
+
import { Body, Controller, ForbiddenException, Get, Header, HttpCode, HttpStatus, Logger, Param, ParseIntPipe, Patch, Post, Res, Headers } from '@nestjs/common';
|
|
2
2
|
import { ApiBearerAuth, ApiHeader, ApiTags } from '@nestjs/swagger';
|
|
3
3
|
import { Response } from 'express';
|
|
4
4
|
import { ActiveUser } from "../decorators/active-user.decorator";
|
|
@@ -32,6 +32,12 @@ export class AuthenticationController {
|
|
|
32
32
|
private readonly apiKeyService: ApiKeyService,
|
|
33
33
|
) { }
|
|
34
34
|
|
|
35
|
+
private requireInteractiveSession(user: ActiveUserData) {
|
|
36
|
+
if (user?.portalApiKeyId) {
|
|
37
|
+
throw new ForbiddenException('This operation requires an interactive session');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
@Public()
|
|
36
42
|
// @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only
|
|
37
43
|
@Post('register')
|
|
@@ -95,6 +101,7 @@ export class AuthenticationController {
|
|
|
95
101
|
@ApiBearerAuth("jwt")
|
|
96
102
|
@Post('change-password')
|
|
97
103
|
changePassword(@Body() changePasswordDto: ChangePasswordDto, @ActiveUser() activeUser: ActiveUserData) {
|
|
104
|
+
this.requireInteractiveSession(activeUser);
|
|
98
105
|
return this.authService.changePassword(changePasswordDto, activeUser);
|
|
99
106
|
}
|
|
100
107
|
|
|
@@ -124,6 +131,7 @@ export class AuthenticationController {
|
|
|
124
131
|
@Body() dto: CreateApiKeyDto,
|
|
125
132
|
@ActiveUser() activeUser: ActiveUserData,
|
|
126
133
|
) {
|
|
134
|
+
this.requireInteractiveSession(activeUser);
|
|
127
135
|
return this.apiKeyService.generate(activeUser.sub, dto);
|
|
128
136
|
}
|
|
129
137
|
|
|
@@ -133,7 +141,9 @@ export class AuthenticationController {
|
|
|
133
141
|
generateApiKeyForUser(
|
|
134
142
|
@Param('userId', ParseIntPipe) userId: number,
|
|
135
143
|
@Body() dto: CreateApiKeyDto,
|
|
144
|
+
@ActiveUser() activeUser: ActiveUserData,
|
|
136
145
|
) {
|
|
146
|
+
this.requireInteractiveSession(activeUser);
|
|
137
147
|
return this.apiKeyService.generate(userId, dto);
|
|
138
148
|
}
|
|
139
149
|
|
|
@@ -155,6 +165,15 @@ export class AuthenticationController {
|
|
|
155
165
|
return this.apiKeyService.apiKeyMe(apiKey);
|
|
156
166
|
}
|
|
157
167
|
|
|
168
|
+
@Public()
|
|
169
|
+
@ApiHeader({ name: 'solidx-api-key', required: true, description: 'API key held by the embedding application server' })
|
|
170
|
+
@Header('Cache-Control', 'no-store')
|
|
171
|
+
@HttpCode(HttpStatus.OK)
|
|
172
|
+
@Post('api-keys/portal-session')
|
|
173
|
+
createPortalSession(@Headers('solidx-api-key') apiKey: string) {
|
|
174
|
+
return this.apiKeyService.createPortalSession(apiKey);
|
|
175
|
+
}
|
|
176
|
+
|
|
158
177
|
@Post('sso/code')
|
|
159
178
|
@HttpCode(HttpStatus.OK)
|
|
160
179
|
generateSsoCode(
|
|
@@ -16,6 +16,7 @@ import { ActiveSessionStorageService } from "../services/active-session-storage.
|
|
|
16
16
|
import { AccessTokenDenylistService } from "../services/access-token-denylist.service";
|
|
17
17
|
import { SettingService } from '../services/setting.service';
|
|
18
18
|
import { createHash } from "crypto";
|
|
19
|
+
import { ApiKeyService } from '../services/api-key.service';
|
|
19
20
|
|
|
20
21
|
@Injectable()
|
|
21
22
|
export class AccessTokenGuard implements CanActivate {
|
|
@@ -25,7 +26,8 @@ export class AccessTokenGuard implements CanActivate {
|
|
|
25
26
|
private readonly activeSessionStorage: ActiveSessionStorageService,
|
|
26
27
|
private readonly accessTokenDenylist: AccessTokenDenylistService,
|
|
27
28
|
private readonly settingService: SettingService,
|
|
28
|
-
private readonly cls: ClsService
|
|
29
|
+
private readonly cls: ClsService,
|
|
30
|
+
private readonly apiKeyService: ApiKeyService,
|
|
29
31
|
) { }
|
|
30
32
|
|
|
31
33
|
async canActivate(context: ExecutionContext): Promise<boolean> {
|
|
@@ -49,6 +51,14 @@ export class AccessTokenGuard implements CanActivate {
|
|
|
49
51
|
jwtConfiguration
|
|
50
52
|
);
|
|
51
53
|
|
|
54
|
+
// Portal tokens follow the key lifecycle and never occupy a browser login slot.
|
|
55
|
+
if (payload.portalApiKeyId !== undefined) {
|
|
56
|
+
const user = await this.apiKeyService.validatePortalSession(payload.portalApiKeyId, payload.sub);
|
|
57
|
+
request[REQUEST_USER_KEY] = user;
|
|
58
|
+
this.cls.set(REQUEST_USER_KEY, user);
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
52
62
|
// Immediate access-token revocation. Runs BEFORE the concurrent-login
|
|
53
63
|
// check on purpose: rejecting a revoked token first stops it reaching the
|
|
54
64
|
// adopt-on-empty branch below and reclaiming the active session slot.
|
|
@@ -31,6 +31,9 @@ export interface ActiveUserData {
|
|
|
31
31
|
*/
|
|
32
32
|
deviceKey?: string;
|
|
33
33
|
|
|
34
|
+
/** The API key backing a short-lived admin embed access token. */
|
|
35
|
+
portalApiKeyId?: number;
|
|
36
|
+
|
|
34
37
|
/**
|
|
35
38
|
* The subject's (user) roles.
|
|
36
39
|
* These are part of the JWT token, we simply decode them.
|
|
@@ -14325,7 +14325,9 @@
|
|
|
14325
14325
|
"displayName": "Agent",
|
|
14326
14326
|
"name": "agent-menu-item",
|
|
14327
14327
|
"sequenceNumber": 8,
|
|
14328
|
-
"roles": [
|
|
14328
|
+
"roles": [
|
|
14329
|
+
"Internal User"
|
|
14330
|
+
],
|
|
14329
14331
|
"actionUserKey": "",
|
|
14330
14332
|
"moduleUserKey": "solid-core",
|
|
14331
14333
|
"parentMenuItemUserKey": "",
|
|
@@ -14442,7 +14444,9 @@
|
|
|
14442
14444
|
"displayName": "Jobs inbox",
|
|
14443
14445
|
"name": "agentSession-inbox-menu-item",
|
|
14444
14446
|
"sequenceNumber": 7,
|
|
14445
|
-
"roles": [
|
|
14447
|
+
"roles": [
|
|
14448
|
+
"Internal User"
|
|
14449
|
+
],
|
|
14446
14450
|
"actionUserKey": "agentSession-inbox-action",
|
|
14447
14451
|
"moduleUserKey": "solid-core",
|
|
14448
14452
|
"parentMenuItemUserKey": "agent-menu-item",
|
|
@@ -28284,6 +28288,69 @@
|
|
|
28284
28288
|
"name": "heartbeatAt",
|
|
28285
28289
|
"sortable": true
|
|
28286
28290
|
}
|
|
28291
|
+
},
|
|
28292
|
+
{
|
|
28293
|
+
"type": "field",
|
|
28294
|
+
"attrs": {
|
|
28295
|
+
"name": "runner",
|
|
28296
|
+
"isSearchable": true,
|
|
28297
|
+
"sortable": true
|
|
28298
|
+
}
|
|
28299
|
+
},
|
|
28300
|
+
{
|
|
28301
|
+
"type": "field",
|
|
28302
|
+
"attrs": {
|
|
28303
|
+
"name": "runtimeVersion",
|
|
28304
|
+
"sortable": true
|
|
28305
|
+
}
|
|
28306
|
+
},
|
|
28307
|
+
{
|
|
28308
|
+
"type": "field",
|
|
28309
|
+
"attrs": {
|
|
28310
|
+
"name": "host"
|
|
28311
|
+
}
|
|
28312
|
+
},
|
|
28313
|
+
{
|
|
28314
|
+
"type": "field",
|
|
28315
|
+
"attrs": {
|
|
28316
|
+
"name": "port",
|
|
28317
|
+
"sortable": true
|
|
28318
|
+
}
|
|
28319
|
+
},
|
|
28320
|
+
{
|
|
28321
|
+
"type": "field",
|
|
28322
|
+
"attrs": {
|
|
28323
|
+
"name": "cpu",
|
|
28324
|
+
"sortable": true
|
|
28325
|
+
}
|
|
28326
|
+
},
|
|
28327
|
+
{
|
|
28328
|
+
"type": "field",
|
|
28329
|
+
"attrs": {
|
|
28330
|
+
"name": "memory",
|
|
28331
|
+
"sortable": true
|
|
28332
|
+
}
|
|
28333
|
+
},
|
|
28334
|
+
{
|
|
28335
|
+
"type": "field",
|
|
28336
|
+
"attrs": {
|
|
28337
|
+
"name": "maxSessions",
|
|
28338
|
+
"sortable": true
|
|
28339
|
+
}
|
|
28340
|
+
},
|
|
28341
|
+
{
|
|
28342
|
+
"type": "field",
|
|
28343
|
+
"attrs": {
|
|
28344
|
+
"name": "maxRunningTurns",
|
|
28345
|
+
"sortable": true
|
|
28346
|
+
}
|
|
28347
|
+
},
|
|
28348
|
+
{
|
|
28349
|
+
"type": "field",
|
|
28350
|
+
"attrs": {
|
|
28351
|
+
"name": "stoppedAt",
|
|
28352
|
+
"sortable": true
|
|
28353
|
+
}
|
|
28287
28354
|
}
|
|
28288
28355
|
]
|
|
28289
28356
|
}
|
|
@@ -28426,6 +28493,36 @@
|
|
|
28426
28493
|
"attrs": {
|
|
28427
28494
|
"name": "heartbeatAt"
|
|
28428
28495
|
}
|
|
28496
|
+
},
|
|
28497
|
+
{
|
|
28498
|
+
"type": "field",
|
|
28499
|
+
"attrs": {
|
|
28500
|
+
"name": "runner"
|
|
28501
|
+
}
|
|
28502
|
+
},
|
|
28503
|
+
{
|
|
28504
|
+
"type": "field",
|
|
28505
|
+
"attrs": {
|
|
28506
|
+
"name": "runnerRef"
|
|
28507
|
+
}
|
|
28508
|
+
},
|
|
28509
|
+
{
|
|
28510
|
+
"type": "field",
|
|
28511
|
+
"attrs": {
|
|
28512
|
+
"name": "runtimeVersion"
|
|
28513
|
+
}
|
|
28514
|
+
},
|
|
28515
|
+
{
|
|
28516
|
+
"type": "field",
|
|
28517
|
+
"attrs": {
|
|
28518
|
+
"name": "cpu"
|
|
28519
|
+
}
|
|
28520
|
+
},
|
|
28521
|
+
{
|
|
28522
|
+
"type": "field",
|
|
28523
|
+
"attrs": {
|
|
28524
|
+
"name": "memory"
|
|
28525
|
+
}
|
|
28429
28526
|
}
|
|
28430
28527
|
]
|
|
28431
28528
|
}
|
|
@@ -31042,4 +31139,4 @@
|
|
|
31042
31139
|
}
|
|
31043
31140
|
],
|
|
31044
31141
|
"secrets": []
|
|
31045
|
-
}
|
|
31142
|
+
}
|
|
@@ -47,8 +47,18 @@ export class AgentHubProcessManagerService {
|
|
|
47
47
|
return this.request('GET', '/api/processes', authorization);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
listJobSessions(authorization: string,
|
|
51
|
-
|
|
50
|
+
listJobSessions(authorization: string, filters: {
|
|
51
|
+
review: boolean; offset: number; limit: number; agent?: string; status?: string;
|
|
52
|
+
trigger?: string; runtime?: string; startedFrom?: string; startedTo?: string; search?: string; sort?: string;
|
|
53
|
+
}) {
|
|
54
|
+
const query = new URLSearchParams({
|
|
55
|
+
review: String(filters.review), offset: String(filters.offset), limit: String(filters.limit),
|
|
56
|
+
});
|
|
57
|
+
for (const key of ['agent', 'status', 'trigger', 'runtime', 'startedFrom', 'startedTo', 'search', 'sort'] as const) {
|
|
58
|
+
const value = filters[key];
|
|
59
|
+
if (value) query.set(key, value);
|
|
60
|
+
}
|
|
61
|
+
return this.request('GET', `/api/job-sessions?${query.toString()}`, authorization);
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
getJobSession(authorization: string, sessionId: string) {
|
|
@@ -82,8 +82,11 @@ export class AgentRegistryService extends CRUDService<AgentRegistry>{
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
const deployment = { runner, minProcesses, maxProcesses, processCpu, processMemory };
|
|
85
|
+
const changed = agent.runner !== runner || agent.minProcesses !== minProcesses || agent.maxProcesses !== maxProcesses ||
|
|
86
|
+
agent.processCpu !== processCpu || agent.processMemory !== processMemory;
|
|
85
87
|
await repository.update(id, deployment);
|
|
86
|
-
|
|
88
|
+
if (changed) await markActiveAgentsDraft(manager, [id]);
|
|
89
|
+
return repository.findOne({ where: { id } });
|
|
87
90
|
});
|
|
88
91
|
}
|
|
89
92
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { ExecutionContext, UnauthorizedException } from '@nestjs/common';
|
|
3
|
+
import { JwtService } from '@nestjs/jwt';
|
|
4
|
+
import { REQUEST_USER_KEY } from '../constants';
|
|
5
|
+
import { AccessTokenGuard } from '../guards/access-token.guard';
|
|
6
|
+
import { ApiKeyService } from './api-key.service';
|
|
7
|
+
import { AuthenticationService } from './authentication.service';
|
|
8
|
+
|
|
9
|
+
describe('API key portal sessions', () => {
|
|
10
|
+
const jwt = new JwtService();
|
|
11
|
+
const config = { audience: 'portal-test', issuer: 'portal-test', secret: 'portal-test-secret' };
|
|
12
|
+
const settings = { getConfigValue: (name: string) => config[name] };
|
|
13
|
+
const key = {
|
|
14
|
+
id: 17,
|
|
15
|
+
isActive: true,
|
|
16
|
+
expiresAt: null as Date | null,
|
|
17
|
+
user: { id: 5, active: true, forcePasswordChange: false, username: 'reviewer', roles: [{ name: 'Reviewer' }] },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function setup() {
|
|
21
|
+
const repo = { findOne: jest.fn().mockResolvedValue(key), update: jest.fn().mockResolvedValue(undefined) };
|
|
22
|
+
const permissions = { findAllUsingRoles: jest.fn().mockResolvedValue([{ name: 'AgentSessionController.listInbox' }]) };
|
|
23
|
+
const refreshTokens = { getCurrentRefreshTokenState: jest.fn() };
|
|
24
|
+
const auth: AuthenticationService = Object.assign(Object.create(AuthenticationService.prototype), {
|
|
25
|
+
jwtService: jwt,
|
|
26
|
+
settingService: settings,
|
|
27
|
+
userRepository: { findOne: jest.fn().mockResolvedValue(key.user) },
|
|
28
|
+
refreshTokenIdsStorage: refreshTokens,
|
|
29
|
+
});
|
|
30
|
+
const service = new ApiKeyService(repo as any, permissions as any, auth, undefined);
|
|
31
|
+
// Passing undefined for the interactive session stores detects accidental use of them.
|
|
32
|
+
const guard = new AccessTokenGuard(jwt, permissions as any, undefined, undefined, settings as any, { set: jest.fn() } as any, service);
|
|
33
|
+
return { auth, guard, repo, service, refreshTokens };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
it('issues an expiring bearer token without creating or exposing a refresh session', async () => {
|
|
37
|
+
const { auth, guard, service, refreshTokens } = setup();
|
|
38
|
+
const session = await service.createPortalSession('host-api-key');
|
|
39
|
+
expect(session).not.toHaveProperty('refreshToken');
|
|
40
|
+
const claims = await jwt.verifyAsync(session.accessToken, config);
|
|
41
|
+
expect(claims).toMatchObject({ sub: key.user.id, portalApiKeyId: key.id, roles: ['Reviewer'] });
|
|
42
|
+
expect(claims.exp - claims.iat).toBe(300);
|
|
43
|
+
|
|
44
|
+
const request = { headers: { authorization: `Bearer ${session.accessToken}` } };
|
|
45
|
+
const ctx = { switchToHttp: () => ({ getRequest: () => request }) } as ExecutionContext;
|
|
46
|
+
expect(await guard.canActivate(ctx)).toBe(true);
|
|
47
|
+
expect(request[REQUEST_USER_KEY].permissions).toEqual(['AgentSessionController.listInbox']);
|
|
48
|
+
expect(await auth.me(request[REQUEST_USER_KEY])).toMatchObject({ refreshToken: null });
|
|
49
|
+
expect(refreshTokens.getCurrentRefreshTokenState).not.toHaveBeenCalled();
|
|
50
|
+
await expect(auth.generateSsoCode(request[REQUEST_USER_KEY], session.accessToken)).rejects.toThrow();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('rejects revoked keys and inactive accounts both at exchange and during bearer authentication', async () => {
|
|
54
|
+
const { service, repo } = setup();
|
|
55
|
+
for (const record of [
|
|
56
|
+
null,
|
|
57
|
+
{ ...key, isActive: false },
|
|
58
|
+
{ ...key, expiresAt: new Date(Date.now() - 60_000) },
|
|
59
|
+
{ ...key, user: { ...key.user, active: false } },
|
|
60
|
+
]) {
|
|
61
|
+
repo.findOne.mockResolvedValue(record);
|
|
62
|
+
await expect(service.createPortalSession('host-api-key')).rejects.toBeInstanceOf(UnauthorizedException);
|
|
63
|
+
await expect(service.validatePortalSession(key.id, key.user.id)).rejects.toBeInstanceOf(UnauthorizedException);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('caps the bearer lifetime at the API key expiry', async () => {
|
|
68
|
+
const { service, repo } = setup();
|
|
69
|
+
repo.findOne.mockResolvedValue({ ...key, expiresAt: new Date(Date.now() + 45_000) });
|
|
70
|
+
const session = await service.createPortalSession('host-api-key');
|
|
71
|
+
const claims = await jwt.verifyAsync(session.accessToken, config);
|
|
72
|
+
expect(claims.exp - claims.iat).toBeGreaterThan(0);
|
|
73
|
+
expect(claims.exp - claims.iat).toBeLessThanOrEqual(45);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -17,6 +17,8 @@ import { PermissionMetadataService } from 'src/services/permission-metadata.serv
|
|
|
17
17
|
import { AuthenticationService } from './authentication.service';
|
|
18
18
|
import { UserRepository } from 'src/repository/user.repository';
|
|
19
19
|
|
|
20
|
+
const portalAccessTokenTtl = 300;
|
|
21
|
+
|
|
20
22
|
@Injectable()
|
|
21
23
|
export class ApiKeyService {
|
|
22
24
|
private readonly logger = new Logger(ApiKeyService.name);
|
|
@@ -110,6 +112,65 @@ export class ApiKeyService {
|
|
|
110
112
|
.execute();
|
|
111
113
|
}
|
|
112
114
|
|
|
115
|
+
async createPortalSession(rawKey: string) {
|
|
116
|
+
if (typeof rawKey !== 'string' || !rawKey) {
|
|
117
|
+
throw new UnauthorizedException();
|
|
118
|
+
}
|
|
119
|
+
const key = this.requirePortalKey(await this.apiKeyRepository.findOne({
|
|
120
|
+
where: { hashedKey: this.hash(rawKey), isActive: true },
|
|
121
|
+
relations: ['user', 'user.roles'],
|
|
122
|
+
}));
|
|
123
|
+
const user = key.user;
|
|
124
|
+
const remainingSeconds = key.expiresAt
|
|
125
|
+
? Math.floor((key.expiresAt.getTime() - Date.now()) / 1000)
|
|
126
|
+
: portalAccessTokenTtl;
|
|
127
|
+
const expiresIn = Math.min(remainingSeconds, portalAccessTokenTtl);
|
|
128
|
+
if (expiresIn <= 0) {
|
|
129
|
+
throw new UnauthorizedException();
|
|
130
|
+
}
|
|
131
|
+
const accessToken = await this.authenticationService.generatePortalAccessToken(user, key.id, expiresIn);
|
|
132
|
+
this.apiKeyRepository.update(key.id, { lastUsedAt: new Date() }).catch((err) => {
|
|
133
|
+
this.logger.warn(`Failed to update lastUsedAt for key ${key.id}: ${err.message}`);
|
|
134
|
+
});
|
|
135
|
+
return {
|
|
136
|
+
accessToken,
|
|
137
|
+
user: {
|
|
138
|
+
id: user.id,
|
|
139
|
+
email: user.email,
|
|
140
|
+
mobile: user.mobile,
|
|
141
|
+
username: user.username,
|
|
142
|
+
roles: user.roles.map((role) => role.name),
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async validatePortalSession(keyId: number, userId: number): Promise<ActiveUserData> {
|
|
148
|
+
if (!Number.isSafeInteger(keyId) || keyId <= 0 || !Number.isSafeInteger(userId) || userId <= 0) {
|
|
149
|
+
throw new UnauthorizedException();
|
|
150
|
+
}
|
|
151
|
+
const key = this.requirePortalKey(await this.apiKeyRepository.findOne({
|
|
152
|
+
where: { id: keyId, isActive: true, user: { id: userId } },
|
|
153
|
+
relations: ['user', 'user.roles'],
|
|
154
|
+
}));
|
|
155
|
+
const roles = key.user.roles.map((role) => role.name);
|
|
156
|
+
const permissions = await this.permissionMetadataService.findAllUsingRoles(roles);
|
|
157
|
+
return {
|
|
158
|
+
sub: key.user.id,
|
|
159
|
+
username: key.user.username,
|
|
160
|
+
email: key.user.email,
|
|
161
|
+
roles,
|
|
162
|
+
permissions: permissions.map((permission) => permission.name),
|
|
163
|
+
portalApiKeyId: keyId,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
private requirePortalKey(key: UserApiKey | null): UserApiKey {
|
|
168
|
+
if (!key?.isActive || !key.user?.active || key.user.forcePasswordChange
|
|
169
|
+
|| (key.expiresAt && key.expiresAt.getTime() <= Date.now())) {
|
|
170
|
+
throw new UnauthorizedException();
|
|
171
|
+
}
|
|
172
|
+
return key;
|
|
173
|
+
}
|
|
113
174
|
|
|
114
175
|
async apiKeyMe(apiKey: string) {
|
|
115
176
|
|