@camstack/core 0.1.35 → 0.1.37
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/dist/builtins/local-auth/local-auth.addon.d.ts.map +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +21 -3
- package/dist/builtins/local-auth/local-auth.addon.js.map +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +21 -3
- package/dist/builtins/local-auth/local-auth.addon.mjs.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js +32 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs +32 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +16 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +16 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs.map +1 -1
- package/dist/index.js +173 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +173 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-auth.addon.d.ts","sourceRoot":"","sources":["../../../src/builtins/local-auth/local-auth.addon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAA2B,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAE,SAAS,EAAoD,MAAM,iBAAiB,CAAA;AA6B7F,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,qBAAa,cAAe,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC5D,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,kBAAkB,CAAkC;IAC5D,OAAO,CAAC,WAAW,CAA2B;;cAI9B,YAAY,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"local-auth.addon.d.ts","sourceRoot":"","sources":["../../../src/builtins/local-auth/local-auth.addon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAA2B,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAE,SAAS,EAAoD,MAAM,iBAAiB,CAAA;AA6B7F,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,qBAAa,cAAe,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC5D,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,kBAAkB,CAAkC;IAC5D,OAAO,CAAC,WAAW,CAA2B;;cAI9B,YAAY,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;cAgR/C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAO5C;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -7783,12 +7783,24 @@ var LocalAuthAddon = class extends _camstack_types.BaseAddon {
|
|
|
7783
7783
|
const userMgmt = {
|
|
7784
7784
|
listUsers: async () => {
|
|
7785
7785
|
if (!this.userManager) return [];
|
|
7786
|
-
|
|
7786
|
+
const users = await this.userManager.listAll();
|
|
7787
|
+
if (!this.totpManager) return users.map((u) => ({
|
|
7788
|
+
...u,
|
|
7789
|
+
totpEnabled: false
|
|
7790
|
+
}));
|
|
7791
|
+
const statuses = await Promise.all(users.map((u) => this.totpManager.getStatus(u.id).catch(() => ({ enabled: false }))));
|
|
7792
|
+
return users.map((u, i) => ({
|
|
7793
|
+
...u,
|
|
7794
|
+
totpEnabled: statuses[i]?.enabled ?? false
|
|
7795
|
+
}));
|
|
7787
7796
|
},
|
|
7788
7797
|
createUser: async (input) => {
|
|
7789
7798
|
if (!this.userManager) throw new Error("User management not available");
|
|
7790
7799
|
const { passwordHash: _, ...summary } = await this.userManager.create(input);
|
|
7791
|
-
return
|
|
7800
|
+
return {
|
|
7801
|
+
...summary,
|
|
7802
|
+
totpEnabled: false
|
|
7803
|
+
};
|
|
7792
7804
|
},
|
|
7793
7805
|
updateUser: async (input) => {
|
|
7794
7806
|
if (!this.userManager) throw new Error("User management not available");
|
|
@@ -7813,7 +7825,13 @@ var LocalAuthAddon = class extends _camstack_types.BaseAddon {
|
|
|
7813
7825
|
},
|
|
7814
7826
|
validateCredentials: async (input) => {
|
|
7815
7827
|
if (!this.userManager) return null;
|
|
7816
|
-
|
|
7828
|
+
const user = await this.userManager.validateCredentials(input.username, input.password);
|
|
7829
|
+
if (!user) return null;
|
|
7830
|
+
const totpEnabled = this.totpManager ? (await this.totpManager.getStatus(user.id).catch(() => ({ enabled: false }))).enabled : false;
|
|
7831
|
+
return {
|
|
7832
|
+
...user,
|
|
7833
|
+
totpEnabled
|
|
7834
|
+
};
|
|
7817
7835
|
},
|
|
7818
7836
|
listApiKeys: async () => {
|
|
7819
7837
|
if (!this.apiKeyManager) return [];
|