@owlmeans/client-auth 0.1.18-rc.6 → 0.1.18-rc.61
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/README.md +283 -37
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/client-auth/SKILL.md +170 -21
- package/build/components/dispatcher/component.d.ts.map +1 -1
- package/build/components/dispatcher/component.js +26 -6
- package/build/components/dispatcher/component.js.map +1 -1
- package/build/components/dispatcher/types.local.d.ts +7 -0
- package/build/components/dispatcher/types.local.d.ts.map +1 -0
- package/build/components/dispatcher/types.local.js +2 -0
- package/build/components/dispatcher/types.local.js.map +1 -0
- package/build/entrypoints.d.ts +7 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +7 -0
- package/build/entrypoints.js.map +1 -0
- package/build/helper.d.ts +2 -1
- package/build/helper.d.ts.map +1 -1
- package/build/helper.js +28 -5
- package/build/helper.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/login/adopt/types.d.ts +26 -0
- package/build/login/adopt/types.d.ts.map +1 -0
- package/build/login/adopt/types.js +2 -0
- package/build/login/adopt/types.js.map +1 -0
- package/build/login/adopt.d.ts +10 -0
- package/build/login/adopt.d.ts.map +1 -0
- package/build/login/adopt.js +18 -0
- package/build/login/adopt.js.map +1 -0
- package/build/login/consts.d.ts +103 -0
- package/build/login/consts.d.ts.map +1 -0
- package/build/login/consts.js +106 -0
- package/build/login/consts.js.map +1 -0
- package/build/login/consts.local.d.ts +16 -0
- package/build/login/consts.local.d.ts.map +1 -0
- package/build/login/consts.local.js +30 -0
- package/build/login/consts.local.js.map +1 -0
- package/build/login/credit/types.d.ts +7 -0
- package/build/login/credit/types.d.ts.map +1 -0
- package/build/login/credit/types.js +2 -0
- package/build/login/credit/types.js.map +1 -0
- package/build/login/credit.d.ts +19 -0
- package/build/login/credit.d.ts.map +1 -0
- package/build/login/credit.js +58 -0
- package/build/login/credit.js.map +1 -0
- package/build/login/env/types.d.ts +35 -0
- package/build/login/env/types.d.ts.map +1 -0
- package/build/login/env/types.js +2 -0
- package/build/login/env/types.js.map +1 -0
- package/build/login/env.d.ts +8 -0
- package/build/login/env.d.ts.map +1 -0
- package/build/login/env.js +67 -0
- package/build/login/env.js.map +1 -0
- package/build/login/flow.d.ts +20 -0
- package/build/login/flow.d.ts.map +1 -0
- package/build/login/flow.js +39 -0
- package/build/login/flow.js.map +1 -0
- package/build/login/hook.d.ts +52 -0
- package/build/login/hook.d.ts.map +1 -0
- package/build/login/hook.js +89 -0
- package/build/login/hook.js.map +1 -0
- package/build/login/i18n/be.json +41 -0
- package/build/login/i18n/de.json +41 -0
- package/build/login/i18n/en.json +41 -0
- package/build/login/i18n/es.json +41 -0
- package/build/login/i18n/fr.json +41 -0
- package/build/login/i18n/pl.json +41 -0
- package/build/login/i18n/ru.json +41 -0
- package/build/login/i18n/uk.json +41 -0
- package/build/login/i18n.d.ts +2 -0
- package/build/login/i18n.d.ts.map +1 -0
- package/build/login/i18n.js +27 -0
- package/build/login/i18n.js.map +1 -0
- package/build/login/index.d.ts +27 -0
- package/build/login/index.d.ts.map +1 -0
- package/build/login/index.js +18 -0
- package/build/login/index.js.map +1 -0
- package/build/login/land/types.d.ts +52 -0
- package/build/login/land/types.d.ts.map +1 -0
- package/build/login/land/types.js +2 -0
- package/build/login/land/types.js.map +1 -0
- package/build/login/land.d.ts +6 -0
- package/build/login/land.d.ts.map +1 -0
- package/build/login/land.js +122 -0
- package/build/login/land.js.map +1 -0
- package/build/login/methods/types.d.ts +30 -0
- package/build/login/methods/types.d.ts.map +1 -0
- package/build/login/methods/types.js +2 -0
- package/build/login/methods/types.js.map +1 -0
- package/build/login/methods.d.ts +7 -0
- package/build/login/methods.d.ts.map +1 -0
- package/build/login/methods.js +87 -0
- package/build/login/methods.js.map +1 -0
- package/build/login/resume/types.d.ts +24 -0
- package/build/login/resume/types.d.ts.map +1 -0
- package/build/login/resume/types.js +2 -0
- package/build/login/resume/types.js.map +1 -0
- package/build/login/resume.d.ts +9 -0
- package/build/login/resume.d.ts.map +1 -0
- package/build/login/resume.js +38 -0
- package/build/login/resume.js.map +1 -0
- package/build/login/screen.d.ts +17 -0
- package/build/login/screen.d.ts.map +1 -0
- package/build/login/screen.js +66 -0
- package/build/login/screen.js.map +1 -0
- package/build/login/service.d.ts +31 -0
- package/build/login/service.d.ts.map +1 -0
- package/build/login/service.js +210 -0
- package/build/login/service.js.map +1 -0
- package/build/login/start/types.d.ts +29 -0
- package/build/login/start/types.d.ts.map +1 -0
- package/build/login/start/types.js +2 -0
- package/build/login/start/types.js.map +1 -0
- package/build/login/start.d.ts +5 -0
- package/build/login/start.d.ts.map +1 -0
- package/build/login/start.js +36 -0
- package/build/login/start.js.map +1 -0
- package/build/login/surrogate/types.d.ts +9 -0
- package/build/login/surrogate/types.d.ts.map +1 -0
- package/build/login/surrogate/types.js +2 -0
- package/build/login/surrogate/types.js.map +1 -0
- package/build/login/surrogate.d.ts +13 -0
- package/build/login/surrogate.d.ts.map +1 -0
- package/build/login/surrogate.js +33 -0
- package/build/login/surrogate.js.map +1 -0
- package/build/login/terms/types.d.ts +112 -0
- package/build/login/terms/types.d.ts.map +1 -0
- package/build/login/terms/types.js +2 -0
- package/build/login/terms/types.js.map +1 -0
- package/build/login/terms-config.d.ts +65 -0
- package/build/login/terms-config.d.ts.map +1 -0
- package/build/login/terms-config.js +2 -0
- package/build/login/terms-config.js.map +1 -0
- package/build/login/terms.d.ts +21 -0
- package/build/login/terms.d.ts.map +1 -0
- package/build/login/terms.js +235 -0
- package/build/login/terms.js.map +1 -0
- package/build/login/types.d.ts +313 -0
- package/build/login/types.d.ts.map +1 -0
- package/build/login/types.js +2 -0
- package/build/login/types.js.map +1 -0
- package/build/manager/components/authentication/control.js +3 -3
- package/build/manager/components/authentication/control.js.map +1 -1
- package/build/manager/components/authentication/types.d.ts +2 -2
- package/build/manager/components/authentication/types.d.ts.map +1 -1
- package/build/manager/components/tunnel-consumer.js +2 -2
- package/build/manager/components/tunnel-consumer.js.map +1 -1
- package/build/manager/entrypoints.d.ts +11 -0
- package/build/manager/entrypoints.d.ts.map +1 -0
- package/build/manager/entrypoints.js +17 -0
- package/build/manager/entrypoints.js.map +1 -0
- package/build/manager/plugins/basic-ed25519.d.ts.map +1 -1
- package/build/manager/plugins/basic-ed25519.js +5 -0
- package/build/manager/plugins/basic-ed25519.js.map +1 -1
- package/build/manager/plugins/exports.d.ts +3 -0
- package/build/manager/plugins/exports.d.ts.map +1 -1
- package/build/manager/plugins/exports.js +2 -0
- package/build/manager/plugins/exports.js.map +1 -1
- package/build/manager/plugins/index.d.ts +2 -5
- package/build/manager/plugins/index.d.ts.map +1 -1
- package/build/manager/plugins/index.js +9 -1
- package/build/manager/plugins/index.js.map +1 -1
- package/build/manager/plugins/methods.d.ts +6 -0
- package/build/manager/plugins/methods.d.ts.map +1 -0
- package/build/manager/plugins/methods.js +65 -0
- package/build/manager/plugins/methods.js.map +1 -0
- package/build/manager/plugins/re-captcha.d.ts.map +1 -1
- package/build/manager/plugins/re-captcha.js +5 -0
- package/build/manager/plugins/re-captcha.js.map +1 -1
- package/build/manager/plugins/registry/types.d.ts +10 -0
- package/build/manager/plugins/registry/types.d.ts.map +1 -0
- package/build/manager/plugins/registry/types.js +2 -0
- package/build/manager/plugins/registry/types.js.map +1 -0
- package/build/manager/plugins/registry.d.ts +20 -0
- package/build/manager/plugins/registry.d.ts.map +1 -0
- package/build/manager/plugins/registry.js +23 -0
- package/build/manager/plugins/registry.js.map +1 -0
- package/build/manager/plugins/tunnel-consumer.d.ts.map +1 -1
- package/build/manager/plugins/tunnel-consumer.js +10 -3
- package/build/manager/plugins/tunnel-consumer.js.map +1 -1
- package/build/manager/plugins/types.d.ts +53 -0
- package/build/manager/plugins/types.d.ts.map +1 -1
- package/build/service.js +1 -1
- package/build/service.js.map +1 -1
- package/package.json +39 -29
- package/src/components/dispatcher/component.tsx +37 -14
- package/src/components/dispatcher/types.local.ts +7 -0
- package/src/entrypoints.ts +10 -0
- package/src/helper.ts +31 -5
- package/src/index.ts +1 -1
- package/src/login/adopt/types.ts +25 -0
- package/src/login/adopt.ts +26 -0
- package/src/login/consts.local.ts +34 -0
- package/src/login/consts.ts +124 -0
- package/src/login/credit/types.ts +6 -0
- package/src/login/credit.ts +69 -0
- package/src/login/env/types.ts +35 -0
- package/src/login/env.ts +74 -0
- package/src/login/flow.ts +44 -0
- package/src/login/hook.ts +99 -0
- package/src/login/i18n/be.json +41 -0
- package/src/login/i18n/de.json +41 -0
- package/src/login/i18n/en.json +41 -0
- package/src/login/i18n/es.json +41 -0
- package/src/login/i18n/fr.json +41 -0
- package/src/login/i18n/pl.json +41 -0
- package/src/login/i18n/ru.json +41 -0
- package/src/login/i18n/uk.json +41 -0
- package/src/login/i18n.ts +29 -0
- package/src/login/index.ts +27 -0
- package/src/login/land/types.ts +54 -0
- package/src/login/land.ts +149 -0
- package/src/login/methods/types.ts +32 -0
- package/src/login/methods.ts +109 -0
- package/src/login/resume/types.ts +24 -0
- package/src/login/resume.ts +45 -0
- package/src/login/screen.tsx +140 -0
- package/src/login/service.ts +271 -0
- package/src/login/start/types.ts +30 -0
- package/src/login/start.ts +44 -0
- package/src/login/surrogate/types.ts +9 -0
- package/src/login/surrogate.ts +37 -0
- package/src/login/terms/types.ts +126 -0
- package/src/login/terms-config.ts +55 -0
- package/src/login/terms.ts +315 -0
- package/src/login/types.ts +335 -0
- package/src/manager/README.md +37 -80
- package/src/manager/components/authentication/control.ts +3 -3
- package/src/manager/components/authentication/types.ts +2 -2
- package/src/manager/components/tunnel-consumer.tsx +2 -2
- package/src/manager/entrypoints.ts +18 -0
- package/src/manager/plugins/basic-ed25519.tsx +7 -0
- package/src/manager/plugins/exports.ts +3 -0
- package/src/manager/plugins/index.ts +11 -4
- package/src/manager/plugins/methods.ts +74 -0
- package/src/manager/plugins/re-captcha.tsx +7 -0
- package/src/manager/plugins/registry/types.ts +10 -0
- package/src/manager/plugins/registry.ts +33 -0
- package/src/manager/plugins/tunnel-consumer.tsx +12 -3
- package/src/manager/plugins/types.ts +54 -0
- package/src/service.ts +1 -1
- package/tests/context.ts +1 -2
- package/tests/i18n.spec.ts +68 -0
- package/tests/land.spec.ts +292 -0
- package/tests/login.spec.ts +332 -0
- package/tests/target.spec.ts +210 -0
- package/tests/terms-deferred.spec.ts +65 -0
- package/tests/terms.spec.ts +314 -0
- package/build/.gitkeep +0 -0
- package/build/manager/modules.d.ts +0 -2
- package/build/manager/modules.d.ts.map +0 -1
- package/build/manager/modules.js +0 -16
- package/build/manager/modules.js.map +0 -1
- package/build/modules.d.ts +0 -4
- package/build/modules.d.ts.map +0 -1
- package/build/modules.js +0 -9
- package/build/modules.js.map +0 -1
- package/src/manager/modules.ts +0 -18
- package/src/modules.ts +0 -13
|
@@ -7,22 +7,42 @@ import { useNavigate } from '@owlmeans/client';
|
|
|
7
7
|
import { DEFAULT_ALIAS as FLOW_SERVICE } from '@owlmeans/client-flow';
|
|
8
8
|
import { FLOW_PLACEHOLDER, OidcAuthStep, STD_OIDC_FLOW } from '@owlmeans/flow';
|
|
9
9
|
import { SERVICE_PARAM } from '@owlmeans/web-flow';
|
|
10
|
+
import { loginLandingOf } from '../../login/land.js';
|
|
11
|
+
import { logger } from '@owlmeans/log';
|
|
12
|
+
const log = logger('client-auth:dispatcher');
|
|
10
13
|
export const DispatcherHOC = Renderer => ({ context, params, alias, query, payload }) => {
|
|
11
14
|
const [forwarding, setForwarding] = useState();
|
|
12
15
|
const navigator = useNavigate();
|
|
13
16
|
const navigate = useCallback(async () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
if (alias == null || alias === DISPATCHER) {
|
|
18
|
+
// A sign-in that started elsewhere — a device or authorization-code consent screen, most
|
|
19
|
+
// commonly — suspended itself here before leaving, or a registered step still has
|
|
20
|
+
// something to collect (a marketing-consent screen, say). `landAfterLogin` is the whole
|
|
21
|
+
// post-sign-in landing decision (steps, landing hooks, the suspended flow, then HOME) and
|
|
22
|
+
// takes priority over the ordinary HOME landing, resolved BEFORE `alias` is overwritten,
|
|
23
|
+
// because once it is `HOME` there is no way back to tell the cases apart.
|
|
24
|
+
const landing = await loginLandingOf(context).landAfterLogin();
|
|
25
|
+
if (landing.alias !== HOME) {
|
|
26
|
+
await navigator.navigate(context.entrypoint(landing.alias), { params: landing.params, query: landing.query });
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
alias = HOME;
|
|
19
30
|
}
|
|
20
31
|
else {
|
|
32
|
+
// A concrete destination already exists (an OIDC `?code=` return, etc.) — a registered step
|
|
33
|
+
// still gets to interject, but `resumeSuspendedFlow` must not run a second time: this
|
|
34
|
+
// branch already has somewhere to go.
|
|
21
35
|
query = { ...forwarding?.query, ...query };
|
|
22
36
|
if (query != null && AUTH_QUERY in query) {
|
|
23
37
|
delete query[AUTH_QUERY];
|
|
24
38
|
}
|
|
39
|
+
const landing = await loginLandingOf(context).landAfterLogin({ fallback: { alias, params, query }, resume: false });
|
|
40
|
+
await navigator.navigate(context.entrypoint(landing.alias), { params: landing.params, query: landing.query });
|
|
41
|
+
return;
|
|
25
42
|
}
|
|
43
|
+
const module = context.entrypoint(alias);
|
|
44
|
+
params = {};
|
|
45
|
+
query = {};
|
|
26
46
|
await navigator.navigate(module, { params, query });
|
|
27
47
|
}, [forwarding]);
|
|
28
48
|
useEffect(() => {
|
|
@@ -71,7 +91,7 @@ export const DispatcherHOC = Renderer => ({ context, params, alias, query, paylo
|
|
|
71
91
|
return await navigate();
|
|
72
92
|
}).catch((e) => {
|
|
73
93
|
// @TODO Show error on the component
|
|
74
|
-
|
|
94
|
+
log.error('Authentication failed', e, { event: 'auth.refused' });
|
|
75
95
|
});
|
|
76
96
|
}
|
|
77
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAoB,aAAa,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACvF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,MAAM,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAmB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IACtG,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,EAA0B,CAAA;IAEtE,MAAM,SAAS,GAAG,WAAW,EAAE,CAAA;IAC/B,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACtC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;YAC1C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aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACjC,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,KAAC,QAAQ,IAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAA;AACrE,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.local.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/types.local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAA;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.local.js","sourceRoot":"","sources":["../../../src/components/dispatcher/types.local.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Browser entrypoints for the authentication protocols every client may call. */
|
|
2
|
+
export declare const entrypoints: import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
|
|
3
|
+
body: import("@owlmeans/auth").AuthToken;
|
|
4
|
+
}, import("@owlmeans/auth").AuthToken>>[];
|
|
5
|
+
/** Bind the external-authentication screen to one explicitly selected service. */
|
|
6
|
+
export declare const bindExternalAuthentication: (service: string) => import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<import("@owlmeans/entrypoint").OpenRequest, import("@owlmeans/entrypoint").OpenValue>>;
|
|
7
|
+
//# sourceMappingURL=entrypoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,kFAAkF;AAClF,eAAO,MAAM,WAAW;;yCAA+C,CAAA;AAEvE,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,YAAa,MAAM,4MAC+B,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { bind, bindScreen, stab } from '@owlmeans/client-entrypoint';
|
|
2
|
+
import { authProtocols } from '@owlmeans/auth-common';
|
|
3
|
+
/** Browser entrypoints for the authentication protocols every client may call. */
|
|
4
|
+
export const entrypoints = [bind(authProtocols.dispatcherAuthenticate)];
|
|
5
|
+
/** Bind the external-authentication screen to one explicitly selected service. */
|
|
6
|
+
export const bindExternalAuthentication = (service) => bindScreen(authProtocols.flowEnter, stab, { routeOptions: { overrides: { service } } });
|
|
7
|
+
//# sourceMappingURL=entrypoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,CAAA;AAEvE,kFAAkF;AAClF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAe,EAAE,EAAE,CAC5D,UAAU,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA"}
|
package/build/helper.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ClientEntrypoint } from '@owlmeans/client-entrypoint';
|
|
2
|
+
import type { WsOptions } from '@owlmeans/client-socket';
|
|
2
3
|
import type { AbstractRequest } from '@owlmeans/entrypoint';
|
|
3
|
-
export declare const useWs: (module: string | ClientEntrypoint<any>, _request?: Partial<AbstractRequest<any
|
|
4
|
+
export declare const useWs: (module: string | ClientEntrypoint<any>, _request?: Partial<AbstractRequest<any>>, options?: WsOptions) => import("@owlmeans/socket").Connection | null;
|
|
4
5
|
export declare const useSelfAuth: (force?: boolean) => boolean;
|
|
5
6
|
//# sourceMappingURL=helper.d.ts.map
|
package/build/helper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAa3D,eAAO,MAAM,KAAK,WACR,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,aAAa,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,YAAY,SAAS,iDAiDtG,CAAA;AAED,eAAO,MAAM,WAAW,WAAW,OAAO,YAoBzC,CAAA"}
|
package/build/helper.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { useContext, useNavigate } from '@owlmeans/client';
|
|
2
|
-
import { provideRequest } from '@owlmeans/client-entrypoint';
|
|
3
2
|
import { useWs as useWebSocket } from '@owlmeans/client-socket';
|
|
4
3
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
4
|
import { AUTH_QUERY, DISPATCHER } from '@owlmeans/auth';
|
|
5
|
+
import { logger } from '@owlmeans/log';
|
|
6
|
+
import { clientRequestHelper } from '@owlmeans/client-entrypoint';
|
|
7
|
+
const log = logger('client-auth');
|
|
6
8
|
// import { useFlow } from '@owlmeans/web-flow'
|
|
7
9
|
// import { DEFAULT_ENTITY } from './consts.js'
|
|
8
10
|
// import { OidcAuthStep } from '@owlmeans/flow'
|
|
9
|
-
export const useWs = (module, _request) => {
|
|
11
|
+
export const useWs = (module, _request, options) => {
|
|
10
12
|
const ctx = useContext();
|
|
11
13
|
const mod = useMemo(() => typeof module === 'string' ? ctx.entrypoint(module) : module, [module]);
|
|
14
|
+
// Captured before the token is filled in below, so a caller who supplied their own token
|
|
15
|
+
// keeps full control of it across a reconnect too — `beforeConnect` only refreshes ours.
|
|
16
|
+
const callerSuppliedToken = _request?.query?.[AUTH_QUERY] != null;
|
|
12
17
|
const request = useMemo(() => {
|
|
13
18
|
if (_request == null) {
|
|
14
|
-
_request = provideRequest(mod.
|
|
19
|
+
_request = clientRequestHelper.provideRequest(mod.alias, mod.path());
|
|
15
20
|
}
|
|
16
21
|
try {
|
|
17
22
|
if (_request?.query?.[AUTH_QUERY] == null) {
|
|
@@ -22,11 +27,29 @@ export const useWs = (module, _request) => {
|
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
catch (e) {
|
|
25
|
-
|
|
30
|
+
log.warn('Socket auth token not attached', e);
|
|
26
31
|
}
|
|
27
32
|
return _request;
|
|
28
33
|
}, [_request]);
|
|
29
|
-
|
|
34
|
+
const wsOptions = useMemo(() => ({
|
|
35
|
+
...options,
|
|
36
|
+
beforeConnect: async (req) => {
|
|
37
|
+
// A reconnect can land minutes after the socket first opened — refresh the bearer token
|
|
38
|
+
// on every attempt rather than trust the one `request` was built with, or a token rotated
|
|
39
|
+
// in between reopens the socket with a stale one the guard then rejects.
|
|
40
|
+
if (!callerSuppliedToken) {
|
|
41
|
+
try {
|
|
42
|
+
req.query ??= {};
|
|
43
|
+
req.query[AUTH_QUERY] = ctx.auth().token;
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
log.warn('Socket auth token not refreshed', e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
await options?.beforeConnect?.(req);
|
|
50
|
+
}
|
|
51
|
+
}), [options, callerSuppliedToken]);
|
|
52
|
+
return useWebSocket(module, request, wsOptions);
|
|
30
53
|
};
|
|
31
54
|
export const useSelfAuth = (force = true /*, entity: string = DEFAULT_ENTITY*/) => {
|
|
32
55
|
const context = useContext();
|
package/build/helper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAI/D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AACjC,+CAA+C;AAC/C,+CAA+C;AAC/C,gDAAgD;AAEhD,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,MAAsC,EAAE,QAAwC,EAAE,OAAmB,EACrG,EAAE;IACF,MAAM,GAAG,GAAG,UAAU,EAAkD,CAAA;IAExE,MAAM,GAAG,GAAG,OAAO,CACjB,GAAG,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAmB,MAAM,CAAC,CA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AE,CAAC,KAAK,CAAA;gBAC1C,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,GAAG,CAAC,IAAI,CAAC,iCAAiC,EAAE,CAAC,CAAC,CAAA;gBAChD,CAAC;YACH,CAAC;YACD,MAAM,OAAO,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAAA;QACrC,CAAC;KACF,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAA;IAEnC,OAAO,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAA;AACjD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAK,GAAY,IAAI,CAAA,qCAAqC,EAAE,EAAE;IACxF,MAAM,OAAO,GAAG,UAAU,EAAkD,CAAA;IAC5E,sEAAsE;IACtE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACzD,MAAM,GAAG,GAAG,WAAW,EAAE,CAAA;IAEzB,SAAS,CAAC,GAAG,EAAE;QACb,2BAA2B;QAC3B,OAAO,CAAC,IAAI,EAAE,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,KAAK,EAAC,IAAI,EAAC,EAAE;YAC/C,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;gBACnB,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,CAAA;gBAClB,6BAA6B;gBAC7B,qEAAqE;YACvE,CAAC;YAED,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA"}
|
package/build/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export * from './components/index.js';
|
|
|
2
2
|
export type * from './types.js';
|
|
3
3
|
export * from './service.js';
|
|
4
4
|
export * from './consts.js';
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './entrypoints.js';
|
|
6
6
|
export * from './helper.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AACrC,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AACrC,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AAErC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AAErC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** The two paths a context's authentication changes by: a token adopted, a token dropped. */
|
|
2
|
+
export interface LoginTokenHelper {
|
|
3
|
+
/**
|
|
4
|
+
* The one path an issued bearer token becomes this context's authentication.
|
|
5
|
+
*
|
|
6
|
+
* Resolved by alias rather than through `ctx.auth()` so the login host does not require
|
|
7
|
+
* `AuthServiceAppend` on the context it is given — a plugin can adopt a token on any context that
|
|
8
|
+
* carries the auth service, including one it did not build.
|
|
9
|
+
*
|
|
10
|
+
* Going through `AuthService.update` matters: it stores the record, decodes the envelope and sets
|
|
11
|
+
* both `auth` and `token` in one place. Writing those three by hand — which is what the popup and
|
|
12
|
+
* the MUI relying party each used to do — leaves the same state on a good day and diverges the
|
|
13
|
+
* moment any of it changes.
|
|
14
|
+
*/
|
|
15
|
+
adoptToken: (token: string) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* The one path this context's authentication is dropped, and the exact mirror of {@link adoptToken}.
|
|
18
|
+
*
|
|
19
|
+
* `undefined`, not `null`: `undefined` is the declared clearing value, and on the web the auth
|
|
20
|
+
* service reacts to it by navigating to the dispatcher. Everything that signs a user out goes
|
|
21
|
+
* through here — the hook, both browser plugins and the surrogate screen — so there is one place
|
|
22
|
+
* where "signed out" is defined rather than four that agree until one of them changes.
|
|
23
|
+
*/
|
|
24
|
+
revokeToken: () => Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/adopt/types.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;OAWG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/login/adopt/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LoginContext } from './types.js';
|
|
2
|
+
import type { LoginTokenHelper } from './adopt/types.js';
|
|
3
|
+
export declare const makeLoginTokenHelper: (ctx: LoginContext) => LoginTokenHelper;
|
|
4
|
+
/** The token helper of a context — one per context. */
|
|
5
|
+
export declare const loginTokenOf: (target: LoginContext) => LoginTokenHelper;
|
|
6
|
+
/** @deprecated compat:factory-refactor — use `loginTokenOf(ctx).adoptToken(…)` */
|
|
7
|
+
export declare const adoptToken: (ctx: LoginContext, token: string) => Promise<void>;
|
|
8
|
+
/** @deprecated compat:factory-refactor — use `loginTokenOf(ctx).revokeToken()` */
|
|
9
|
+
export declare const revokeToken: (ctx: LoginContext) => Promise<void>;
|
|
10
|
+
//# sourceMappingURL=adopt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt.d.ts","sourceRoot":"","sources":["../../src/login/adopt.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD,eAAO,MAAM,oBAAoB,QAAS,YAAY,KAAG,gBAUxD,CAAA;AAED,uDAAuD;AACvD,eAAO,MAAM,YAAY,4CAA2C,CAAA;AAEpE,kFAAkF;AAClF,eAAO,MAAM,UAAU,QAAe,YAAY,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAAwC,CAAA;AAExH,kFAAkF;AAClF,eAAO,MAAM,WAAW,QAAe,YAAY,KAAG,OAAO,CAAC,IAAI,CAAoC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { memoHelper } from '@owlmeans/context';
|
|
2
|
+
import { DEFAULT_ALIAS as AUTH_ALIAS } from '../consts.js';
|
|
3
|
+
export const makeLoginTokenHelper = (ctx) => {
|
|
4
|
+
const adoptToken = async (token) => {
|
|
5
|
+
await ctx.service(AUTH_ALIAS).update(token);
|
|
6
|
+
};
|
|
7
|
+
const revokeToken = async () => {
|
|
8
|
+
await ctx.service(AUTH_ALIAS).update(undefined);
|
|
9
|
+
};
|
|
10
|
+
return { adoptToken, revokeToken };
|
|
11
|
+
};
|
|
12
|
+
/** The token helper of a context — one per context. */
|
|
13
|
+
export const loginTokenOf = memoHelper.oncePer(makeLoginTokenHelper);
|
|
14
|
+
/** @deprecated compat:factory-refactor — use `loginTokenOf(ctx).adoptToken(…)` */
|
|
15
|
+
export const adoptToken = async (ctx, token) => loginTokenOf(ctx).adoptToken(token);
|
|
16
|
+
/** @deprecated compat:factory-refactor — use `loginTokenOf(ctx).revokeToken()` */
|
|
17
|
+
export const revokeToken = async (ctx) => loginTokenOf(ctx).revokeToken();
|
|
18
|
+
//# sourceMappingURL=adopt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../src/login/adopt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AAI1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAiB,EAAoB,EAAE;IAC1E,MAAM,UAAU,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;QACxD,MAAM,GAAG,CAAC,OAAO,CAAc,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC1D,CAAC,CAAA;IAED,MAAM,WAAW,GAAG,KAAK,IAAmB,EAAE;QAC5C,MAAM,GAAG,CAAC,OAAO,CAAc,UAAU,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC9D,CAAC,CAAA;IAED,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAA;AACpC,CAAC,CAAA;AAED,uDAAuD;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAEpE,kFAAkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,GAAiB,EAAE,KAAa,EAAiB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;AAExH,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,GAAiB,EAAiB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export declare const DEFAULT_ALIAS = "login-service";
|
|
2
|
+
export declare const LOGIN_SERVICE = "login-service";
|
|
3
|
+
/** Priority of a plugin that makes no claim about the environment. */
|
|
4
|
+
export declare const DEFAULT_LOGIN_PRIORITY = 0;
|
|
5
|
+
/** Order given to a method that declares none. */
|
|
6
|
+
export declare const DEFAULT_METHOD_ORDER = 100;
|
|
7
|
+
/**
|
|
8
|
+
* Name given to the surrogate login window, the marker it records about itself, and the values the
|
|
9
|
+
* two documents exchange.
|
|
10
|
+
*
|
|
11
|
+
* These are a wire protocol between two documents that may be running different builds — an opener
|
|
12
|
+
* holding an older bundle and a surrogate freshly loaded, or the reverse. They are therefore fixed,
|
|
13
|
+
* and must never be "tidied" to match a newer vocabulary. That applies to the query names and the
|
|
14
|
+
* message types added later just as much as to the original three.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LOGIN_SURROGATE_NAME = "owlmeans-oidc-login";
|
|
17
|
+
export declare const LOGIN_TOKEN_MESSAGE = "owlmeans:oidc:popup-token";
|
|
18
|
+
export declare const LOGIN_LOGOUT_MESSAGE = "owlmeans:oidc:popup-logout";
|
|
19
|
+
export declare const LOGIN_SURROGATE_MARKER = "_owlmeans-oidc-popup";
|
|
20
|
+
export declare const LOGIN_SURROGATE_WIDTH = 520;
|
|
21
|
+
export declare const LOGIN_SURROGATE_HEIGHT = 760;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Never centered the window — it carried no `left`/`top`, so the surrogate always
|
|
24
|
+
* opened wherever the browser's own default popup placement put it. Superseded by
|
|
25
|
+
* `@owlmeans/web-client`'s `centeredPopupFeatures(LOGIN_SURROGATE_WIDTH, LOGIN_SURROGATE_HEIGHT)`,
|
|
26
|
+
* computed fresh per call since centering depends on where the browser window currently sits.
|
|
27
|
+
* Kept, unchanged, for the same reason as the rest of this block: an already-generated app may
|
|
28
|
+
* carry a copy of code that still imports it.
|
|
29
|
+
*/
|
|
30
|
+
export declare const LOGIN_SURROGATE_FEATURES = "popup=yes,width=520,height=760";
|
|
31
|
+
/** How often a surrogate window is checked for having been closed by the user. */
|
|
32
|
+
export declare const LOGIN_WATCH_INTERVAL = 500;
|
|
33
|
+
/** Carries WHY the surrogate window was opened across the window boundary. */
|
|
34
|
+
export declare const LOGIN_INTENT_QUERY = "intent";
|
|
35
|
+
/**
|
|
36
|
+
* Carries the address the surrogate should run, so the flow parameters the opener's URL held are
|
|
37
|
+
* forwarded rather than discarded.
|
|
38
|
+
*/
|
|
39
|
+
export declare const LOGIN_NEXT_QUERY = "next";
|
|
40
|
+
/**
|
|
41
|
+
* Carries the method the user already chose, one window up.
|
|
42
|
+
*
|
|
43
|
+
* A surrogate acting on it is not an auto-redirect in the "never choose for the user" sense: the
|
|
44
|
+
* choice was made, by a person, in the document that opened this one.
|
|
45
|
+
*/
|
|
46
|
+
export declare const LOGIN_METHOD_QUERY = "method";
|
|
47
|
+
/** Where a browser records that it agreed to one exact set of legal documents. */
|
|
48
|
+
export declare const LOGIN_TERMS_STORAGE = "_owlmeans-login-terms";
|
|
49
|
+
/**
|
|
50
|
+
* Bound on a single step's `pending` check, or a landing hook's `landed` call.
|
|
51
|
+
*
|
|
52
|
+
* A step/hook that hangs must never HANG sign-in itself — both `continueLogin` and
|
|
53
|
+
* `landAfterLogin` treat a timeout exactly like a rejection, resolving within this budget either
|
|
54
|
+
* way. What that resolves TO is fail-open ("not pending") for an ordinary step, and fail-closed
|
|
55
|
+
* ("pending") for one that declared itself `required` — see `continueLogin`'s `onBroken`.
|
|
56
|
+
*/
|
|
57
|
+
export declare const LOGIN_STEP_TIMEOUT = 5000;
|
|
58
|
+
/** Where a browser records the last token a landing hook has already run for. */
|
|
59
|
+
export declare const LOGIN_LANDED_STORAGE = "_owlmeans-login-landed";
|
|
60
|
+
/** What a dispatcher does once `login().resume(...)` has answered. */
|
|
61
|
+
export declare enum ResumeAction {
|
|
62
|
+
/** The plugin took it over — the browser is leaving, or the window is closing. */
|
|
63
|
+
Stop = "stop",
|
|
64
|
+
/** Render the outcome to the user; there is nothing further to do automatically. */
|
|
65
|
+
Render = "render",
|
|
66
|
+
/** Ordinary tab: keep the session and carry on to the application. */
|
|
67
|
+
Navigate = "navigate"
|
|
68
|
+
}
|
|
69
|
+
/** What a stage did, and therefore what the caller must do next. */
|
|
70
|
+
export declare enum LoginOutcome {
|
|
71
|
+
/** The plugin took the flow over and it is finished. The caller does nothing more. */
|
|
72
|
+
Handled = "handled",
|
|
73
|
+
/** The plugin did nothing — the caller carries on with its ordinary continuation. */
|
|
74
|
+
Passed = "passed",
|
|
75
|
+
/** The browser is leaving this document. The caller must not navigate or render. */
|
|
76
|
+
Redirected = "redirected",
|
|
77
|
+
/** Cannot proceed without a fresh user gesture — the caller renders a sign-in control. */
|
|
78
|
+
Gesture = "gesture",
|
|
79
|
+
/** Authenticated, but with no channel back to the window that started it. */
|
|
80
|
+
Orphaned = "orphaned",
|
|
81
|
+
/** The attempt ended with no token (the user closed the window, or the provider refused it). */
|
|
82
|
+
Failed = "failed",
|
|
83
|
+
/**
|
|
84
|
+
* A window this flow needed could not be opened at all — `window.open` returned `null`, which is
|
|
85
|
+
* the browser's own popup blocker, not a flow failure. Distinct from {@link Failed}: a caller
|
|
86
|
+
* with nowhere inline to render (a header "Log in"/"Log out" control, not the sign-in screen)
|
|
87
|
+
* needs to know specifically that a fresh click reopening the SAME control will not help, and
|
|
88
|
+
* that the browser is already showing its own blocked-popup affordance somewhere.
|
|
89
|
+
*/
|
|
90
|
+
Blocked = "blocked"
|
|
91
|
+
}
|
|
92
|
+
/** Why a surrogate window was opened. */
|
|
93
|
+
export declare enum LoginIntent {
|
|
94
|
+
Login = "login",
|
|
95
|
+
Logout = "logout"
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* How long a sign-in aimed at a screen (`LoginRequest.target`) keeps that screen parked: long
|
|
99
|
+
* enough for a sign-in with an emailed code, short enough that a tab abandoned mid-way never lands
|
|
100
|
+
* a later, unrelated sign-in on it.
|
|
101
|
+
*/
|
|
102
|
+
export declare const LOGIN_TARGET_TTL: number;
|
|
103
|
+
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/login/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,kBAAkB,CAAA;AAE5C,eAAO,MAAM,aAAa,kBAAgB,CAAA;AAE1C,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC,kDAAkD;AAClD,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAEvC;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,wBAAwB,CAAA;AAEzD,eAAO,MAAM,mBAAmB,8BAA8B,CAAA;AAE9D,eAAO,MAAM,oBAAoB,+BAA+B,CAAA;AAEhE,eAAO,MAAM,sBAAsB,yBAAyB,CAAA;AAE5D,eAAO,MAAM,qBAAqB,MAAM,CAAA;AAExC,eAAO,MAAM,sBAAsB,MAAM,CAAA;AAEzC;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,mCACwC,CAAA;AAE7E,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAEvC,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,WAAW,CAAA;AAE1C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SAAS,CAAA;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,WAAW,CAAA;AAE1C,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,0BAA0B,CAAA;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,OAAQ,CAAA;AAEvC,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,2BAA2B,CAAA;AAE5D,sEAAsE;AACtE,oBAAY,YAAY;IACtB,kFAAkF;IAClF,IAAI,SAAS;IACb,oFAAoF;IACpF,MAAM,WAAW;IACjB,sEAAsE;IACtE,QAAQ,aAAa;CACtB;AAED,oEAAoE;AACpE,oBAAY,YAAY;IACtB,sFAAsF;IACtF,OAAO,YAAY;IACnB,qFAAqF;IACrF,MAAM,WAAW;IACjB,oFAAoF;IACpF,UAAU,eAAe;IACzB,0FAA0F;IAC1F,OAAO,YAAY;IACnB,6EAA6E;IAC7E,QAAQ,aAAa;IACrB,gGAAgG;IAChG,MAAM,WAAW;IACjB;;;;;;OAMG;IACH,OAAO,YAAY;CACpB;AAED,yCAAyC;AACzC,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAiB,CAAA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export const DEFAULT_ALIAS = 'login-service';
|
|
2
|
+
export const LOGIN_SERVICE = DEFAULT_ALIAS;
|
|
3
|
+
/** Priority of a plugin that makes no claim about the environment. */
|
|
4
|
+
export const DEFAULT_LOGIN_PRIORITY = 0;
|
|
5
|
+
/** Order given to a method that declares none. */
|
|
6
|
+
export const DEFAULT_METHOD_ORDER = 100;
|
|
7
|
+
/**
|
|
8
|
+
* Name given to the surrogate login window, the marker it records about itself, and the values the
|
|
9
|
+
* two documents exchange.
|
|
10
|
+
*
|
|
11
|
+
* These are a wire protocol between two documents that may be running different builds — an opener
|
|
12
|
+
* holding an older bundle and a surrogate freshly loaded, or the reverse. They are therefore fixed,
|
|
13
|
+
* and must never be "tidied" to match a newer vocabulary. That applies to the query names and the
|
|
14
|
+
* message types added later just as much as to the original three.
|
|
15
|
+
*/
|
|
16
|
+
export const LOGIN_SURROGATE_NAME = 'owlmeans-oidc-login';
|
|
17
|
+
export const LOGIN_TOKEN_MESSAGE = 'owlmeans:oidc:popup-token';
|
|
18
|
+
export const LOGIN_LOGOUT_MESSAGE = 'owlmeans:oidc:popup-logout';
|
|
19
|
+
export const LOGIN_SURROGATE_MARKER = '_owlmeans-oidc-popup';
|
|
20
|
+
export const LOGIN_SURROGATE_WIDTH = 520;
|
|
21
|
+
export const LOGIN_SURROGATE_HEIGHT = 760;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Never centered the window — it carried no `left`/`top`, so the surrogate always
|
|
24
|
+
* opened wherever the browser's own default popup placement put it. Superseded by
|
|
25
|
+
* `@owlmeans/web-client`'s `centeredPopupFeatures(LOGIN_SURROGATE_WIDTH, LOGIN_SURROGATE_HEIGHT)`,
|
|
26
|
+
* computed fresh per call since centering depends on where the browser window currently sits.
|
|
27
|
+
* Kept, unchanged, for the same reason as the rest of this block: an already-generated app may
|
|
28
|
+
* carry a copy of code that still imports it.
|
|
29
|
+
*/
|
|
30
|
+
export const LOGIN_SURROGATE_FEATURES = `popup=yes,width=${LOGIN_SURROGATE_WIDTH},height=${LOGIN_SURROGATE_HEIGHT}`;
|
|
31
|
+
/** How often a surrogate window is checked for having been closed by the user. */
|
|
32
|
+
export const LOGIN_WATCH_INTERVAL = 500;
|
|
33
|
+
/** Carries WHY the surrogate window was opened across the window boundary. */
|
|
34
|
+
export const LOGIN_INTENT_QUERY = 'intent';
|
|
35
|
+
/**
|
|
36
|
+
* Carries the address the surrogate should run, so the flow parameters the opener's URL held are
|
|
37
|
+
* forwarded rather than discarded.
|
|
38
|
+
*/
|
|
39
|
+
export const LOGIN_NEXT_QUERY = 'next';
|
|
40
|
+
/**
|
|
41
|
+
* Carries the method the user already chose, one window up.
|
|
42
|
+
*
|
|
43
|
+
* A surrogate acting on it is not an auto-redirect in the "never choose for the user" sense: the
|
|
44
|
+
* choice was made, by a person, in the document that opened this one.
|
|
45
|
+
*/
|
|
46
|
+
export const LOGIN_METHOD_QUERY = 'method';
|
|
47
|
+
/** Where a browser records that it agreed to one exact set of legal documents. */
|
|
48
|
+
export const LOGIN_TERMS_STORAGE = '_owlmeans-login-terms';
|
|
49
|
+
/**
|
|
50
|
+
* Bound on a single step's `pending` check, or a landing hook's `landed` call.
|
|
51
|
+
*
|
|
52
|
+
* A step/hook that hangs must never HANG sign-in itself — both `continueLogin` and
|
|
53
|
+
* `landAfterLogin` treat a timeout exactly like a rejection, resolving within this budget either
|
|
54
|
+
* way. What that resolves TO is fail-open ("not pending") for an ordinary step, and fail-closed
|
|
55
|
+
* ("pending") for one that declared itself `required` — see `continueLogin`'s `onBroken`.
|
|
56
|
+
*/
|
|
57
|
+
export const LOGIN_STEP_TIMEOUT = 5_000;
|
|
58
|
+
/** Where a browser records the last token a landing hook has already run for. */
|
|
59
|
+
export const LOGIN_LANDED_STORAGE = '_owlmeans-login-landed';
|
|
60
|
+
/** What a dispatcher does once `login().resume(...)` has answered. */
|
|
61
|
+
export var ResumeAction;
|
|
62
|
+
(function (ResumeAction) {
|
|
63
|
+
/** The plugin took it over — the browser is leaving, or the window is closing. */
|
|
64
|
+
ResumeAction["Stop"] = "stop";
|
|
65
|
+
/** Render the outcome to the user; there is nothing further to do automatically. */
|
|
66
|
+
ResumeAction["Render"] = "render";
|
|
67
|
+
/** Ordinary tab: keep the session and carry on to the application. */
|
|
68
|
+
ResumeAction["Navigate"] = "navigate";
|
|
69
|
+
})(ResumeAction || (ResumeAction = {}));
|
|
70
|
+
/** What a stage did, and therefore what the caller must do next. */
|
|
71
|
+
export var LoginOutcome;
|
|
72
|
+
(function (LoginOutcome) {
|
|
73
|
+
/** The plugin took the flow over and it is finished. The caller does nothing more. */
|
|
74
|
+
LoginOutcome["Handled"] = "handled";
|
|
75
|
+
/** The plugin did nothing — the caller carries on with its ordinary continuation. */
|
|
76
|
+
LoginOutcome["Passed"] = "passed";
|
|
77
|
+
/** The browser is leaving this document. The caller must not navigate or render. */
|
|
78
|
+
LoginOutcome["Redirected"] = "redirected";
|
|
79
|
+
/** Cannot proceed without a fresh user gesture — the caller renders a sign-in control. */
|
|
80
|
+
LoginOutcome["Gesture"] = "gesture";
|
|
81
|
+
/** Authenticated, but with no channel back to the window that started it. */
|
|
82
|
+
LoginOutcome["Orphaned"] = "orphaned";
|
|
83
|
+
/** The attempt ended with no token (the user closed the window, or the provider refused it). */
|
|
84
|
+
LoginOutcome["Failed"] = "failed";
|
|
85
|
+
/**
|
|
86
|
+
* A window this flow needed could not be opened at all — `window.open` returned `null`, which is
|
|
87
|
+
* the browser's own popup blocker, not a flow failure. Distinct from {@link Failed}: a caller
|
|
88
|
+
* with nowhere inline to render (a header "Log in"/"Log out" control, not the sign-in screen)
|
|
89
|
+
* needs to know specifically that a fresh click reopening the SAME control will not help, and
|
|
90
|
+
* that the browser is already showing its own blocked-popup affordance somewhere.
|
|
91
|
+
*/
|
|
92
|
+
LoginOutcome["Blocked"] = "blocked";
|
|
93
|
+
})(LoginOutcome || (LoginOutcome = {}));
|
|
94
|
+
/** Why a surrogate window was opened. */
|
|
95
|
+
export var LoginIntent;
|
|
96
|
+
(function (LoginIntent) {
|
|
97
|
+
LoginIntent["Login"] = "login";
|
|
98
|
+
LoginIntent["Logout"] = "logout";
|
|
99
|
+
})(LoginIntent || (LoginIntent = {}));
|
|
100
|
+
/**
|
|
101
|
+
* How long a sign-in aimed at a screen (`LoginRequest.target`) keeps that screen parked: long
|
|
102
|
+
* enough for a sign-in with an emailed code, short enough that a tab abandoned mid-way never lands
|
|
103
|
+
* a later, unrelated sign-in on it.
|
|
104
|
+
*/
|
|
105
|
+
export const LOGIN_TARGET_TTL = 30 * 60 * 1000;
|
|
106
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/login/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA;AAE1C,sEAAsE;AACtE,MAAM,CAAC,MAA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;AACpE,MAAM,CAAN,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,sFAAsF;IACtF,mCAAmB,CAAA;IACnB,qFAAqF;IACrF,iCAAiB,CAAA;IACjB,oFAAoF;IACpF,yCAAyB,CAAA;IACzB,0FAA0F;IAC1F,mCAAmB,CAAA;IACnB,6EAA6E;IAC7E,qCAAqB,CAAA;IACrB,gGAAgG;IAChG,iCAAiB,CAAA;IACjB;;;;;;OAMG;IACH,mCAAmB,CAAA;AACrB,CAAC,EArBW,YAAY,KAAZ,YAAY,QAqBvB;AAED,yCAAyC;AACzC,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LoginOutcome } from './consts.js';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* The page the card sits in.
|
|
5
|
+
*
|
|
6
|
+
* It carries its own viewport height because this screen is rendered straight out of the
|
|
7
|
+
* dispatcher, into whatever the application happens to have around it — which is usually nothing
|
|
8
|
+
* with a height, so a percentage minimum would resolve to zero and leave the card at the top.
|
|
9
|
+
*/
|
|
10
|
+
export declare const page: CSSProperties;
|
|
11
|
+
export declare const box: CSSProperties;
|
|
12
|
+
/** The same English fallback a document's `i18nKey` translates to when nothing else names it. */
|
|
13
|
+
export declare const DEFAULT_LABEL: Record<string, string>;
|
|
14
|
+
/** Outcomes after which nobody was signed in, so a screen parked for the landing must not wait. */
|
|
15
|
+
export declare const UNSIGNED_OUTCOMES: ReadonlySet<LoginOutcome>;
|
|
16
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/login/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,aAIlB,CAAA;AAGD,eAAO,MAAM,GAAG,EAAE,aAEjB,CAAA;AAED,iGAAiG;AACjG,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMhD,CAAA;AAED,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAEtD,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LoginOutcome } from './consts.js';
|
|
2
|
+
/**
|
|
3
|
+
* The page the card sits in.
|
|
4
|
+
*
|
|
5
|
+
* It carries its own viewport height because this screen is rendered straight out of the
|
|
6
|
+
* dispatcher, into whatever the application happens to have around it — which is usually nothing
|
|
7
|
+
* with a height, so a percentage minimum would resolve to zero and leave the card at the top.
|
|
8
|
+
*/
|
|
9
|
+
export const page = {
|
|
10
|
+
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
11
|
+
minHeight: '100dvh', padding: '1rem',
|
|
12
|
+
fontFamily: 'system-ui, sans-serif', lineHeight: 1.5,
|
|
13
|
+
};
|
|
14
|
+
// Centred throughout, so the plain screen and the styled one read the same way.
|
|
15
|
+
export const box = {
|
|
16
|
+
width: '100%', maxWidth: '24rem', padding: '1.5rem', textAlign: 'center',
|
|
17
|
+
};
|
|
18
|
+
/** The same English fallback a document's `i18nKey` translates to when nothing else names it. */
|
|
19
|
+
export const DEFAULT_LABEL = {
|
|
20
|
+
terms: 'Terms & Conditions',
|
|
21
|
+
privacy: 'Privacy Policy',
|
|
22
|
+
cookies: 'Cookie Policy',
|
|
23
|
+
billing: 'Billing Terms',
|
|
24
|
+
product: '{{product}} Product Terms',
|
|
25
|
+
};
|
|
26
|
+
/** Outcomes after which nobody was signed in, so a screen parked for the landing must not wait. */
|
|
27
|
+
export const UNSIGNED_OUTCOMES = new Set([
|
|
28
|
+
LoginOutcome.Blocked, LoginOutcome.Failed, LoginOutcome.Gesture,
|
|
29
|
+
]);
|
|
30
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/login/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB;IACjC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ;IAC/D,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM;IACpC,UAAU,EAAE,uBAAuB,EAAE,UAAU,EAAE,GAAG;CACrD,CAAA;AAED,gFAAgF;AAChF,MAAM,CAAC,MAAM,GAAG,GAAkB;IAChC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;CACzE,CAAA;AAED,iGAAiG;AACjG,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,oBAAoB;IAC3B,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,2BAA2B;CACrC,CAAA;AAED,mGAAmG;AACnG,MAAM,CAAC,MAAM,iBAAiB,GAA8B,IAAI,GAAG,CAAe;IAChF,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO;CAChE,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ResolvedCredit {
|
|
2
|
+
/** Whether "Powered by OwlMeans" is rendered. */
|
|
3
|
+
poweredBy: boolean;
|
|
4
|
+
/** The product and organization line, already composed. Null when there is nothing to say. */
|
|
5
|
+
line: string | null;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/credit/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB,8FAA8F;IAC9F,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB"}
|