@owlmeans/client-auth 0.1.18-rc.13 → 0.1.18-rc.14
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/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/client-auth/SKILL.md +7 -1
- package/build/login/credit.d.ts +5 -0
- package/build/login/credit.d.ts.map +1 -1
- package/build/login/credit.js +43 -9
- package/build/login/credit.js.map +1 -1
- package/build/login/screen.d.ts +13 -0
- package/build/login/screen.d.ts.map +1 -1
- package/build/login/screen.js +27 -14
- package/build/login/screen.js.map +1 -1
- package/build/login/types.d.ts +9 -1
- package/build/login/types.d.ts.map +1 -1
- package/build/manager/modules.d.ts +1 -1
- package/build/manager/modules.d.ts.map +1 -1
- package/build/manager/plugins/basic-ed25519.d.ts.map +1 -1
- package/build/manager/plugins/basic-ed25519.js +4 -0
- package/build/manager/plugins/basic-ed25519.js.map +1 -1
- package/build/manager/plugins/methods.d.ts +0 -4
- package/build/manager/plugins/methods.d.ts.map +1 -1
- package/build/manager/plugins/methods.js +25 -6
- package/build/manager/plugins/methods.js.map +1 -1
- package/build/manager/plugins/re-captcha.d.ts.map +1 -1
- package/build/manager/plugins/re-captcha.js +3 -0
- package/build/manager/plugins/re-captcha.js.map +1 -1
- package/build/manager/plugins/tunnel-consumer.d.ts.map +1 -1
- package/build/manager/plugins/tunnel-consumer.js +3 -0
- package/build/manager/plugins/tunnel-consumer.js.map +1 -1
- package/build/manager/plugins/types.d.ts +22 -0
- package/build/manager/plugins/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/login/credit.ts +47 -9
- package/src/login/screen.tsx +27 -13
- package/src/login/types.ts +9 -1
- package/src/manager/plugins/basic-ed25519.tsx +5 -0
- package/src/manager/plugins/methods.ts +29 -7
- package/src/manager/plugins/re-captcha.tsx +4 -0
- package/src/manager/plugins/tunnel-consumer.tsx +4 -0
- package/src/manager/plugins/types.ts +22 -0
- package/tests/login.spec.ts +96 -3
- package/build/.gitkeep +0 -0
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/client-auth",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.18-rc.14",
|
|
5
|
+
"generatedAt": "2026-09-01T12:04:42.696Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/client-auth
|
|
9
9
|
|
|
10
10
|
**Layer:** Client
|
|
11
|
-
**Install:** `"@owlmeans/client-auth": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/client-auth": "^0.1.18-rc.14"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
@@ -44,6 +44,12 @@ can complete at all. Do not conflate them.
|
|
|
44
44
|
| Export | Description |
|
|
45
45
|
|--------|-------------|
|
|
46
46
|
| `appendLogin(ctx)` | Register the host and expose it as `context.login()` |
|
|
47
|
+
| `registerMethodSource`, `resolveLoginMethods`, `primaryLoginMethod` | Which sign-in methods are offered — see `login-methods` |
|
|
48
|
+
| `resolveTerms`, `termsAccepted`, `acceptTerms`, `resolveCredit` | The confirmation and the credit line |
|
|
49
|
+
| `FallbackLoginScreen` | The plain sign-in screen a relying party renders when no UI family registered one |
|
|
50
|
+
| `surrogatePath(ctx, target)` | Where a surrogate login window opens; `null` on an older entrypoint list |
|
|
51
|
+
| `resumeAction(outcome)` | The one reading of a `resume` outcome, shared by three dispatchers |
|
|
52
|
+
| `revokeToken(ctx)` | The single de-adoption path, mirroring `adoptToken` |
|
|
47
53
|
| `ensureLoginService(ctx)` | Idempotently obtain the host — what a plugin package calls before `registerPlugin` |
|
|
48
54
|
| `makeLoginService(alias?)` | The host itself: a **lazy** service, so `makeContext` can reach it at the Loading stage |
|
|
49
55
|
| `LoginPlugin`, `LoginEnv`, `LoginRequest`, `LoginOutcome`, `LoginService` | The contract |
|
package/build/login/credit.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export interface ResolvedCredit {
|
|
|
8
8
|
/**
|
|
9
9
|
* What the bottom of the sign-in screen says.
|
|
10
10
|
*
|
|
11
|
+
* It is a copyright notice, so it is composed as one: `© <year> <holder>`. That is the whole
|
|
12
|
+
* reason `copyright` defaults to on — the name on its own reads as a caption, and an application
|
|
13
|
+
* that means to assert a copyright would have had to write the mark and the year into a literal
|
|
14
|
+
* `line` to get one.
|
|
15
|
+
*
|
|
11
16
|
* The organization falls back to its slug because an organization record carries no readable name
|
|
12
17
|
* — so "no name" is the ordinary case, not an error, and a screen that rendered an empty line for
|
|
13
18
|
* it would be worse than one that renders the slug.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../src/login/credit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAExE,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB,8FAA8F;IAC9F,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;
|
|
1
|
+
{"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../src/login/credit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAExE,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB,8FAA8F;IAC9F,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAuBD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,SAClB,iBAAiB,UAAU,aAAa,YAAY,MAAM,KAC/D,cA2BF,CAAA"}
|
package/build/login/credit.js
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The years one notice covers.
|
|
3
|
+
*
|
|
4
|
+
* A range only while the first year is genuinely in the past — an app configured with the current
|
|
5
|
+
* year, or with a year a skewed clock puts in the future, still gets a well-formed notice rather
|
|
6
|
+
* than `© 2026–2026` or a range that runs backwards.
|
|
7
|
+
*/
|
|
8
|
+
const years = (since, now) => since != null && since > 0 && since < now ? `${since}–${now}` : `${now}`;
|
|
9
|
+
/**
|
|
10
|
+
* A configured value that was actually SET.
|
|
11
|
+
*
|
|
12
|
+
* Empty is how a build-time default spells "unset", and this config is filled from environment
|
|
13
|
+
* variables a platform delivers — `BRANDING_ORGANIZATION: meta.brandingOrganization ?? ''` is the
|
|
14
|
+
* shape of every one of them. `??` does not fall through an empty string, so an undelivered
|
|
15
|
+
* organization used to win the fallback chain and compose a line ending in a bare dash.
|
|
16
|
+
*/
|
|
17
|
+
const set = (value) => value != null && value.trim() !== '' ? value : null;
|
|
1
18
|
/**
|
|
2
19
|
* What the bottom of the sign-in screen says.
|
|
3
20
|
*
|
|
21
|
+
* It is a copyright notice, so it is composed as one: `© <year> <holder>`. That is the whole
|
|
22
|
+
* reason `copyright` defaults to on — the name on its own reads as a caption, and an application
|
|
23
|
+
* that means to assert a copyright would have had to write the mark and the year into a literal
|
|
24
|
+
* `line` to get one.
|
|
25
|
+
*
|
|
4
26
|
* The organization falls back to its slug because an organization record carries no readable name
|
|
5
27
|
* — so "no name" is the ordinary case, not an error, and a screen that rendered an empty line for
|
|
6
28
|
* it would be worse than one that renders the slug.
|
|
@@ -10,15 +32,27 @@
|
|
|
10
32
|
*/
|
|
11
33
|
export const resolveCredit = (cfg, brand, service) => {
|
|
12
34
|
const poweredBy = cfg?.poweredBy ?? true;
|
|
13
|
-
|
|
14
|
-
|
|
35
|
+
const literal = set(cfg?.line);
|
|
36
|
+
if (literal != null) {
|
|
37
|
+
return { poweredBy, line: literal };
|
|
15
38
|
}
|
|
16
|
-
const product = cfg?.product ?? brand?.name ?? service
|
|
17
|
-
const organization = cfg?.organization ?? brand?.organization
|
|
18
|
-
?? cfg?.entity ?? brand?.entity
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
39
|
+
const product = set(cfg?.product) ?? set(brand?.name) ?? set(service);
|
|
40
|
+
const organization = set(cfg?.organization) ?? set(brand?.organization)
|
|
41
|
+
?? set(cfg?.entity) ?? set(brand?.entity);
|
|
42
|
+
// Whoever the notice names. A product with no organization behind it holds its own copyright,
|
|
43
|
+
// which is why this falls through to the product rather than dropping the notice.
|
|
44
|
+
const holder = set(cfg?.holder) ?? organization ?? product;
|
|
45
|
+
const wording = typeof cfg?.copyright === 'string' ? set(cfg.copyright) : null;
|
|
46
|
+
const notice = cfg?.copyright === false || holder == null
|
|
47
|
+
? organization
|
|
48
|
+
: wording ?? `© ${years(cfg?.since, new Date().getFullYear())} ${holder}`;
|
|
49
|
+
// The product is named beside the notice only when it is not already the thing being claimed —
|
|
50
|
+
// "OwlMeans — © 2026 OwlMeans" says the name twice and neither time usefully.
|
|
51
|
+
return {
|
|
52
|
+
poweredBy,
|
|
53
|
+
line: product != null && notice != null && product !== holder
|
|
54
|
+
? `${product} — ${notice}`
|
|
55
|
+
: notice ?? product,
|
|
56
|
+
};
|
|
23
57
|
};
|
|
24
58
|
//# sourceMappingURL=credit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.js","sourceRoot":"","sources":["../../src/login/credit.ts"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"credit.js","sourceRoot":"","sources":["../../src/login/credit.ts"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,CAAC,KAAyB,EAAE,GAAW,EAAU,EAAE,CAC/D,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,IA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G,EAAE,SAAS,KAAK,KAAK,IAAI,MAAM,IAAI,IAAI;QACvD,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,MAAM,EAAE,CAAA;IAE3E,+FAA+F;IAC/F,8EAA8E;IAC9E,OAAO;QACL,SAAS;QACT,IAAI,EAAE,OAAO,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,KAAK,MAAM;YAC3D,CAAC,CAAC,GAAG,OAAO,MAAM,MAAM,EAAE;YAC1B,CAAC,CAAC,MAAM,IAAI,OAAO;KACtB,CAAA;AACH,CAAC,CAAA"}
|
package/build/login/screen.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import type { LoginScreenProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The sign-in screen every application gets, whether or not it registered a styled one.
|
|
5
|
+
*
|
|
6
|
+
* It exists because a relying party must render SOMETHING rather than start a flow on its own, and
|
|
7
|
+
* a relying party may not depend on a UI family. So this is deliberately plain: raw elements and
|
|
8
|
+
* inline styles, no Tailwind class that a consumer's stylesheet would have to scan for, no shadcn
|
|
9
|
+
* primitive a consumer would have to vendor. An application that registers a real screen through
|
|
10
|
+
* `login().registerScreen(...)` never sees it.
|
|
11
|
+
*
|
|
12
|
+
* Because it is the floor rather than the design, it still has to be correct: it offers the same
|
|
13
|
+
* methods, enforces the same terms confirmation, centres the same way, and renders the same
|
|
14
|
+
* credit line.
|
|
15
|
+
*/
|
|
3
16
|
export declare const FallbackLoginScreen: FC<LoginScreenProps>;
|
|
4
17
|
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/login/screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,EAAE,EAAE,MAAM,OAAO,CAAA;AAG9C,OAAO,KAAK,EAA6B,gBAAgB,EAAgB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/login/screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,EAAE,EAAE,MAAM,OAAO,CAAA;AAG9C,OAAO,KAAK,EAA6B,gBAAgB,EAAgB,MAAM,YAAY,CAAA;AA+B3F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,gBAAgB,CAuFpD,CAAA"}
|
package/build/login/screen.js
CHANGED
|
@@ -6,27 +6,40 @@ import { primaryLoginMethod } from './methods.js';
|
|
|
6
6
|
import { acceptTerms, resolveTerms, termsAccepted } from './terms.js';
|
|
7
7
|
import { resolveCredit } from './credit.js';
|
|
8
8
|
/**
|
|
9
|
-
* The
|
|
9
|
+
* The page the card sits in.
|
|
10
10
|
*
|
|
11
|
-
* It
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* primitive a consumer would have to vendor. An application that registers a real screen through
|
|
15
|
-
* `login().registerScreen(...)` never sees it.
|
|
16
|
-
*
|
|
17
|
-
* Because it is the floor rather than the design, it still has to be correct: it offers the same
|
|
18
|
-
* methods, enforces the same terms confirmation, and renders the same credit line.
|
|
11
|
+
* It carries its own viewport height because this screen is rendered straight out of the
|
|
12
|
+
* dispatcher, into whatever the application happens to have around it — which is usually nothing
|
|
13
|
+
* with a height, so a percentage minimum would resolve to zero and leave the card at the top.
|
|
19
14
|
*/
|
|
20
|
-
const
|
|
21
|
-
|
|
15
|
+
const page = {
|
|
16
|
+
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
17
|
+
minHeight: '100dvh', padding: '1rem',
|
|
22
18
|
fontFamily: 'system-ui, sans-serif', lineHeight: 1.5,
|
|
23
19
|
};
|
|
20
|
+
// Centred throughout, so the plain screen and the styled one read the same way.
|
|
21
|
+
const box = {
|
|
22
|
+
width: '100%', maxWidth: '24rem', padding: '1.5rem', textAlign: 'center',
|
|
23
|
+
};
|
|
24
24
|
const button = (emphasis) => ({
|
|
25
25
|
display: 'block', width: '100%', marginTop: '.5rem', padding: '.625rem 1rem',
|
|
26
26
|
fontSize: '1rem', cursor: 'pointer', borderRadius: '.375rem',
|
|
27
27
|
border: '1px solid currentColor',
|
|
28
28
|
...(emphasis === 'primary' ? { fontWeight: 600 } : {}),
|
|
29
29
|
});
|
|
30
|
+
/**
|
|
31
|
+
* The sign-in screen every application gets, whether or not it registered a styled one.
|
|
32
|
+
*
|
|
33
|
+
* It exists because a relying party must render SOMETHING rather than start a flow on its own, and
|
|
34
|
+
* a relying party may not depend on a UI family. So this is deliberately plain: raw elements and
|
|
35
|
+
* inline styles, no Tailwind class that a consumer's stylesheet would have to scan for, no shadcn
|
|
36
|
+
* primitive a consumer would have to vendor. An application that registers a real screen through
|
|
37
|
+
* `login().registerScreen(...)` never sees it.
|
|
38
|
+
*
|
|
39
|
+
* Because it is the floor rather than the design, it still has to be correct: it offers the same
|
|
40
|
+
* methods, enforces the same terms confirmation, centres the same way, and renders the same
|
|
41
|
+
* credit line.
|
|
42
|
+
*/
|
|
30
43
|
export const FallbackLoginScreen = props => {
|
|
31
44
|
const context = useContext();
|
|
32
45
|
const t = props.translate ?? ((_key, defaultValue) => defaultValue);
|
|
@@ -56,8 +69,8 @@ export const FallbackLoginScreen = props => {
|
|
|
56
69
|
setAttempted(false);
|
|
57
70
|
acceptTerms(resolved, value);
|
|
58
71
|
}, [resolved]);
|
|
59
|
-
return _jsxs("div", { style: box, children: [_jsx("h1", { style: { fontSize: '1.25rem', marginBottom: '.25rem' }, children: props.title ?? t('login.title', 'Sign in') }), _jsx("p", { style: { opacity: .75, marginTop: 0 }, children: props.subtitle ?? t('login.subtitle', 'Choose how you would like to continue.') }), methods.length < 1
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
return _jsx("div", { "data-login-screen": true, style: page, children: _jsxs("div", { style: box, children: [_jsx("h1", { style: { fontSize: '1.25rem', marginBottom: '.25rem' }, children: props.title ?? t('login.title', 'Sign in') }), _jsx("p", { style: { opacity: .75, marginTop: 0 }, children: props.subtitle ?? t('login.subtitle', 'Choose how you would like to continue.') }), methods.length < 1
|
|
73
|
+
? _jsx("p", { role: "status", children: t('login.empty', 'No sign-in method is configured for this application.') })
|
|
74
|
+
: methods.map(method => _jsx("button", { type: "button", "data-login-method": method.id, "aria-disabled": blocked, "data-blocked": blocked ? 'true' : undefined, style: { ...button(method.emphasis), opacity: blocked ? .6 : 1 }, autoFocus: method.id === primary?.id, onClick: () => select(method), children: method.label ?? t(`login.method.${method.i18nKey ?? method.id}`, method.id) }, method.id)), resolved != null && _jsxs("p", { style: { marginTop: '1rem', fontSize: '.875rem' }, children: [_jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: accepted, "data-login-terms": true, onChange: event => onAccept(event.target.checked) }), ' ', t('login.terms.agreement', 'I have read and agree to the Terms & Conditions and the Privacy Policy.')] }), ' ', _jsx("a", { href: resolved.terms, target: "_blank", rel: "noreferrer noopener", children: t('login.terms.terms', 'Terms & Conditions') }), ' · ', _jsx("a", { href: resolved.privacy, target: "_blank", rel: "noreferrer noopener", children: t('login.terms.privacy', 'Privacy Policy') })] }), attempted && blocked && _jsx("p", { role: "alert", style: { color: '#b00', fontSize: '.875rem' }, children: t('login.terms.required', 'Please confirm the Terms & Conditions and the Privacy Policy to continue.') }), props.footer ?? _jsxs("p", { style: { marginTop: '2rem', fontSize: '.75rem', opacity: .7 }, children: [credit.poweredBy && _jsx("span", { children: t('login.credit.powered', 'Powered by OwlMeans') }), credit.poweredBy && credit.line != null && ' · ', credit.line] })] }) });
|
|
62
75
|
};
|
|
63
76
|
//# sourceMappingURL=screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../src/login/screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE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AAQ,EAAC,GAAG,EAAC,qBAAqB,YAC/D,CAAC,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,GAC3C,EACH,KAAK,EACN,YAAG,IAAI,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,YACjE,CAAC,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,GACzC,IACF,EAEH,SAAS,IAAI,OAAO,IAAI,YAAG,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,YACnF,CAAC,CAAC,sBAAsB,EACvB,2EAA2E,CAAC,GAC5E,EAEH,KAAK,CAAC,MAAM,IAAI,aAAG,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,aAC9E,MAAM,CAAC,SAAS,IAAI,yBAAO,CAAC,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,GAAQ,EACnF,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,KAAK,EAChD,MAAM,CAAC,IAAI,IACV,IACA,GAAM,CAAA;AACd,CAAC,CAAA"}
|
package/build/login/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentType, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { LazyService, BasicContext } from '@owlmeans/context';
|
|
3
3
|
import type { LoginMethodEmphasis, LoginScreenConfig, LoginTermsConfig } from '@owlmeans/config';
|
|
4
4
|
/**
|
|
@@ -189,6 +189,14 @@ export interface LoginScreenProps {
|
|
|
189
189
|
footer?: ReactNode;
|
|
190
190
|
className?: string;
|
|
191
191
|
containerClassName?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Inline overrides for the screen's outer box.
|
|
194
|
+
*
|
|
195
|
+
* It exists because the outer box carries its viewport height inline rather than as a utility
|
|
196
|
+
* class, and an escape hatch that a class can no longer provide has to be provided some other
|
|
197
|
+
* way. See the note on the screen itself.
|
|
198
|
+
*/
|
|
199
|
+
style?: CSSProperties;
|
|
192
200
|
}
|
|
193
201
|
export type LoginScreenComponent = ComponentType<LoginScreenProps>;
|
|
194
202
|
export interface LoginService extends LazyService {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/login/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/login/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEhG;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,yEAAyE;IACzE,SAAS,EAAE,OAAO,CAAA;IAClB,kGAAkG;IAClG,QAAQ,EAAE,OAAO,CAAA;IACjB,yFAAyF;IACzF,SAAS,EAAE,OAAO,CAAA;IAClB,uFAAuF;IACvF,SAAS,EAAE,OAAO,CAAA;CACnB;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,0FAA0F;IA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AAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,YAAY,CAAA;CAC1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const modules:
|
|
1
|
+
export declare const modules: any[];
|
|
2
2
|
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/manager/modules.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/manager/modules.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,OAAO,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-ed25519.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/basic-ed25519.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAKtD,eAAO,MAAM,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"basic-ed25519.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/basic-ed25519.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAKtD,eAAO,MAAM,oBAAoB,EAAE,oBA0ClC,CAAA"}
|
|
@@ -6,6 +6,10 @@ import { AuthenCredError } from '../errors.js';
|
|
|
6
6
|
export const ed25519BasicUIPlugin = {
|
|
7
7
|
type: AuthenticationType.BasicEd25519,
|
|
8
8
|
method: { order: 300, icon: 'key', emphasis: 'secondary' },
|
|
9
|
+
// This package ships no UI family, so the form below is a `Renderer` a panel package assigns
|
|
10
|
+
// (`@owlmeans/web-panel/auth/plugins`, `@owlmeans/mui-panel/auth/plugins`). Until one does, the
|
|
11
|
+
// Implementation throws on mount — so the sign-in screen must not offer the method.
|
|
12
|
+
requiresRenderer: true,
|
|
9
13
|
Implementation: Renderer => ({ type, stage, control, params }) => {
|
|
10
14
|
type = type ?? AuthenticationType.BasicEd25519;
|
|
11
15
|
Renderer = Renderer ?? ed25519BasicUIPlugin.Renderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-ed25519.js","sourceRoot":"","sources":["../../../src/manager/plugins/basic-ed25519.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,MAAM,CAAC,MAAM,oBAAoB,GAAyB;IACxD,IAAI,EAAE,kBAAkB,CAAC,YAAY;IAErC,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE;IAE1D,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAE/D,IAAI,GAAG,IAAI,IAAI,kBAAkB,CAAC,YAAY,CAAA;QAC9C,QAAQ,GAAG,QAAQ,IAAI,oBAAoB,CAAC,QAAQ,CAAA;QAEpD,iEAAiE;QACjE,+CAA+C;QAC/C,SAAS,CAAC,GAAG,EAAE;YACb,IAAI,OAAO,CAAC,KAAK,KAAK,mBAAmB,CAAC,IAAI,EAAE,CAAC;gBAC/C,KAAK,OAAO,CAAC,gBAAgB,EAAE,CAAA;YACjC,CAAC;QACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;QAEV,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,IAAI,WAAW,CAAC,iDAAiD,CAAC,CAAA;QAC1E,CAAC;QAED,OAAO,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,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AAI,kBAAkB,CAAC,YAAY,CAAA;QAC9C,QAAQ,GAAG,QAAQ,IAAI,oBAAoB,CAAC,QAAQ,CAAA;QAEpD,iEAAiE;QACjE,+CAA+C;QAC/C,SAAS,CAAC,GAAG,EAAE;YACb,IAAI,OAAO,CAAC,KAAK,KAAK,mBAAmB,CAAC,IAAI,EAAE,CAAC;gBAC/C,KAAK,OAAO,CAAC,gBAAgB,EAAE,CAAA;YACjC,CAAC;QACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;QAEV,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,IAAI,WAAW,CAAC,iDAAiD,CAAC,CAAA;QAC1E,CAAC;QAED,OAAO,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,CAAA;IACjF,CAAC;IAED,YAAY,EAAE,KAAK,EAAC,WAAW,EAAC,EAAE;QAChC,MAAM,GAAG,GAAG,gBAAgB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;QAEpD,IAAI,WAAW,CAAC,MAAM,KAAK,GAAG,CAAC,aAAa,EAAE,EAAE,CAAC;YAC/C,MAAM,IAAI,eAAe,CAAC,uBAAuB,CAAC,CAAA;QACpD,CAAC;QAED,WAAW,CAAC,UAAU,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;QAE9D,4CAA4C;QAC5C,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;IACtB,CAAC;CACF,CAAA"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { LoginMethodSource } from '../../login/types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Every registered authentication plugin that declares itself offerable, as a sign-in method.
|
|
4
|
-
*
|
|
5
|
-
* A plugin without `method` is deliberately invisible here: `re-captcha` is a STEP inside another
|
|
6
|
-
* flow, not a way to sign in, and a registry that offered everything registered would put it on
|
|
7
|
-
* the screen as a choice.
|
|
8
4
|
*/
|
|
9
5
|
export declare const pluginMethodSource: LoginMethodSource;
|
|
10
6
|
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/methods.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/methods.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmC,iBAAiB,EAAgB,MAAM,sBAAsB,CAAA;AA6B5G;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAsChC,CAAA"}
|
|
@@ -2,16 +2,35 @@ import { CAUTHEN_AUTHEN_TYPED } from '@owlmeans/auth';
|
|
|
2
2
|
import { DEFAULT_METHOD_ORDER, LOGIN_SERVICE } from '../../login/consts.js';
|
|
3
3
|
import { listAuthPlugins } from './registry.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Whether a registered plugin may be put on the sign-in screen of THIS application.
|
|
6
|
+
*
|
|
7
|
+
* The registry is global and is filled by side-effect imports, so "registered" means only that
|
|
8
|
+
* some module was pulled into the bundle — three separate reasons why that is not enough:
|
|
6
9
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
+
* 1. No `method`: `re-captcha` is a STEP inside another flow, not a way to sign in.
|
|
11
|
+
* 2. No renderer: a plugin that declares `requiresRenderer` throws the moment its screen mounts
|
|
12
|
+
* unless a UI package (`web-panel`, `mui-panel`) assigned one. An app that imported the plugin
|
|
13
|
+
* host without that package would be offering buttons whose only outcome is a broken page.
|
|
14
|
+
* 3. Not wired: a plugin whose flow needs a service its context never appended fails on the
|
|
15
|
+
* lookup instead. Packages register their plugins in groups, so an app that wanted one of them
|
|
16
|
+
* gets the rest too, and the rest have to be able to say they do not apply here.
|
|
17
|
+
*/
|
|
18
|
+
const offerable = (plugin, ctx) => {
|
|
19
|
+
if (plugin.method == null || plugin.method.hidden === true) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (plugin.requiresRenderer === true && plugin.Renderer == null) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return plugin.method.available?.(ctx) !== false;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Every registered authentication plugin that declares itself offerable, as a sign-in method.
|
|
10
29
|
*/
|
|
11
30
|
export const pluginMethodSource = {
|
|
12
31
|
alias: 'authentication-plugins',
|
|
13
|
-
list:
|
|
14
|
-
.filter(plugin => plugin
|
|
32
|
+
list: ctx => listAuthPlugins()
|
|
33
|
+
.filter(plugin => offerable(plugin, ctx))
|
|
15
34
|
.map((plugin) => {
|
|
16
35
|
const meta = plugin.method;
|
|
17
36
|
const type = plugin.type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../src/manager/plugins/methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../src/manager/plugins/methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAG3E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,SAAS,GAAG,CAAC,MAA4B,EAAE,GAAuB,EAAW,EAAE;IACnF,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;Q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AC;YAC7D,GAAG,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,MAAM,EAAE,EAAE,IAAI,EAAE;YAEhB,2FAA2F;YAC3F,gFAAgF;YAChF,KAAK,EAAE,SAAS,CAAC,EAAE;gBACjB,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAe,aAAa,CAAC,CAAA;gBACpE,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,UAAU,CAAmB,oBAAoB,CAAC,CAAA;gBACvF,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAA;gBAE3E,OAAO,KAAK,CAAC,KAAK,CAAC;oBACjB,GAAG;oBACH,oFAAoF;oBACpF,8EAA8E;oBAC9E,GAAG,CAAC,SAAS,CAAC,QAAQ,IAAI,IAAI;wBAC5B,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;wBAC1E,CAAC,CAAC,EAAE,CAAC;iBACR,CAAC,CAAA;YACJ,CAAC;SACF,CAAA;IACH,CAAC,CAAC;CACL,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"re-captcha.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/re-captcha.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGtD,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"re-captcha.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/re-captcha.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGtD,eAAO,MAAM,eAAe,EAAE,oBAiC7B,CAAA"}
|
|
@@ -5,6 +5,9 @@ export const reCaptchaPlugin = {
|
|
|
5
5
|
type: AuthenticationType.ReCaptcha,
|
|
6
6
|
// A STEP inside another flow, never a way to sign in — so it is registered and never offered.
|
|
7
7
|
method: { hidden: true },
|
|
8
|
+
// Its widget is a `Renderer` a panel package assigns. `hidden` already keeps it off the sign-in
|
|
9
|
+
// screen; this is what the flow that DOES drive it can check before handing it a stage.
|
|
10
|
+
requiresRenderer: true,
|
|
8
11
|
Implementation: Renderer => ({ type, stage, control, params }) => {
|
|
9
12
|
Renderer = Renderer ?? reCaptchaPlugin.Renderer;
|
|
10
13
|
// ReCaptcha authentication requests allowance unconditionally
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"re-captcha.js","sourceRoot":"","sources":["../../../src/manager/plugins/re-captcha.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAyB;IACnD,IAAI,EAAE,kBAAkB,CAAC,SAAS;IAElC,8FAA8F;IAC9F,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;IAExB,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC/D,QAAQ,GAAG,QAAQ,IAAI,eAAe,CAAC,QAAQ,CAAA;QAE/C,+DAA+D;QAC/D,+CAA+C;QAC/C,SAAS,CAAC,GAAG,EAAE;YACb,IAAI,OAAO,CAAC,KAAK,KAAK,mBAAmB,CAAC,IAAI,EAAE,CAAC;gBAC/C,KAAK,OAAO,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,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AE,CAAC,CAAA;YACjE,CAAC;QACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;QAEV,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,IAAI,WAAW,CAAC,8CAA8C,CAAC,CAAA;QACvE,CAAC;QAED,OAAO,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,CAAA;IACjF,CAAC;IAED;;;OAGG;IACH,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;CAC1C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel-consumer.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/tunnel-consumer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAStD,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"tunnel-consumer.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/tunnel-consumer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAStD,eAAO,MAAM,sBAAsB,EAAE,oBAoEpC,CAAA"}
|
|
@@ -8,6 +8,9 @@ import { createWalletFacade } from './tunnel/wallet.js';
|
|
|
8
8
|
export const tunnelConsumerUIPlugin = {
|
|
9
9
|
type: AuthenticationType.WalletConsumer,
|
|
10
10
|
method: { order: 400, icon: 'wallet' },
|
|
11
|
+
// The PIN form is a `Renderer` a panel package assigns; without one the Implementation throws on
|
|
12
|
+
// mount, so the method must not be offered.
|
|
13
|
+
requiresRenderer: true,
|
|
11
14
|
Implementation: renderer => ({ type, stage, control, params }) => {
|
|
12
15
|
type = type ?? AuthenticationType.WalletConsumer;
|
|
13
16
|
const Renderer = renderer
|
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CAAA;IAC7D,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAwB,mBAAmB,CAAC,YAAY,EAAE;YACpF,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,IAAI,EAAE;YAC7C,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC,GAAG;YACtC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,QAAQ,CAAC,KAAK;YACpB,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,CAAC,UAAU,CAAC;SACrB,CAAC,CAAA;QAEF,IAAI,IAAI,CAAC,KAAK,KAAK,mBAAmB,CAAC,aAAa,EAAE,CAAC;YACrD,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;gBAC7B,MAAM,IAAI,WAAW,CAAC,kEAAkE,CAAC,CAAA;YAC3F,CAAC;YACD,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAA;QACxD,CAAC;QACD,SAAS;IACX,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAClB,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC3B,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import type { LoginMethodEmphasis } from '@owlmeans/config';
|
|
3
|
+
import type { LoginMethodContext } from '../../login/types.js';
|
|
3
4
|
import type { AuthenticationControl, AuthenticationRenderer, AuthenticationRendererProps } from '../components/authentication/types.js';
|
|
4
5
|
export interface AuthenticationPlugin extends Pick<AuthenticationControl, "beforeAuthenticate" | "afterAuthenticate">, Pick<Partial<AuthenticationControl>, "authenticate"> {
|
|
5
6
|
type: string;
|
|
6
7
|
Implementation: PluginImplemnetation;
|
|
7
8
|
Renderer?: AuthenticationRenderer;
|
|
9
|
+
/**
|
|
10
|
+
* This plugin's `Implementation` cannot render without a `Renderer` a UI package supplies.
|
|
11
|
+
*
|
|
12
|
+
* It is declared rather than inferred because there is nothing to infer it from: a plugin that
|
|
13
|
+
* renders its own form and one that throws `Renderer is not defined` are the same object until
|
|
14
|
+
* the screen mounts. Declaring it is what lets the sign-in screen leave out a method whose
|
|
15
|
+
* renderer nobody registered, instead of offering a button that crashes the page it opens.
|
|
16
|
+
*/
|
|
17
|
+
requiresRenderer?: boolean;
|
|
8
18
|
/**
|
|
9
19
|
* How this method presents itself on the sign-in screen.
|
|
10
20
|
*
|
|
@@ -35,6 +45,18 @@ export interface AuthMethodMeta {
|
|
|
35
45
|
restricted?: boolean;
|
|
36
46
|
/** Registered, but never a choice. */
|
|
37
47
|
hidden?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the application this method is about to be offered in actually wired it.
|
|
50
|
+
*
|
|
51
|
+
* The plugin registry is global and is written to by side-effect imports, so being registered
|
|
52
|
+
* says only that some bundle pulled the module in — and modules arrive in groups. An app that
|
|
53
|
+
* wanted one method out of a package gets every method that package registers, including ones
|
|
54
|
+
* whose first act is to look up a service its context never appended. This is where a plugin
|
|
55
|
+
* says so, per context, at render time; `false` leaves it off the screen.
|
|
56
|
+
*
|
|
57
|
+
* Absent means "always", which is right for a plugin that needs nothing but itself.
|
|
58
|
+
*/
|
|
59
|
+
available?: (ctx: LoginMethodContext) => boolean;
|
|
38
60
|
}
|
|
39
61
|
export interface PluginImplemnetation {
|
|
40
62
|
(Renderer?: AuthenticationRenderer): FC<AuthenticationRendererProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EA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ClE,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,cAAc,CAAC;IACrD,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,oBAAoB,CAAA;IACpC,QAAQ,CAAC,EAAE,sBAAsB,CAAA;IACjC;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,mBAAmB,CAAA;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,OAAO,CAAA;CACjD;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,QAAQ,CAAC,EAAE,sBAAsB,GAAG,EAAE,CAAC,2BAA2B,CAAC,CAAA;CACrE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/client-auth",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"@owlmeans/auth-common": "^0.1.18-rc.9",
|
|
55
55
|
"@owlmeans/basic-envelope": "^0.1.18-rc.9",
|
|
56
56
|
"@owlmeans/basic-keys": "^0.1.18-rc.9",
|
|
57
|
-
"@owlmeans/client": "^0.1.18-rc.
|
|
57
|
+
"@owlmeans/client": "^0.1.18-rc.11",
|
|
58
58
|
"@owlmeans/client-context": "^0.1.18-rc.9",
|
|
59
59
|
"@owlmeans/client-entrypoint": "^0.1.18-rc.9",
|
|
60
|
-
"@owlmeans/client-flow": "^0.1.18-rc.
|
|
60
|
+
"@owlmeans/client-flow": "^0.1.18-rc.12",
|
|
61
61
|
"@owlmeans/client-resource": "^0.1.18-rc.9",
|
|
62
62
|
"@owlmeans/client-socket": "^0.1.18-rc.9",
|
|
63
63
|
"@owlmeans/config": "^0.1.18-rc.8",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@owlmeans/i18n": "^0.1.18-rc.6",
|
|
70
70
|
"@owlmeans/resource": "^0.1.18-rc.7",
|
|
71
71
|
"@owlmeans/socket": "^0.1.18-rc.7",
|
|
72
|
-
"@owlmeans/web-flow": "^0.1.18-rc.
|
|
72
|
+
"@owlmeans/web-flow": "^0.1.18-rc.12",
|
|
73
73
|
"@scure/base": "^2.3.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
package/src/login/credit.ts
CHANGED
|
@@ -7,9 +7,35 @@ export interface ResolvedCredit {
|
|
|
7
7
|
line: string | null
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* The years one notice covers.
|
|
12
|
+
*
|
|
13
|
+
* A range only while the first year is genuinely in the past — an app configured with the current
|
|
14
|
+
* year, or with a year a skewed clock puts in the future, still gets a well-formed notice rather
|
|
15
|
+
* than `© 2026–2026` or a range that runs backwards.
|
|
16
|
+
*/
|
|
17
|
+
const years = (since: number | undefined, now: number): string =>
|
|
18
|
+
since != null && since > 0 && since < now ? `${since}–${now}` : `${now}`
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A configured value that was actually SET.
|
|
22
|
+
*
|
|
23
|
+
* Empty is how a build-time default spells "unset", and this config is filled from environment
|
|
24
|
+
* variables a platform delivers — `BRANDING_ORGANIZATION: meta.brandingOrganization ?? ''` is the
|
|
25
|
+
* shape of every one of them. `??` does not fall through an empty string, so an undelivered
|
|
26
|
+
* organization used to win the fallback chain and compose a line ending in a bare dash.
|
|
27
|
+
*/
|
|
28
|
+
const set = (value?: string | null): string | null =>
|
|
29
|
+
value != null && value.trim() !== '' ? value : null
|
|
30
|
+
|
|
10
31
|
/**
|
|
11
32
|
* What the bottom of the sign-in screen says.
|
|
12
33
|
*
|
|
34
|
+
* It is a copyright notice, so it is composed as one: `© <year> <holder>`. That is the whole
|
|
35
|
+
* reason `copyright` defaults to on — the name on its own reads as a caption, and an application
|
|
36
|
+
* that means to assert a copyright would have had to write the mark and the year into a literal
|
|
37
|
+
* `line` to get one.
|
|
38
|
+
*
|
|
13
39
|
* The organization falls back to its slug because an organization record carries no readable name
|
|
14
40
|
* — so "no name" is the ordinary case, not an error, and a screen that rendered an empty line for
|
|
15
41
|
* it would be worse than one that renders the slug.
|
|
@@ -21,17 +47,29 @@ export const resolveCredit = (
|
|
|
21
47
|
cfg?: LoginCreditConfig, brand?: BrandSettings, service?: string
|
|
22
48
|
): ResolvedCredit => {
|
|
23
49
|
const poweredBy = cfg?.poweredBy ?? true
|
|
24
|
-
|
|
25
|
-
|
|
50
|
+
const literal = set(cfg?.line)
|
|
51
|
+
if (literal != null) {
|
|
52
|
+
return { poweredBy, line: literal }
|
|
26
53
|
}
|
|
27
54
|
|
|
28
|
-
const product = cfg?.product ?? brand?.name ?? service
|
|
29
|
-
const organization = cfg?.organization ?? brand?.organization
|
|
30
|
-
?? cfg?.entity ?? brand?.entity
|
|
55
|
+
const product = set(cfg?.product) ?? set(brand?.name) ?? set(service)
|
|
56
|
+
const organization = set(cfg?.organization) ?? set(brand?.organization)
|
|
57
|
+
?? set(cfg?.entity) ?? set(brand?.entity)
|
|
31
58
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
59
|
+
// Whoever the notice names. A product with no organization behind it holds its own copyright,
|
|
60
|
+
// which is why this falls through to the product rather than dropping the notice.
|
|
61
|
+
const holder = set(cfg?.holder) ?? organization ?? product
|
|
62
|
+
const wording = typeof cfg?.copyright === 'string' ? set(cfg.copyright) : null
|
|
63
|
+
const notice = cfg?.copyright === false || holder == null
|
|
64
|
+
? organization
|
|
65
|
+
: wording ?? `© ${years(cfg?.since, new Date().getFullYear())} ${holder}`
|
|
35
66
|
|
|
36
|
-
|
|
67
|
+
// The product is named beside the notice only when it is not already the thing being claimed —
|
|
68
|
+
// "OwlMeans — © 2026 OwlMeans" says the name twice and neither time usefully.
|
|
69
|
+
return {
|
|
70
|
+
poweredBy,
|
|
71
|
+
line: product != null && notice != null && product !== holder
|
|
72
|
+
? `${product} — ${notice}`
|
|
73
|
+
: notice ?? product,
|
|
74
|
+
}
|
|
37
75
|
}
|
package/src/login/screen.tsx
CHANGED
|
@@ -9,22 +9,23 @@ import { acceptTerms, resolveTerms, termsAccepted } from './terms.js'
|
|
|
9
9
|
import { resolveCredit } from './credit.js'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* The
|
|
13
|
-
*
|
|
14
|
-
* It exists because a relying party must render SOMETHING rather than start a flow on its own, and
|
|
15
|
-
* a relying party may not depend on a UI family. So this is deliberately plain: raw elements and
|
|
16
|
-
* inline styles, no Tailwind class that a consumer's stylesheet would have to scan for, no shadcn
|
|
17
|
-
* primitive a consumer would have to vendor. An application that registers a real screen through
|
|
18
|
-
* `login().registerScreen(...)` never sees it.
|
|
12
|
+
* The page the card sits in.
|
|
19
13
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
14
|
+
* It carries its own viewport height because this screen is rendered straight out of the
|
|
15
|
+
* dispatcher, into whatever the application happens to have around it — which is usually nothing
|
|
16
|
+
* with a height, so a percentage minimum would resolve to zero and leave the card at the top.
|
|
22
17
|
*/
|
|
23
|
-
const
|
|
24
|
-
|
|
18
|
+
const page: CSSProperties = {
|
|
19
|
+
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
20
|
+
minHeight: '100dvh', padding: '1rem',
|
|
25
21
|
fontFamily: 'system-ui, sans-serif', lineHeight: 1.5,
|
|
26
22
|
}
|
|
27
23
|
|
|
24
|
+
// Centred throughout, so the plain screen and the styled one read the same way.
|
|
25
|
+
const box: CSSProperties = {
|
|
26
|
+
width: '100%', maxWidth: '24rem', padding: '1.5rem', textAlign: 'center',
|
|
27
|
+
}
|
|
28
|
+
|
|
28
29
|
const button = (emphasis?: string): CSSProperties => ({
|
|
29
30
|
display: 'block', width: '100%', marginTop: '.5rem', padding: '.625rem 1rem',
|
|
30
31
|
fontSize: '1rem', cursor: 'pointer', borderRadius: '.375rem',
|
|
@@ -32,6 +33,19 @@ const button = (emphasis?: string): CSSProperties => ({
|
|
|
32
33
|
...(emphasis === 'primary' ? { fontWeight: 600 } : {}),
|
|
33
34
|
})
|
|
34
35
|
|
|
36
|
+
/**
|
|
37
|
+
* The sign-in screen every application gets, whether or not it registered a styled one.
|
|
38
|
+
*
|
|
39
|
+
* It exists because a relying party must render SOMETHING rather than start a flow on its own, and
|
|
40
|
+
* a relying party may not depend on a UI family. So this is deliberately plain: raw elements and
|
|
41
|
+
* inline styles, no Tailwind class that a consumer's stylesheet would have to scan for, no shadcn
|
|
42
|
+
* primitive a consumer would have to vendor. An application that registers a real screen through
|
|
43
|
+
* `login().registerScreen(...)` never sees it.
|
|
44
|
+
*
|
|
45
|
+
* Because it is the floor rather than the design, it still has to be correct: it offers the same
|
|
46
|
+
* methods, enforces the same terms confirmation, centres the same way, and renders the same
|
|
47
|
+
* credit line.
|
|
48
|
+
*/
|
|
35
49
|
export const FallbackLoginScreen: FC<LoginScreenProps> = props => {
|
|
36
50
|
const context = useContext() as unknown as LoginContext
|
|
37
51
|
const t = props.translate ?? ((_key: string, defaultValue: string) => defaultValue)
|
|
@@ -68,7 +82,7 @@ export const FallbackLoginScreen: FC<LoginScreenProps> = props => {
|
|
|
68
82
|
acceptTerms(resolved, value)
|
|
69
83
|
}, [resolved])
|
|
70
84
|
|
|
71
|
-
return <div style={box}>
|
|
85
|
+
return <div data-login-screen style={page}><div style={box}>
|
|
72
86
|
<h1 style={{ fontSize: '1.25rem', marginBottom: '.25rem' }}>
|
|
73
87
|
{props.title ?? t('login.title', 'Sign in')}
|
|
74
88
|
</h1>
|
|
@@ -118,5 +132,5 @@ export const FallbackLoginScreen: FC<LoginScreenProps> = props => {
|
|
|
118
132
|
{credit.poweredBy && credit.line != null && ' · '}
|
|
119
133
|
{credit.line}
|
|
120
134
|
</p>}
|
|
121
|
-
</div>
|
|
135
|
+
</div></div>
|
|
122
136
|
}
|
package/src/login/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType, ReactNode } from 'react'
|
|
1
|
+
import type { ComponentType, CSSProperties, ReactNode } from 'react'
|
|
2
2
|
import type { LazyService, BasicContext } from '@owlmeans/context'
|
|
3
3
|
import type { LoginMethodEmphasis, LoginScreenConfig, LoginTermsConfig } from '@owlmeans/config'
|
|
4
4
|
|
|
@@ -206,6 +206,14 @@ export interface LoginScreenProps {
|
|
|
206
206
|
footer?: ReactNode
|
|
207
207
|
className?: string
|
|
208
208
|
containerClassName?: string
|
|
209
|
+
/**
|
|
210
|
+
* Inline overrides for the screen's outer box.
|
|
211
|
+
*
|
|
212
|
+
* It exists because the outer box carries its viewport height inline rather than as a utility
|
|
213
|
+
* class, and an escape hatch that a class can no longer provide has to be provided some other
|
|
214
|
+
* way. See the note on the screen itself.
|
|
215
|
+
*/
|
|
216
|
+
style?: CSSProperties
|
|
209
217
|
}
|
|
210
218
|
|
|
211
219
|
export type LoginScreenComponent = ComponentType<LoginScreenProps>
|
|
@@ -9,6 +9,11 @@ export const ed25519BasicUIPlugin: AuthenticationPlugin = {
|
|
|
9
9
|
|
|
10
10
|
method: { order: 300, icon: 'key', emphasis: 'secondary' },
|
|
11
11
|
|
|
12
|
+
// This package ships no UI family, so the form below is a `Renderer` a panel package assigns
|
|
13
|
+
// (`@owlmeans/web-panel/auth/plugins`, `@owlmeans/mui-panel/auth/plugins`). Until one does, the
|
|
14
|
+
// Implementation throws on mount — so the sign-in screen must not offer the method.
|
|
15
|
+
requiresRenderer: true,
|
|
16
|
+
|
|
12
17
|
Implementation: Renderer => ({ type, stage, control, params }) => {
|
|
13
18
|
|
|
14
19
|
type = type ?? AuthenticationType.BasicEd25519
|
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
import { CAUTHEN_AUTHEN_TYPED } from '@owlmeans/auth'
|
|
2
2
|
import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
|
|
3
3
|
import { DEFAULT_METHOD_ORDER, LOGIN_SERVICE } from '../../login/consts.js'
|
|
4
|
-
import type { LoginMethod, LoginMethodSource, LoginService } from '../../login/types.js'
|
|
4
|
+
import type { LoginMethod, LoginMethodContext, LoginMethodSource, LoginService } from '../../login/types.js'
|
|
5
|
+
import type { AuthenticationPlugin } from './types.js'
|
|
5
6
|
import { listAuthPlugins } from './registry.js'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Whether a registered plugin may be put on the sign-in screen of THIS application.
|
|
10
|
+
*
|
|
11
|
+
* The registry is global and is filled by side-effect imports, so "registered" means only that
|
|
12
|
+
* some module was pulled into the bundle — three separate reasons why that is not enough:
|
|
9
13
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
14
|
+
* 1. No `method`: `re-captcha` is a STEP inside another flow, not a way to sign in.
|
|
15
|
+
* 2. No renderer: a plugin that declares `requiresRenderer` throws the moment its screen mounts
|
|
16
|
+
* unless a UI package (`web-panel`, `mui-panel`) assigned one. An app that imported the plugin
|
|
17
|
+
* host without that package would be offering buttons whose only outcome is a broken page.
|
|
18
|
+
* 3. Not wired: a plugin whose flow needs a service its context never appended fails on the
|
|
19
|
+
* lookup instead. Packages register their plugins in groups, so an app that wanted one of them
|
|
20
|
+
* gets the rest too, and the rest have to be able to say they do not apply here.
|
|
21
|
+
*/
|
|
22
|
+
const offerable = (plugin: AuthenticationPlugin, ctx: LoginMethodContext): boolean => {
|
|
23
|
+
if (plugin.method == null || plugin.method.hidden === true) {
|
|
24
|
+
return false
|
|
25
|
+
}
|
|
26
|
+
if (plugin.requiresRenderer === true && plugin.Renderer == null) {
|
|
27
|
+
return false
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return plugin.method.available?.(ctx) !== false
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Every registered authentication plugin that declares itself offerable, as a sign-in method.
|
|
13
35
|
*/
|
|
14
36
|
export const pluginMethodSource: LoginMethodSource = {
|
|
15
37
|
alias: 'authentication-plugins',
|
|
16
38
|
|
|
17
|
-
list:
|
|
18
|
-
.filter(plugin => plugin
|
|
39
|
+
list: ctx => listAuthPlugins()
|
|
40
|
+
.filter(plugin => offerable(plugin, ctx))
|
|
19
41
|
.map((plugin): LoginMethod => {
|
|
20
42
|
const meta = plugin.method!
|
|
21
43
|
const type = plugin.type
|
|
@@ -8,6 +8,10 @@ export const reCaptchaPlugin: AuthenticationPlugin = {
|
|
|
8
8
|
// A STEP inside another flow, never a way to sign in — so it is registered and never offered.
|
|
9
9
|
method: { hidden: true },
|
|
10
10
|
|
|
11
|
+
// Its widget is a `Renderer` a panel package assigns. `hidden` already keeps it off the sign-in
|
|
12
|
+
// screen; this is what the flow that DOES drive it can check before handing it a stage.
|
|
13
|
+
requiresRenderer: true,
|
|
14
|
+
|
|
11
15
|
Implementation: Renderer => ({ type, stage, control, params }) => {
|
|
12
16
|
Renderer = Renderer ?? reCaptchaPlugin.Renderer
|
|
13
17
|
|
|
@@ -15,6 +15,10 @@ export const tunnelConsumerUIPlugin: AuthenticationPlugin = {
|
|
|
15
15
|
|
|
16
16
|
method: { order: 400, icon: 'wallet' },
|
|
17
17
|
|
|
18
|
+
// The PIN form is a `Renderer` a panel package assigns; without one the Implementation throws on
|
|
19
|
+
// mount, so the method must not be offered.
|
|
20
|
+
requiresRenderer: true,
|
|
21
|
+
|
|
18
22
|
Implementation: renderer => ({ type, stage, control, params }) => {
|
|
19
23
|
type = type ?? AuthenticationType.WalletConsumer
|
|
20
24
|
const Renderer: TunnelAuthenticationRenderer | undefined = renderer
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FC } from 'react'
|
|
2
2
|
import type { LoginMethodEmphasis } from '@owlmeans/config'
|
|
3
|
+
import type { LoginMethodContext } from '../../login/types.js'
|
|
3
4
|
import type { AuthenticationControl, AuthenticationRenderer, AuthenticationRendererProps, } from '../components/authentication/types.js'
|
|
4
5
|
|
|
5
6
|
export interface AuthenticationPlugin extends Pick<
|
|
@@ -8,6 +9,15 @@ export interface AuthenticationPlugin extends Pick<
|
|
|
8
9
|
type: string
|
|
9
10
|
Implementation: PluginImplemnetation
|
|
10
11
|
Renderer?: AuthenticationRenderer
|
|
12
|
+
/**
|
|
13
|
+
* This plugin's `Implementation` cannot render without a `Renderer` a UI package supplies.
|
|
14
|
+
*
|
|
15
|
+
* It is declared rather than inferred because there is nothing to infer it from: a plugin that
|
|
16
|
+
* renders its own form and one that throws `Renderer is not defined` are the same object until
|
|
17
|
+
* the screen mounts. Declaring it is what lets the sign-in screen leave out a method whose
|
|
18
|
+
* renderer nobody registered, instead of offering a button that crashes the page it opens.
|
|
19
|
+
*/
|
|
20
|
+
requiresRenderer?: boolean
|
|
11
21
|
/**
|
|
12
22
|
* How this method presents itself on the sign-in screen.
|
|
13
23
|
*
|
|
@@ -39,6 +49,18 @@ export interface AuthMethodMeta {
|
|
|
39
49
|
restricted?: boolean
|
|
40
50
|
/** Registered, but never a choice. */
|
|
41
51
|
hidden?: boolean
|
|
52
|
+
/**
|
|
53
|
+
* Whether the application this method is about to be offered in actually wired it.
|
|
54
|
+
*
|
|
55
|
+
* The plugin registry is global and is written to by side-effect imports, so being registered
|
|
56
|
+
* says only that some bundle pulled the module in — and modules arrive in groups. An app that
|
|
57
|
+
* wanted one method out of a package gets every method that package registers, including ones
|
|
58
|
+
* whose first act is to look up a service its context never appended. This is where a plugin
|
|
59
|
+
* says so, per context, at render time; `false` leaves it off the screen.
|
|
60
|
+
*
|
|
61
|
+
* Absent means "always", which is right for a plugin that needs nothing but itself.
|
|
62
|
+
*/
|
|
63
|
+
available?: (ctx: LoginMethodContext) => boolean
|
|
42
64
|
}
|
|
43
65
|
|
|
44
66
|
export interface PluginImplemnetation {
|
package/tests/login.spec.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { makeTestContext } from './context.js'
|
|
|
3
3
|
import { appendLogin, makeLoginService } from '../src/login/service.js'
|
|
4
4
|
import { resolveLoginMethods, primaryLoginMethod, registerMethodSource } from '../src/login/methods.js'
|
|
5
5
|
import { resolveCredit } from '../src/login/credit.js'
|
|
6
|
+
import { pluginMethodSource } from '../src/manager/plugins/methods.js'
|
|
7
|
+
import { registerAuthPlugin } from '../src/manager/plugins/registry.js'
|
|
8
|
+
import type { AuthenticationPlugin } from '../src/manager/plugins/types.js'
|
|
6
9
|
import { resumeAction, ResumeAction } from '../src/login/resume.js'
|
|
7
10
|
import { LoginOutcome } from '../src/login/types.js'
|
|
8
11
|
import type {
|
|
@@ -170,12 +173,44 @@ describe('login method resolution', () => {
|
|
|
170
173
|
})
|
|
171
174
|
|
|
172
175
|
describe('the credit line', () => {
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
const year = new Date().getFullYear()
|
|
177
|
+
|
|
178
|
+
test('is a copyright NOTICE — the mark and the year, not a bare name', () => {
|
|
179
|
+
expect(resolveCredit({ product: 'OwlMeans', organization: 'OwlMeans' }).line)
|
|
180
|
+
.toBe(`© ${year} OwlMeans`)
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
test('pairs the product with the notice when the product is not the holder', () => {
|
|
184
|
+
expect(resolveCredit({ product: 'Taskly', organization: 'Acme' }).line)
|
|
185
|
+
.toBe(`Taskly — © ${year} Acme`)
|
|
175
186
|
})
|
|
176
187
|
|
|
177
188
|
test('falls back to the entity slug when the organization has no name', () => {
|
|
178
|
-
expect(resolveCredit({ product: 'Taskly', entity: 'acme-7f2' }).line)
|
|
189
|
+
expect(resolveCredit({ product: 'Taskly', entity: 'acme-7f2' }).line)
|
|
190
|
+
.toBe(`Taskly — © ${year} acme-7f2`)
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
test('a first year in the past makes the notice a range', () => {
|
|
194
|
+
expect(resolveCredit({ organization: 'Acme', since: 2019 }).line).toBe(`© 2019–${year} Acme`)
|
|
195
|
+
// The current year is not a range, and neither is one a skewed clock puts ahead of it.
|
|
196
|
+
expect(resolveCredit({ organization: 'Acme', since: year }).line).toBe(`© ${year} Acme`)
|
|
197
|
+
expect(resolveCredit({ organization: 'Acme', since: year + 5 }).line).toBe(`© ${year} Acme`)
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
test('an explicit holder is who the notice names', () => {
|
|
201
|
+
expect(resolveCredit({ product: 'Taskly', organization: 'Taskly', holder: 'Acme Inc.' }).line)
|
|
202
|
+
.toBe(`Taskly — © ${year} Acme Inc.`)
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
test('an owner\'s own wording is used verbatim', () => {
|
|
206
|
+
expect(resolveCredit({ organization: 'Acme', copyright: '© Acme. All rights reserved.' }).line)
|
|
207
|
+
.toBe('© Acme. All rights reserved.')
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
test('switching the notice off leaves the bare pairing it used to be', () => {
|
|
211
|
+
expect(resolveCredit({ product: 'Taskly', organization: 'Acme', copyright: false }).line)
|
|
212
|
+
.toBe('Taskly — Acme')
|
|
213
|
+
expect(resolveCredit({ product: 'Taskly', copyright: false }).line).toBe('Taskly')
|
|
179
214
|
})
|
|
180
215
|
|
|
181
216
|
test('a literal line replaces the composition entirely', () => {
|
|
@@ -183,12 +218,70 @@ describe('the credit line', () => {
|
|
|
183
218
|
.toBe('© Acme')
|
|
184
219
|
})
|
|
185
220
|
|
|
221
|
+
test('nobody to name is nothing to render', () => {
|
|
222
|
+
expect(resolveCredit().line).toBeNull()
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
test('an EMPTY value is unset, not a value', () => {
|
|
226
|
+
// Exactly what a platform delivers for branding it does not have: every key present, the
|
|
227
|
+
// undelivered ones empty. `??` does not fall through an empty string, so the organization
|
|
228
|
+
// used to win the chain and compose "pisteva — " with nothing after the dash.
|
|
229
|
+
expect(resolveCredit({}, { name: 'pisteva', organization: '', entity: '' }).line)
|
|
230
|
+
.toBe(`© ${year} pisteva`)
|
|
231
|
+
expect(resolveCredit({ line: '', product: '', organization: '' }, { name: 'Taskly' }).line)
|
|
232
|
+
.toBe(`© ${year} Taskly`)
|
|
233
|
+
expect(resolveCredit({ copyright: ' ' }, { name: 'Taskly' }).line).toBe(`© ${year} Taskly`)
|
|
234
|
+
expect(resolveCredit({}, {}, '').line).toBeNull()
|
|
235
|
+
})
|
|
236
|
+
|
|
186
237
|
test('the platform credit is on unless it is switched off', () => {
|
|
187
238
|
expect(resolveCredit().poweredBy).toBe(true)
|
|
188
239
|
expect(resolveCredit({ poweredBy: false }).poweredBy).toBe(false)
|
|
189
240
|
})
|
|
190
241
|
})
|
|
191
242
|
|
|
243
|
+
describe('the authentication-plugin method source', () => {
|
|
244
|
+
const plugin = (
|
|
245
|
+
over: Partial<AuthenticationPlugin> & { type: string }
|
|
246
|
+
): AuthenticationPlugin => ({ Implementation: () => () => null, ...over })
|
|
247
|
+
|
|
248
|
+
const offered = (context: BasicContext<BasicConfig>): string[] =>
|
|
249
|
+
pluginMethodSource.list(methodCtx(context)).map(item => item.id)
|
|
250
|
+
|
|
251
|
+
test('a plugin that declares no method is not a way to sign in', () => {
|
|
252
|
+
const context = makeTestContext()
|
|
253
|
+
registerAuthPlugin(plugin({ type: 'step-in-a-flow' }))
|
|
254
|
+
registerAuthPlugin(plugin({ type: 'offerable', method: {} }))
|
|
255
|
+
|
|
256
|
+
expect(offered(context)).toContain('offerable')
|
|
257
|
+
expect(offered(context)).not.toContain('step-in-a-flow')
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
test('a plugin that needs a renderer nobody assigned is left off the screen', () => {
|
|
261
|
+
const context = makeTestContext()
|
|
262
|
+
// Exactly the state an app is in when it imported the plugin host but not a panel package:
|
|
263
|
+
// the plugin is registered, and mounting its screen throws.
|
|
264
|
+
registerAuthPlugin(plugin({ type: 'needs-ui', method: {}, requiresRenderer: true }))
|
|
265
|
+
|
|
266
|
+
expect(offered(context)).not.toContain('needs-ui')
|
|
267
|
+
|
|
268
|
+
registerAuthPlugin(plugin({
|
|
269
|
+
type: 'needs-ui', method: {}, requiresRenderer: true, Renderer: () => null,
|
|
270
|
+
}))
|
|
271
|
+
|
|
272
|
+
expect(offered(context)).toContain('needs-ui')
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
test('a plugin whose own wiring is absent says so and is left off', () => {
|
|
276
|
+
const context = makeTestContext()
|
|
277
|
+
registerAuthPlugin(plugin({
|
|
278
|
+
type: 'needs-wiring', method: { available: ctx => ctx.context.hasService('never-appended') },
|
|
279
|
+
}))
|
|
280
|
+
|
|
281
|
+
expect(offered(context)).not.toContain('needs-wiring')
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
|
|
192
285
|
describe('resume outcomes', () => {
|
|
193
286
|
test('map to exactly one action each', () => {
|
|
194
287
|
expect(resumeAction(LoginOutcome.Handled)).toBe(ResumeAction.Stop)
|
package/build/.gitkeep
DELETED
|
File without changes
|