@camstack/addon-auth 1.2.126 → 1.2.128
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/{dist-DoUGHO_G.mjs → hub-browser-origin-DmRqQVDn.mjs} +288 -83
- package/dist/{dist-Y4IbR-lV.js → hub-browser-origin-XYN-h9Iy.js} +293 -82
- package/dist/magic-link/auth-magic-link.addon.js +13 -13
- package/dist/magic-link/auth-magic-link.addon.mjs +5 -5
- package/dist/oidc/auth-oidc.addon.js +498 -954
- package/dist/oidc/auth-oidc.addon.mjs +490 -946
- package/dist/webauthn/_stub.js +1 -1
- package/dist/webauthn/{_virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-NDvjK4u_.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-YOLhEehy.mjs} +3 -3
- package/dist/webauthn/_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CLLk0DJe.mjs +26 -0
- package/dist/webauthn/auth-webauthn.addon.js +40 -32
- package/dist/webauthn/auth-webauthn.addon.mjs +27 -19
- package/dist/webauthn/{hostInit-DYFGWxH_.mjs → hostInit-BYS4j9G0.mjs} +3 -3
- package/dist/webauthn/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/webauthn/_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BV1VZzL3.mjs +0 -26
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../chunk-Cek0wNdY.js");
|
|
6
|
-
const
|
|
6
|
+
const require_hub_browser_origin = require("../hub-browser-origin-XYN-h9Iy.js");
|
|
7
7
|
//#region src/magic-link/auth-magic-link.addon.ts
|
|
8
8
|
/**
|
|
9
9
|
* Magic-link authentication addon.
|
|
@@ -38,7 +38,7 @@ var DEFAULT_CONFIG = {
|
|
|
38
38
|
defaultRole: "viewer",
|
|
39
39
|
ttlSec: 600
|
|
40
40
|
};
|
|
41
|
-
var AuthMagicLinkAddon = class extends
|
|
41
|
+
var AuthMagicLinkAddon = class extends require_hub_browser_origin.BaseAddon {
|
|
42
42
|
constructor() {
|
|
43
43
|
super({ ...DEFAULT_CONFIG });
|
|
44
44
|
}
|
|
@@ -53,7 +53,7 @@ var AuthMagicLinkAddon = class extends require_dist.BaseAddon {
|
|
|
53
53
|
throw new Error("Magic link does not use callback — the email link redirects to /api/auth/sso/finish directly");
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
const routeProvider =
|
|
56
|
+
const routeProvider = require_hub_browser_origin.buildAddonRouteProvider("auth-magic-link", [
|
|
57
57
|
{
|
|
58
58
|
method: "GET",
|
|
59
59
|
path: "/start",
|
|
@@ -80,15 +80,15 @@ var AuthMagicLinkAddon = class extends require_dist.BaseAddon {
|
|
|
80
80
|
this.ctx.logger.info("Magic-link auth provider initialized", { meta: { deliveryMode: this.config.deliveryMode } });
|
|
81
81
|
return [
|
|
82
82
|
{
|
|
83
|
-
capability:
|
|
83
|
+
capability: require_hub_browser_origin.authProviderCapability,
|
|
84
84
|
provider: authProvider
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
capability:
|
|
87
|
+
capability: require_hub_browser_origin.addonRoutesCapability,
|
|
88
88
|
provider: routeProvider
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
capability:
|
|
91
|
+
capability: require_hub_browser_origin.loginMethodCapability,
|
|
92
92
|
provider: loginMethodProvider
|
|
93
93
|
}
|
|
94
94
|
];
|
|
@@ -134,7 +134,7 @@ var AuthMagicLinkAddon = class extends require_dist.BaseAddon {
|
|
|
134
134
|
type: "text",
|
|
135
135
|
key: "publicOrigin",
|
|
136
136
|
label: "Public origin",
|
|
137
|
-
description: "Where the email link points. Empty =
|
|
137
|
+
description: "Where the email link points. Empty = the hub address from Network (public tunnel, then mesh, then LAN).",
|
|
138
138
|
default: ""
|
|
139
139
|
}),
|
|
140
140
|
this.field({
|
|
@@ -174,17 +174,17 @@ var AuthMagicLinkAddon = class extends require_dist.BaseAddon {
|
|
|
174
174
|
]
|
|
175
175
|
}] });
|
|
176
176
|
}
|
|
177
|
-
buildPublicOrigin() {
|
|
177
|
+
async buildPublicOrigin() {
|
|
178
178
|
const configured = this.config.publicOrigin?.trim();
|
|
179
179
|
if (configured) return configured.replace(/\/+$/, "");
|
|
180
|
-
return (
|
|
180
|
+
return await require_hub_browser_origin.hubBrowserOrigin(this.ctx.api.localNetwork, this.ctx.logger) ?? "https://localhost:4443";
|
|
181
181
|
}
|
|
182
182
|
async findUserByEmail(email) {
|
|
183
183
|
let users;
|
|
184
184
|
try {
|
|
185
185
|
users = await this.ctx.api.userManagement.listUsers.query();
|
|
186
186
|
} catch (err) {
|
|
187
|
-
this.ctx.logger.warn("Magic-link user lookup failed (user-management cap unavailable)", { meta: { message:
|
|
187
|
+
this.ctx.logger.warn("Magic-link user lookup failed (user-management cap unavailable)", { meta: { message: require_hub_browser_origin.errMsg(err) } });
|
|
188
188
|
return null;
|
|
189
189
|
}
|
|
190
190
|
const needle = email.trim().toLowerCase();
|
|
@@ -273,12 +273,12 @@ var AuthMagicLinkAddon = class extends require_dist.BaseAddon {
|
|
|
273
273
|
ttlSec: this.config.ttlSec || DEFAULT_CONFIG.ttlSec
|
|
274
274
|
}));
|
|
275
275
|
} catch (err) {
|
|
276
|
-
this.ctx.logger.error("Magic-link bridge-token minting failed (sso-bridge unavailable)", { meta: { message:
|
|
276
|
+
this.ctx.logger.error("Magic-link bridge-token minting failed (sso-bridge unavailable)", { meta: { message: require_hub_browser_origin.errMsg(err) } });
|
|
277
277
|
reply.code(503);
|
|
278
278
|
reply.send({ error: "sso-bridge capability unavailable" });
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
|
-
const link = `${this.buildPublicOrigin()}/addon/auth-magic-link/login?bridge=${encodeURIComponent(token)}`;
|
|
281
|
+
const link = `${await this.buildPublicOrigin()}/addon/auth-magic-link/login?bridge=${encodeURIComponent(token)}`;
|
|
282
282
|
if (this.config.deliveryMode === "log-only") this.ctx.logger.warn("Magic link generated (log-only mode — NOT delivered via email)", { meta: {
|
|
283
283
|
email,
|
|
284
284
|
link,
|
|
@@ -294,7 +294,7 @@ var AuthMagicLinkAddon = class extends require_dist.BaseAddon {
|
|
|
294
294
|
reply.code(500);
|
|
295
295
|
reply.send({
|
|
296
296
|
error: "Magic-link request failed",
|
|
297
|
-
message:
|
|
297
|
+
message: require_hub_browser_origin.errMsg(err)
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
300
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as buildAddonRouteProvider, c as errMsg, i as authProviderCapability, l as BaseAddon, n as addonRoutesCapability, o as loginMethodCapability, t as hubBrowserOrigin } from "../hub-browser-origin-DmRqQVDn.mjs";
|
|
2
2
|
//#region src/magic-link/auth-magic-link.addon.ts
|
|
3
3
|
/**
|
|
4
4
|
* Magic-link authentication addon.
|
|
@@ -129,7 +129,7 @@ var AuthMagicLinkAddon = class extends BaseAddon {
|
|
|
129
129
|
type: "text",
|
|
130
130
|
key: "publicOrigin",
|
|
131
131
|
label: "Public origin",
|
|
132
|
-
description: "Where the email link points. Empty =
|
|
132
|
+
description: "Where the email link points. Empty = the hub address from Network (public tunnel, then mesh, then LAN).",
|
|
133
133
|
default: ""
|
|
134
134
|
}),
|
|
135
135
|
this.field({
|
|
@@ -169,10 +169,10 @@ var AuthMagicLinkAddon = class extends BaseAddon {
|
|
|
169
169
|
]
|
|
170
170
|
}] });
|
|
171
171
|
}
|
|
172
|
-
buildPublicOrigin() {
|
|
172
|
+
async buildPublicOrigin() {
|
|
173
173
|
const configured = this.config.publicOrigin?.trim();
|
|
174
174
|
if (configured) return configured.replace(/\/+$/, "");
|
|
175
|
-
return (
|
|
175
|
+
return await hubBrowserOrigin(this.ctx.api.localNetwork, this.ctx.logger) ?? "https://localhost:4443";
|
|
176
176
|
}
|
|
177
177
|
async findUserByEmail(email) {
|
|
178
178
|
let users;
|
|
@@ -273,7 +273,7 @@ var AuthMagicLinkAddon = class extends BaseAddon {
|
|
|
273
273
|
reply.send({ error: "sso-bridge capability unavailable" });
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
const link = `${this.buildPublicOrigin()}/addon/auth-magic-link/login?bridge=${encodeURIComponent(token)}`;
|
|
276
|
+
const link = `${await this.buildPublicOrigin()}/addon/auth-magic-link/login?bridge=${encodeURIComponent(token)}`;
|
|
277
277
|
if (this.config.deliveryMode === "log-only") this.ctx.logger.warn("Magic link generated (log-only mode — NOT delivered via email)", { meta: {
|
|
278
278
|
email,
|
|
279
279
|
link,
|