anbaric-cloud-hosting 1.36.0 → 1.38.0
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anbaric-cloud-hosting",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "Anbaric Cloud hosting service: Postgres-backed job persistence and queuing exposed over an HTTP API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chris@anbaric.ai",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"@aws-sdk/client-s3": "^3.1110.0",
|
|
19
19
|
"@aws-sdk/client-secrets-manager": "^3.700.0",
|
|
20
20
|
"@aws-sdk/client-servicediscovery": "^3.1110.0",
|
|
21
|
-
"anbaric-data-store": "^1.
|
|
22
|
-
"anbaric-plugins": "^1.
|
|
23
|
-
"anbaric-tsapi": "^1.
|
|
24
|
-
"anbaric-web": "^1.
|
|
21
|
+
"anbaric-data-store": "^1.38.0",
|
|
22
|
+
"anbaric-plugins": "^1.38.0",
|
|
23
|
+
"anbaric-tsapi": "^1.38.0",
|
|
24
|
+
"anbaric-web": "^1.38.0",
|
|
25
25
|
"esbuild": "^0.28.2",
|
|
26
26
|
"pg": "^8.16.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^26.2.0",
|
|
30
30
|
"@types/pg": "^8.15.0",
|
|
31
|
-
"anbaric-impl-cloud": "^1.
|
|
32
|
-
"anbaric-state-machine": "^1.
|
|
31
|
+
"anbaric-impl-cloud": "^1.38.0",
|
|
32
|
+
"anbaric-state-machine": "^1.38.0",
|
|
33
33
|
"tsx": "^4.20.0",
|
|
34
34
|
"typescript": "^7.0.2"
|
|
35
35
|
},
|
|
@@ -88,7 +88,7 @@ class HostingServer {
|
|
|
88
88
|
publicRouter.register("favicon.ico", new FaviconHandler());
|
|
89
89
|
publicRouter.register("logout", new LogoutHandler(authenticator));
|
|
90
90
|
if (plugins.length > 0) publicRouter.registerApi("plugins", new PluginsHandler(plugins));
|
|
91
|
-
publicRouter.registerApi("whoami", new WhoamiHandler());
|
|
91
|
+
publicRouter.registerApi("whoami", new WhoamiHandler(tenant));
|
|
92
92
|
publicRouter.registerApi("sessions", sessions);
|
|
93
93
|
publicRouter.registerApi("jobs", jobs);
|
|
94
94
|
publicRouter.registerApi("queue", queueHandler);
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import {Request} from "../../Request";
|
|
2
2
|
import {RequestHandler} from "../../RequestHandler";
|
|
3
3
|
|
|
4
|
+
/* Who is signed in, and which tenant this platform is - the platform's own
|
|
5
|
+
tenant when it has one, else the tenant the session names. */
|
|
4
6
|
class WhoamiHandler implements RequestHandler {
|
|
5
7
|
|
|
8
|
+
constructor(private tenant? : string) {}
|
|
9
|
+
|
|
6
10
|
async handle(request : Request) : Promise<void> {
|
|
7
11
|
if (request.method === "GET" && !request.id && request.user) {
|
|
8
12
|
return request.reply(200, {
|
|
@@ -10,6 +14,7 @@ class WhoamiHandler implements RequestHandler {
|
|
|
10
14
|
roles: request.user.roles.map(role => role.id),
|
|
11
15
|
name: request.user.name,
|
|
12
16
|
picture: request.user.picture,
|
|
17
|
+
tenant: this.tenant ?? request.tenant?.id,
|
|
13
18
|
});
|
|
14
19
|
}
|
|
15
20
|
request.notFound();
|