anbaric-cloud-hosting 1.2.0 → 1.2.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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anbaric-cloud-hosting",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
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",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"@aws-sdk/client-s3": "^3.1110.0",
|
|
18
18
|
"@aws-sdk/client-secrets-manager": "^3.700.0",
|
|
19
19
|
"@aws-sdk/client-servicediscovery": "^3.1110.0",
|
|
20
|
-
"anbaric-data-store": "^1.2.
|
|
21
|
-
"anbaric-tsapi": "^1.2.
|
|
20
|
+
"anbaric-data-store": "^1.2.1",
|
|
21
|
+
"anbaric-tsapi": "^1.2.1",
|
|
22
22
|
"pg": "^8.16.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^26.2.0",
|
|
26
26
|
"@types/pg": "^8.15.0",
|
|
27
|
-
"anbaric-cloud": "^1.2.
|
|
28
|
-
"anbaric-state-machine": "^1.2.
|
|
27
|
+
"anbaric-cloud": "^1.2.1",
|
|
28
|
+
"anbaric-state-machine": "^1.2.1",
|
|
29
29
|
"tsx": "^4.20.0",
|
|
30
30
|
"typescript": "^7.0.2"
|
|
31
31
|
},
|
|
@@ -27,7 +27,7 @@ class HostingServer {
|
|
|
27
27
|
private authenticator? : Authenticator,
|
|
28
28
|
cliAuthorizer? : CliAuthorizer,
|
|
29
29
|
private tokenAuthenticator? : TokenAuthenticator,
|
|
30
|
-
tenant? : string) {
|
|
30
|
+
private tenant? : string) {
|
|
31
31
|
this.router = new Router(persistence, queue, registry, buildLayer, documentStoreFor, secretStore, cliAuthorizer, tenant);
|
|
32
32
|
this.server = this.serverFor((request, response) => this.handle(request, response));
|
|
33
33
|
this.internalServer = this.serverFor((request, response) => this.handleInternal(request, response));
|
|
@@ -63,7 +63,7 @@ class HostingServer {
|
|
|
63
63
|
private async handle(request : IncomingMessage, response : ServerResponse) : Promise<void> {
|
|
64
64
|
const path = request.url?.split("?")[0] ?? "/";
|
|
65
65
|
if (path === "/ping" && request.method === "GET") {
|
|
66
|
-
return this.reply(response, 200, { status: "ok" });
|
|
66
|
+
return this.reply(response, 200, this.tenant ? { status: "ok", tenant: this.tenant } : { status: "ok" });
|
|
67
67
|
}
|
|
68
68
|
if (/^\/authorize-cli\/[^/]+\/poll$/.test(path) && request.method === "GET") {
|
|
69
69
|
return this.router.route(request, response);
|
|
@@ -85,7 +85,7 @@ class HostingServer {
|
|
|
85
85
|
private async handleInternal(request : IncomingMessage, response : ServerResponse) : Promise<void> {
|
|
86
86
|
const path = request.url?.split("?")[0] ?? "/";
|
|
87
87
|
if (path === "/ping" && request.method === "GET") {
|
|
88
|
-
return this.reply(response, 200, { status: "ok" });
|
|
88
|
+
return this.reply(response, 200, this.tenant ? { status: "ok", tenant: this.tenant } : { status: "ok" });
|
|
89
89
|
}
|
|
90
90
|
const [resource] = path.split("/").filter(Boolean);
|
|
91
91
|
if (!resource || !INTERNAL_RESOURCES.has(resource)) {
|