anbaric-cloud-hosting 1.33.0 → 1.35.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 +7 -7
- package/src/auth/HttpMembershipService.ts +44 -0
- package/src/auth/InMemoryMembershipService.ts +38 -0
- package/src/auth/InMemoryUserDirectory.ts +29 -0
- package/src/auth/MembershipService.ts +35 -0
- package/src/auth/SessionSigner.ts +4 -2
- package/src/auth/UserDirectory.ts +25 -0
- package/src/data-store/PostgresUserDirectory.ts +39 -0
- package/src/data-store/Schema.ts +10 -0
- package/src/hosting/HostingServer.ts +10 -2
- package/src/hosting/handlers/auth/InvitationsHandler.ts +34 -0
- package/src/hosting/handlers/auth/UsersHandler.ts +16 -0
- package/src/hosting/middleware/AuthenticationMiddleware.ts +28 -2
- package/src/hosting/pages/platform-ui.html +3 -3
- package/src/index.ts +8 -0
- package/src/main.ts +9 -1
package/src/index.ts
CHANGED
|
@@ -17,6 +17,14 @@ export * from "./auth/StubAuthenticator";
|
|
|
17
17
|
export * from "./auth/Tenant";
|
|
18
18
|
export * from "./auth/TokenAuthenticator";
|
|
19
19
|
export * from "./auth/User";
|
|
20
|
+
export * from "./auth/UserDirectory";
|
|
21
|
+
export * from "./auth/InMemoryUserDirectory";
|
|
22
|
+
export * from "./data-store/PostgresUserDirectory";
|
|
23
|
+
export * from "./hosting/handlers/auth/UsersHandler";
|
|
24
|
+
export * from "./auth/MembershipService";
|
|
25
|
+
export * from "./auth/HttpMembershipService";
|
|
26
|
+
export * from "./auth/InMemoryMembershipService";
|
|
27
|
+
export * from "./hosting/handlers/auth/InvitationsHandler";
|
|
20
28
|
export * from "./app-management/DockerBuildLayer";
|
|
21
29
|
export * from "./app-management/FargateBuildLayer";
|
|
22
30
|
export * from "./app-admin/AdminServer";
|
package/src/main.ts
CHANGED
|
@@ -21,6 +21,8 @@ import {DocGenerator} from "./docs/DocGenerator";
|
|
|
21
21
|
import {GatewayDocModel} from "./docs/GatewayDocModel";
|
|
22
22
|
import {PostgresAppDocsStore} from "./data-store/PostgresAppDocsStore";
|
|
23
23
|
import {PostgresEntitlementStore} from "./data-store/PostgresEntitlementStore";
|
|
24
|
+
import {PostgresUserDirectory} from "./data-store/PostgresUserDirectory";
|
|
25
|
+
import {HttpMembershipService} from "./auth/HttpMembershipService";
|
|
24
26
|
import {ConsumerRegistry} from "./queuing/ConsumerRegistry";
|
|
25
27
|
import {Dispatcher} from "./queuing/Dispatcher";
|
|
26
28
|
import {HostingServer} from "./hosting/HostingServer";
|
|
@@ -92,11 +94,17 @@ const tokenAuthenticator = new TokenAuthenticator(cliKeyStore, process.env.ANBAR
|
|
|
92
94
|
|
|
93
95
|
const plugins = await new PluginLoader().load(process.env.ANBARIC_PLUGINS ?? "anbaric-plugins/state-machines");
|
|
94
96
|
|
|
97
|
+
// Invitations are managed by the central login that issued this tenant, which
|
|
98
|
+
// is the same service the CLI key lookup already points at.
|
|
99
|
+
const memberships = process.env.ANBARIC_CLI_KEY_LOOKUP_URL && process.env.ANBARIC_TENANT
|
|
100
|
+
? new HttpMembershipService(process.env.ANBARIC_CLI_KEY_LOOKUP_URL, process.env.ANBARIC_CLI_KEY_LOOKUP_SECRET ?? "", process.env.ANBARIC_TENANT)
|
|
101
|
+
: undefined;
|
|
102
|
+
|
|
95
103
|
const server = new HostingServer(new PostgresJobPersistence(pool), queue, registry, buildLayer,
|
|
96
104
|
(appId, collection) => new PostgresJsonStore(pool, appId, collection), secretStoreFor, authenticator, cliAuthorizer,
|
|
97
105
|
tokenAuthenticator, process.env.ANBARIC_TENANT, new PostgresAuditRecordStore(pool), plugins,
|
|
98
106
|
new PostgresJobRunSchedulePersistence(pool), await loadNotifier(process.env.ANBARIC_NOTIFIER_MODULE),
|
|
99
|
-
new PostgresEntitlementStore(pool));
|
|
107
|
+
new PostgresEntitlementStore(pool), new PostgresUserDirectory(pool), memberships);
|
|
100
108
|
const port = await server.listen(hostingPort);
|
|
101
109
|
const internal = await server.listenInternal(internalPort);
|
|
102
110
|
|