@owlmeans/client-auth 0.1.18-rc.12 → 0.1.18-rc.13
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 +1 -1
- package/build/login/adopt.d.ts +9 -0
- package/build/login/adopt.d.ts.map +1 -1
- package/build/login/adopt.js +11 -0
- package/build/login/adopt.js.map +1 -1
- package/build/login/consts.d.ts +25 -4
- package/build/login/consts.d.ts.map +1 -1
- package/build/login/consts.js +25 -4
- package/build/login/consts.js.map +1 -1
- package/build/login/credit.d.ts +19 -0
- package/build/login/credit.d.ts.map +1 -0
- package/build/login/credit.js +24 -0
- package/build/login/credit.js.map +1 -0
- package/build/login/hook.d.ts +14 -3
- package/build/login/hook.d.ts.map +1 -1
- package/build/login/hook.js +27 -9
- package/build/login/hook.js.map +1 -1
- package/build/login/i18n/be.json +37 -0
- package/build/login/i18n/de.json +37 -0
- package/build/login/i18n/en.json +37 -0
- package/build/login/i18n/es.json +37 -0
- package/build/login/i18n/pl.json +37 -0
- package/build/login/i18n/ru.json +37 -0
- package/build/login/i18n/uk.json +37 -0
- package/build/login/i18n.d.ts +2 -0
- package/build/login/i18n.d.ts.map +1 -0
- package/build/login/i18n.js +25 -0
- package/build/login/i18n.js.map +1 -0
- package/build/login/index.d.ts +7 -0
- package/build/login/index.d.ts.map +1 -1
- package/build/login/index.js +7 -0
- package/build/login/index.js.map +1 -1
- package/build/login/methods.d.ts +25 -0
- package/build/login/methods.d.ts.map +1 -0
- package/build/login/methods.js +97 -0
- package/build/login/methods.js.map +1 -0
- package/build/login/resume.d.ts +20 -0
- package/build/login/resume.d.ts.map +1 -0
- package/build/login/resume.js +33 -0
- package/build/login/resume.js.map +1 -0
- package/build/login/screen.d.ts +4 -0
- package/build/login/screen.d.ts.map +1 -0
- package/build/login/screen.js +63 -0
- package/build/login/screen.js.map +1 -0
- package/build/login/service.d.ts +4 -3
- package/build/login/service.d.ts.map +1 -1
- package/build/login/service.js +57 -4
- package/build/login/service.js.map +1 -1
- package/build/login/surrogate.d.ts +20 -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.d.ts +20 -0
- package/build/login/terms.d.ts.map +1 -0
- package/build/login/terms.js +0 -0
- package/build/login/terms.js.map +1 -0
- package/build/login/types.d.ts +123 -1
- package/build/login/types.d.ts.map +1 -1
- package/build/login/types.js +7 -1
- package/build/login/types.js.map +1 -1
- package/build/manager/plugins/basic-ed25519.d.ts.map +1 -1
- package/build/manager/plugins/basic-ed25519.js +1 -0
- package/build/manager/plugins/basic-ed25519.js.map +1 -1
- package/build/manager/plugins/exports.d.ts +2 -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 +1 -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 +10 -0
- package/build/manager/plugins/methods.d.ts.map +1 -0
- package/build/manager/plugins/methods.js +46 -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 +2 -0
- package/build/manager/plugins/re-captcha.js.map +1 -1
- 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 +19 -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 +1 -0
- package/build/manager/plugins/tunnel-consumer.js.map +1 -1
- package/build/manager/plugins/types.d.ts +31 -0
- package/build/manager/plugins/types.d.ts.map +1 -1
- package/package.json +20 -18
- package/src/login/adopt.ts +12 -0
- package/src/login/consts.ts +31 -4
- package/src/login/credit.ts +37 -0
- package/src/login/hook.ts +28 -11
- package/src/login/i18n/be.json +37 -0
- package/src/login/i18n/de.json +37 -0
- package/src/login/i18n/en.json +37 -0
- package/src/login/i18n/es.json +37 -0
- package/src/login/i18n/pl.json +37 -0
- package/src/login/i18n/ru.json +37 -0
- package/src/login/i18n/uk.json +37 -0
- package/src/login/i18n.ts +26 -0
- package/src/login/index.ts +8 -0
- package/src/login/methods.ts +113 -0
- package/src/login/resume.ts +33 -0
- package/src/login/screen.tsx +122 -0
- package/src/login/service.ts +78 -5
- package/src/login/surrogate.ts +45 -0
- package/src/login/terms.ts +0 -0
- package/src/login/types.ts +132 -1
- package/src/manager/plugins/basic-ed25519.tsx +2 -0
- package/src/manager/plugins/exports.ts +2 -0
- package/src/manager/plugins/index.ts +10 -4
- package/src/manager/plugins/methods.ts +52 -0
- package/src/manager/plugins/re-captcha.tsx +3 -0
- package/src/manager/plugins/registry.ts +26 -0
- package/src/manager/plugins/tunnel-consumer.tsx +2 -0
- package/src/manager/plugins/types.ts +32 -0
- package/tests/login.spec.ts +202 -0
package/build/login/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
1
2
|
import type { LazyService, BasicContext } from '@owlmeans/context';
|
|
3
|
+
import type { LoginMethodEmphasis, LoginScreenConfig, LoginTermsConfig } from '@owlmeans/config';
|
|
2
4
|
/**
|
|
3
5
|
* The context a login plugin is handed.
|
|
4
6
|
*
|
|
@@ -34,11 +36,16 @@ export declare enum LoginOutcome {
|
|
|
34
36
|
Redirected = "redirected",
|
|
35
37
|
/** Cannot proceed without a fresh user gesture — the caller renders a sign-in control. */
|
|
36
38
|
Gesture = "gesture",
|
|
37
|
-
/** Authenticated, but with no channel back to the window that started
|
|
39
|
+
/** Authenticated, but with no channel back to the window that started it. */
|
|
38
40
|
Orphaned = "orphaned",
|
|
39
41
|
/** The attempt ended with no token (blocked window, user closed it, provider refused). */
|
|
40
42
|
Failed = "failed"
|
|
41
43
|
}
|
|
44
|
+
/** Why a surrogate window was opened. */
|
|
45
|
+
export declare enum LoginIntent {
|
|
46
|
+
Login = "login",
|
|
47
|
+
Logout = "logout"
|
|
48
|
+
}
|
|
42
49
|
export interface LoginRequest {
|
|
43
50
|
/** Where the login flow starts — a resolved dispatcher path, or the current address. */
|
|
44
51
|
url: string;
|
|
@@ -51,6 +58,12 @@ export interface LoginRequest {
|
|
|
51
58
|
/** Entrypoint alias to return to after login. */
|
|
52
59
|
target?: string;
|
|
53
60
|
}
|
|
61
|
+
export interface LogoutRequest {
|
|
62
|
+
/** Where a surrogate logout runs — a resolved surrogate path. */
|
|
63
|
+
url: string;
|
|
64
|
+
/** The in-app continuation once the local session is gone. */
|
|
65
|
+
navigate?: () => void | Promise<void>;
|
|
66
|
+
}
|
|
54
67
|
/**
|
|
55
68
|
* A pluggable login mechanic — WHERE the authorization round trip runs.
|
|
56
69
|
*
|
|
@@ -86,19 +99,128 @@ export interface LoginPlugin {
|
|
|
86
99
|
authorize: (ctx: LoginContext, url: string, env: LoginEnv) => Promise<LoginOutcome>;
|
|
87
100
|
/** A bearer token was issued in this document — decide where it goes. */
|
|
88
101
|
complete: (ctx: LoginContext, token: string, env: LoginEnv) => Promise<LoginOutcome>;
|
|
102
|
+
/**
|
|
103
|
+
* This document ALREADY holds a session — decide whether it is useful here.
|
|
104
|
+
*
|
|
105
|
+
* Absent means `Passed`: keep it and carry on, which is what an ordinary tab has always done.
|
|
106
|
+
* A surrogate hands it back to its opener instead, which is the whole point: a popup that
|
|
107
|
+
* discovers an existing session must sign the framed application in, not display the
|
|
108
|
+
* application to itself.
|
|
109
|
+
*
|
|
110
|
+
* Deliberately not `complete`: "a token was just issued here" and "a token was already here"
|
|
111
|
+
* are different facts, and a silent-refresh plugin will need to tell them apart.
|
|
112
|
+
*/
|
|
113
|
+
resume?: (ctx: LoginContext, token: string, env: LoginEnv) => Promise<LoginOutcome>;
|
|
114
|
+
/**
|
|
115
|
+
* Start logout from a user gesture.
|
|
116
|
+
*
|
|
117
|
+
* MUST open any window synchronously, for exactly the reason `begin` must — logging out of a
|
|
118
|
+
* framed application opens a window too. Implement as a NON-async function.
|
|
119
|
+
*/
|
|
120
|
+
logout?: (ctx: LoginContext, request: LogoutRequest, env: LoginEnv) => Promise<LoginOutcome>;
|
|
121
|
+
/** The local session is gone in this document — decide what to tell whom. */
|
|
122
|
+
logoutComplete?: (ctx: LoginContext, env: LoginEnv) => Promise<LoginOutcome>;
|
|
89
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Something that must be true before a login flow may start.
|
|
126
|
+
*
|
|
127
|
+
* SYNCHRONOUS on purpose. `begin` must not cross a microtask boundary before a plugin's
|
|
128
|
+
* `window.open`, or the popup blocker eats the window. A precondition that has to ask a server
|
|
129
|
+
* belongs somewhere else entirely.
|
|
130
|
+
*
|
|
131
|
+
* Returning false stops the flow and resolves `begin` as {@link LoginOutcome.Gesture} — which
|
|
132
|
+
* already means "cannot proceed without a fresh user gesture; render a control", and is exactly
|
|
133
|
+
* the state a user is in after a blocking dialog has opened over the page.
|
|
134
|
+
*/
|
|
135
|
+
export interface LoginPrecondition {
|
|
136
|
+
alias: string;
|
|
137
|
+
/** Higher runs first. Defaults to 0. */
|
|
138
|
+
priority?: number;
|
|
139
|
+
check: (ctx: LoginContext, request: LoginRequest, env: LoginEnv) => boolean;
|
|
140
|
+
}
|
|
141
|
+
/** What a source needs in order to describe the methods it offers. */
|
|
142
|
+
export interface LoginMethodContext {
|
|
143
|
+
context: LoginContext;
|
|
144
|
+
env: LoginEnv;
|
|
145
|
+
/** In-app navigation, when a component supplied it. */
|
|
146
|
+
navigate?: (alias: string, params?: Record<string, string>) => void | Promise<void>;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* One way to sign in, as the screen renders it.
|
|
150
|
+
*
|
|
151
|
+
* `start` is what a button calls. It MUST be callable synchronously from a click — branch on
|
|
152
|
+
* `env.embedded && !env.surrogate` first and open any window before the first `await`.
|
|
153
|
+
*/
|
|
154
|
+
export interface LoginMethod {
|
|
155
|
+
id: string;
|
|
156
|
+
/** Set when an `AuthenticationPlugin` drives this method. */
|
|
157
|
+
type?: string;
|
|
158
|
+
label?: string;
|
|
159
|
+
i18nKey?: string;
|
|
160
|
+
icon?: string;
|
|
161
|
+
order?: number;
|
|
162
|
+
emphasis?: LoginMethodEmphasis;
|
|
163
|
+
restricted?: boolean;
|
|
164
|
+
params?: Record<string, string>;
|
|
165
|
+
start: (ctx: LoginMethodContext) => Promise<LoginOutcome>;
|
|
166
|
+
}
|
|
167
|
+
export interface LoginMethodSource {
|
|
168
|
+
alias: string;
|
|
169
|
+
list: (ctx: LoginMethodContext) => LoginMethod[];
|
|
170
|
+
}
|
|
171
|
+
/** What every rendering of the sign-in screen accepts, whatever its UI family. */
|
|
172
|
+
export interface LoginScreenProps {
|
|
173
|
+
/** The one thing a consuming application is expected to supply. */
|
|
174
|
+
Logo?: ComponentType<{
|
|
175
|
+
className?: string;
|
|
176
|
+
}> | ReactNode;
|
|
177
|
+
title?: ReactNode;
|
|
178
|
+
subtitle?: ReactNode;
|
|
179
|
+
/**
|
|
180
|
+
* `(key, defaultValue) => string`. A prop, never an implicit context read: a component that
|
|
181
|
+
* reaches for an i18n provider crashes the whole render in an app mounted without one.
|
|
182
|
+
*/
|
|
183
|
+
translate?: (key: string, defaultValue: string) => string;
|
|
184
|
+
/** Replace or reorder what the resolver produced. */
|
|
185
|
+
methods?: LoginMethod[] | ((methods: LoginMethod[]) => LoginMethod[]);
|
|
186
|
+
terms?: LoginTermsConfig | false;
|
|
187
|
+
config?: LoginScreenConfig;
|
|
188
|
+
/** Replaces the composed credit line entirely. */
|
|
189
|
+
footer?: ReactNode;
|
|
190
|
+
className?: string;
|
|
191
|
+
containerClassName?: string;
|
|
192
|
+
}
|
|
193
|
+
export type LoginScreenComponent = ComponentType<LoginScreenProps>;
|
|
90
194
|
export interface LoginService extends LazyService {
|
|
91
195
|
registerPlugin: (plugin: LoginPlugin) => void;
|
|
92
196
|
/** Select the active plugin for the given (or default) environment. */
|
|
93
197
|
plugin: (env?: LoginEnv) => LoginPlugin;
|
|
94
198
|
/** The environment the cascade is currently selecting on. */
|
|
95
199
|
env: () => LoginEnv;
|
|
200
|
+
/** Something that must hold before any flow starts. Checked synchronously, in `begin`. */
|
|
201
|
+
registerPrecondition: (precondition: LoginPrecondition) => void;
|
|
202
|
+
/** A source of offerable sign-in methods, scoped to this context. */
|
|
203
|
+
registerMethodSource: (source: LoginMethodSource) => void;
|
|
204
|
+
methods: (ctx: LoginMethodContext) => LoginMethod[];
|
|
205
|
+
/**
|
|
206
|
+
* The screen a dispatcher renders when it cannot proceed.
|
|
207
|
+
*
|
|
208
|
+
* A slot rather than an import, because a relying party (`web-oidc-rp`) must never depend on a
|
|
209
|
+
* UI family (`web-panel` / `mui-panel`) — that edge would force every relying party to pick one.
|
|
210
|
+
*/
|
|
211
|
+
registerScreen: (screen: LoginScreenComponent) => void;
|
|
212
|
+
screen: () => LoginScreenComponent | null;
|
|
96
213
|
enter: () => void;
|
|
97
214
|
begin: (request: LoginRequest) => Promise<LoginOutcome>;
|
|
98
215
|
authorize: (url: string) => Promise<LoginOutcome>;
|
|
99
216
|
complete: (token: string) => Promise<LoginOutcome>;
|
|
217
|
+
resume: (token: string) => Promise<LoginOutcome>;
|
|
218
|
+
logout: (request: LogoutRequest) => Promise<LoginOutcome>;
|
|
219
|
+
logoutComplete: () => Promise<LoginOutcome>;
|
|
100
220
|
/** Adopt an issued bearer token as this context's authentication. */
|
|
101
221
|
adopt: (token: string) => Promise<void>;
|
|
222
|
+
/** Drop this document's authentication. The single de-adoption path. */
|
|
223
|
+
revoke: () => Promise<void>;
|
|
102
224
|
}
|
|
103
225
|
export interface LoginServiceAppend {
|
|
104
226
|
login: () => LoginService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/login/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;
|
|
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;AACrD,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;IAC1F,MAAM,WAAW;CAClB;AAED,yCAAyC;AACzC,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,wFAAwF;IACxF,GAAG,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,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zD,OAAO,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,WAAW,EAAE,CAAA;IACnD;;;;;OAKG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACtD,MAAM,EAAE,MAAM,oBAAoB,GAAG,IAAI,CAAA;IAIzC,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IACvD,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IACjD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IAClD,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IAChD,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IACzD,cAAc,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAA;IAC3C,qEAAqE;IACrE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACvC,wEAAwE;IACxE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,YAAY,CAAA;CAC1B"}
|
package/build/login/types.js
CHANGED
|
@@ -9,9 +9,15 @@ export var LoginOutcome;
|
|
|
9
9
|
LoginOutcome["Redirected"] = "redirected";
|
|
10
10
|
/** Cannot proceed without a fresh user gesture — the caller renders a sign-in control. */
|
|
11
11
|
LoginOutcome["Gesture"] = "gesture";
|
|
12
|
-
/** Authenticated, but with no channel back to the window that started
|
|
12
|
+
/** Authenticated, but with no channel back to the window that started it. */
|
|
13
13
|
LoginOutcome["Orphaned"] = "orphaned";
|
|
14
14
|
/** The attempt ended with no token (blocked window, user closed it, provider refused). */
|
|
15
15
|
LoginOutcome["Failed"] = "failed";
|
|
16
16
|
})(LoginOutcome || (LoginOutcome = {}));
|
|
17
|
+
/** Why a surrogate window was opened. */
|
|
18
|
+
export var LoginIntent;
|
|
19
|
+
(function (LoginIntent) {
|
|
20
|
+
LoginIntent["Login"] = "login";
|
|
21
|
+
LoginIntent["Logout"] = "logout";
|
|
22
|
+
})(LoginIntent || (LoginIntent = {}));
|
|
17
23
|
//# sourceMappingURL=types.js.map
|
package/build/login/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/login/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/login/types.ts"],"names":[],"mappings":"AA+BA,oEAAoE;AACpE,MAAM,CAAN,IAAY,YAaX;AAbD,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,0FAA0F;IAC1F,iCAAiB,CAAA;AACnB,CAAC,EAbW,YAAY,KAAZ,YAAY,QAavB;AAED,yCAAyC;AACzC,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
|
|
@@ -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,oBAqClC,CAAA"}
|
|
@@ -5,6 +5,7 @@ import { makeKeyPairModel } from '@owlmeans/basic-keys';
|
|
|
5
5
|
import { AuthenCredError } from '../errors.js';
|
|
6
6
|
export const ed25519BasicUIPlugin = {
|
|
7
7
|
type: AuthenticationType.BasicEd25519,
|
|
8
|
+
method: { order: 300, icon: 'key', emphasis: 'secondary' },
|
|
8
9
|
Implementation: Renderer => ({ type, stage, control, params }) => {
|
|
9
10
|
type = type ?? AuthenticationType.BasicEd25519;
|
|
10
11
|
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,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,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AAC;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/exports.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/exports.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/manager/plugins/exports.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/manager/plugins/exports.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { AuthenticationPlugin } from './types.js';
|
|
3
|
-
export declare const plugins: {
|
|
4
|
-
[type: ClientAuthType]: AuthenticationPlugin;
|
|
5
|
-
};
|
|
1
|
+
export { plugins, registerAuthPlugin, getAuthPlugin, listAuthPlugins } from './registry.js';
|
|
6
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -2,8 +2,16 @@ import { AuthenticationType } from '@owlmeans/auth';
|
|
|
2
2
|
import { ed25519BasicUIPlugin } from './basic-ed25519.js';
|
|
3
3
|
import { reCaptchaPlugin } from './re-captcha.js';
|
|
4
4
|
import { tunnelConsumerUIPlugin } from './tunnel-consumer.js';
|
|
5
|
-
|
|
5
|
+
import { pluginMethodSource } from './methods.js';
|
|
6
|
+
import { registerMethodSource } from '../../login/methods.js';
|
|
7
|
+
import { plugins } from './registry.js';
|
|
8
|
+
export { plugins, registerAuthPlugin, getAuthPlugin, listAuthPlugins } from './registry.js';
|
|
6
9
|
plugins[AuthenticationType.BasicEd25519] = ed25519BasicUIPlugin;
|
|
7
10
|
plugins[AuthenticationType.ReCaptcha] = reCaptchaPlugin;
|
|
8
11
|
plugins[AuthenticationType.WalletConsumer] = tunnelConsumerUIPlugin;
|
|
12
|
+
// Registered from here, not from `login/`, so that importing `@owlmeans/client-auth/login` never
|
|
13
|
+
// drags this module's React plugin implementations into a bundle that only wanted the login host.
|
|
14
|
+
// A generated application imports the login subpath through `client-iam`; it must not gain three
|
|
15
|
+
// authentication methods it never registered as a side effect of that.
|
|
16
|
+
registerMethodSource(pluginMethodSource);
|
|
9
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/manager/plugins/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/manager/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE3F,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,GAAG,oBAAoB,CAAA;AAC/D,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,eAAe,CAAA;AACvD,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,GAAG,sBAAsB,CAAA;AAEnE,iGAAiG;AACjG,kGAAkG;AAClG,iGAAiG;AACjG,uEAAuE;AACvE,oBAAoB,CAAC,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LoginMethodSource } from '../../login/types.js';
|
|
2
|
+
/**
|
|
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
|
+
*/
|
|
9
|
+
export declare const pluginMethodSource: LoginMethodSource;
|
|
10
|
+
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/methods.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,iBAAiB,EAAgB,MAAM,sBAAsB,CAAA;AAGxF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAsChC,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CAUTHEN_AUTHEN_TYPED } from '@owlmeans/auth';
|
|
2
|
+
import { DEFAULT_METHOD_ORDER, LOGIN_SERVICE } from '../../login/consts.js';
|
|
3
|
+
import { listAuthPlugins } from './registry.js';
|
|
4
|
+
/**
|
|
5
|
+
* Every registered authentication plugin that declares itself offerable, as a sign-in method.
|
|
6
|
+
*
|
|
7
|
+
* A plugin without `method` is deliberately invisible here: `re-captcha` is a STEP inside another
|
|
8
|
+
* flow, not a way to sign in, and a registry that offered everything registered would put it on
|
|
9
|
+
* the screen as a choice.
|
|
10
|
+
*/
|
|
11
|
+
export const pluginMethodSource = {
|
|
12
|
+
alias: 'authentication-plugins',
|
|
13
|
+
list: () => listAuthPlugins()
|
|
14
|
+
.filter(plugin => plugin.method != null && plugin.method.hidden !== true)
|
|
15
|
+
.map((plugin) => {
|
|
16
|
+
const meta = plugin.method;
|
|
17
|
+
const type = plugin.type;
|
|
18
|
+
const id = meta.id ?? type;
|
|
19
|
+
return {
|
|
20
|
+
id, type,
|
|
21
|
+
...(meta.label != null ? { label: meta.label } : {}),
|
|
22
|
+
i18nKey: meta.i18nKey ?? id,
|
|
23
|
+
...(meta.icon != null ? { icon: meta.icon } : {}),
|
|
24
|
+
order: meta.order ?? DEFAULT_METHOD_ORDER,
|
|
25
|
+
...(meta.emphasis != null ? { emphasis: meta.emphasis } : {}),
|
|
26
|
+
...(meta.restricted === true ? { restricted: true } : {}),
|
|
27
|
+
params: { type },
|
|
28
|
+
// Non-async through the whole chain: `login.begin` opens the surrogate window in its first
|
|
29
|
+
// statement, and a window opened after the gesture has been handled is blocked.
|
|
30
|
+
start: methodCtx => {
|
|
31
|
+
const login = methodCtx.context.service(LOGIN_SERVICE);
|
|
32
|
+
const entrypoint = methodCtx.context.entrypoint(CAUTHEN_AUTHEN_TYPED);
|
|
33
|
+
const url = entrypoint.getPath().replace(':type', encodeURIComponent(type));
|
|
34
|
+
return login.begin({
|
|
35
|
+
url,
|
|
36
|
+
// In an ordinary tab this keeps the application mounted, exactly as the pre-chooser
|
|
37
|
+
// dispatcher did; the surrogate plugin ignores it and opens a window instead.
|
|
38
|
+
...(methodCtx.navigate != null
|
|
39
|
+
? { navigate: () => methodCtx.navigate?.(CAUTHEN_AUTHEN_TYPED, { type }) }
|
|
40
|
+
: {}),
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=methods.js.map
|
|
@@ -0,0 +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;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,KAAK,EAAE,wBAAwB;IAE/B,IAAI,EAAE,GAAG,EAAE,CAAC,eAAe,EAAE;SAC1B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC;SACxE,GAAG,CAAC,CAAC,MAAM,EAAe,EAAE;QAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAO,CAAA;QAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,CAAA;QAE1B,OAAO;YACL,EAAE,EAAE,IAAI;YACR,G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,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,oBA6B7B,CAAA"}
|
|
@@ -3,6 +3,8 @@ import { AuthenticationStage, AuthenticationType } from '@owlmeans/auth';
|
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
export const reCaptchaPlugin = {
|
|
5
5
|
type: AuthenticationType.ReCaptcha,
|
|
6
|
+
// A STEP inside another flow, never a way to sign in — so it is registered and never offered.
|
|
7
|
+
method: { hidden: true },
|
|
6
8
|
Implementation: Renderer => ({ type, stage, control, params }) => {
|
|
7
9
|
Renderer = Renderer ?? reCaptchaPlugin.Renderer;
|
|
8
10
|
// 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,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I,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,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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ClientAuthType } from '../components/authentication/types.js';
|
|
2
|
+
import type { AuthenticationPlugin } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The registry every authentication plugin lands in.
|
|
5
|
+
*
|
|
6
|
+
* It stays a plain exported object, and every registration stays a plain assignment, because four
|
|
7
|
+
* packages already write into it from side-effect imports (`web-oidc-rp`, `mui-oidc-rp`,
|
|
8
|
+
* `web-auth`, and this package's own `index`). Hiding it behind an API would break all of them for
|
|
9
|
+
* no gain — the functions below simply read it.
|
|
10
|
+
*
|
|
11
|
+
* It lives in its own module rather than in `index.ts` so that the method source can read it
|
|
12
|
+
* without the two importing each other.
|
|
13
|
+
*/
|
|
14
|
+
export declare const plugins: {
|
|
15
|
+
[type: ClientAuthType]: AuthenticationPlugin;
|
|
16
|
+
};
|
|
17
|
+
export declare const registerAuthPlugin: (plugin: AuthenticationPlugin) => AuthenticationPlugin;
|
|
18
|
+
export declare const getAuthPlugin: (type: ClientAuthType) => AuthenticationPlugin | undefined;
|
|
19
|
+
export declare const listAuthPlugins: () => AuthenticationPlugin[];
|
|
20
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,EAAE;IAAE,CAAC,IAAI,EAAE,cAAc,GAAG,oBAAoB,CAAA;CAAO,CAAA;AAE3E,eAAO,MAAM,kBAAkB,WAAY,oBAAoB,KAAG,oBAIjE,CAAA;AAED,eAAO,MAAM,aAAa,SAAU,cAAc,KAAG,oBAAoB,GAAG,SAC7D,CAAA;AAEf,eAAO,MAAM,eAAe,QAAO,oBAAoB,EAA4B,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The registry every authentication plugin lands in.
|
|
3
|
+
*
|
|
4
|
+
* It stays a plain exported object, and every registration stays a plain assignment, because four
|
|
5
|
+
* packages already write into it from side-effect imports (`web-oidc-rp`, `mui-oidc-rp`,
|
|
6
|
+
* `web-auth`, and this package's own `index`). Hiding it behind an API would break all of them for
|
|
7
|
+
* no gain — the functions below simply read it.
|
|
8
|
+
*
|
|
9
|
+
* It lives in its own module rather than in `index.ts` so that the method source can read it
|
|
10
|
+
* without the two importing each other.
|
|
11
|
+
*/
|
|
12
|
+
export const plugins = {};
|
|
13
|
+
export const registerAuthPlugin = (plugin) => {
|
|
14
|
+
plugins[plugin.type] = plugin;
|
|
15
|
+
return plugin;
|
|
16
|
+
};
|
|
17
|
+
export const getAuthPlugin = (type) => plugins[type];
|
|
18
|
+
export const listAuthPlugins = () => Object.values(plugins);
|
|
19
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/manager/plugins/registry.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO,GAAqD,EAAE,CAAA;AAE3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAA4B,EAAwB,EAAE;IACvF,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;IAE7B,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAoB,EAAoC,EAAE,CACtF,OAAO,CAAC,IAAI,CAAC,CAAA;AAEf,MAAM,CAAC,MAAM,eAAe,GAAG,GAA2B,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,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,oBAgEpC,CAAA"}
|
|
@@ -7,6 +7,7 @@ import { RELY_ACTION_TIMEOUT, RELY_PIN_PERFIX } from '@owlmeans/auth-common';
|
|
|
7
7
|
import { createWalletFacade } from './tunnel/wallet.js';
|
|
8
8
|
export const tunnelConsumerUIPlugin = {
|
|
9
9
|
type: AuthenticationType.WalletConsumer,
|
|
10
|
+
method: { order: 400, icon: 'wallet' },
|
|
10
11
|
Implementation: renderer => ({ type, stage, control, params }) => {
|
|
11
12
|
type = type ?? AuthenticationType.WalletConsumer;
|
|
12
13
|
const Renderer = renderer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel-consumer.js","sourceRoot":"","sources":["../../../src/manager/plugins/tunnel-consumer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAI3G,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,CAAC,MAAM,sBAAsB,GAAyB;IAC1D,IAAI,EAAE,kBAAkB,CAAC,cAAc;IAEvC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC/D,IAAI,GAAG,IAAI,IAAI,kBAAkB,CAAC,cAAc,CAAA;QAChD,MAAM,QAAQ,GAA6C,QAAQ;eAC9D,sBAAsB,CAAC,QAAQ,CAAA;QAEpC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,CAAA;QAErC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,IAAI,WAAW,CAAC,mDAAmD,CA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AA8B,EAAE,EAAE,CAAC,KAAK,EAAE,IAAa,EAAE,EAAE;IAC/F,MAAM,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,cAAc,CAAC,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,9 +1,40 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
+
import type { LoginMethodEmphasis } from '@owlmeans/config';
|
|
2
3
|
import type { AuthenticationControl, AuthenticationRenderer, AuthenticationRendererProps } from '../components/authentication/types.js';
|
|
3
4
|
export interface AuthenticationPlugin extends Pick<AuthenticationControl, "beforeAuthenticate" | "afterAuthenticate">, Pick<Partial<AuthenticationControl>, "authenticate"> {
|
|
4
5
|
type: string;
|
|
5
6
|
Implementation: PluginImplemnetation;
|
|
6
7
|
Renderer?: AuthenticationRenderer;
|
|
8
|
+
/**
|
|
9
|
+
* How this method presents itself on the sign-in screen.
|
|
10
|
+
*
|
|
11
|
+
* Absent means the plugin is never OFFERED — it is still reachable by type, which is what a
|
|
12
|
+
* step-in-a-flow (re-captcha) and a plugin an app deep-links to both need. Every field is
|
|
13
|
+
* optional so an existing plugin object keeps type-checking without being touched.
|
|
14
|
+
*/
|
|
15
|
+
method?: AuthMethodMeta;
|
|
16
|
+
}
|
|
17
|
+
export interface AuthMethodMeta {
|
|
18
|
+
/** Defaults to the plugin's `type`. */
|
|
19
|
+
id?: string;
|
|
20
|
+
/** Literal fallback used when no translation resolves. */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** Key under the `auth` library's `login.method.*`; defaults to the id. */
|
|
23
|
+
i18nKey?: string;
|
|
24
|
+
/** Icon registry NAME, never markup — this package must stay free of an icon library. */
|
|
25
|
+
icon?: string;
|
|
26
|
+
/** Ascending; default 100. */
|
|
27
|
+
order?: number;
|
|
28
|
+
emphasis?: LoginMethodEmphasis;
|
|
29
|
+
/**
|
|
30
|
+
* Never offered unless the configuration explicitly enables it.
|
|
31
|
+
*
|
|
32
|
+
* This is the secret-key gate: an operator login is registered like any other method and must
|
|
33
|
+
* not become offerable merely by being registered.
|
|
34
|
+
*/
|
|
35
|
+
restricted?: boolean;
|
|
36
|
+
/** Registered, but never a choice. */
|
|
37
|
+
hidden?: boolean;
|
|
7
38
|
}
|
|
8
39
|
export interface PluginImplemnetation {
|
|
9
40
|
(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,qBAAqB,EAAE,sBA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;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;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.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -50,24 +50,26 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@owlmeans/auth": "^0.1.18-rc.
|
|
54
|
-
"@owlmeans/auth-common": "^0.1.18-rc.
|
|
55
|
-
"@owlmeans/basic-envelope": "^0.1.18-rc.
|
|
56
|
-
"@owlmeans/basic-keys": "^0.1.18-rc.
|
|
57
|
-
"@owlmeans/client": "^0.1.18-rc.
|
|
58
|
-
"@owlmeans/client-context": "^0.1.18-rc.
|
|
59
|
-
"@owlmeans/client-
|
|
60
|
-
"@owlmeans/client-
|
|
61
|
-
"@owlmeans/client-resource": "^0.1.18-rc.
|
|
62
|
-
"@owlmeans/client-socket": "^0.1.18-rc.
|
|
53
|
+
"@owlmeans/auth": "^0.1.18-rc.7",
|
|
54
|
+
"@owlmeans/auth-common": "^0.1.18-rc.9",
|
|
55
|
+
"@owlmeans/basic-envelope": "^0.1.18-rc.9",
|
|
56
|
+
"@owlmeans/basic-keys": "^0.1.18-rc.9",
|
|
57
|
+
"@owlmeans/client": "^0.1.18-rc.10",
|
|
58
|
+
"@owlmeans/client-context": "^0.1.18-rc.9",
|
|
59
|
+
"@owlmeans/client-entrypoint": "^0.1.18-rc.9",
|
|
60
|
+
"@owlmeans/client-flow": "^0.1.18-rc.11",
|
|
61
|
+
"@owlmeans/client-resource": "^0.1.18-rc.9",
|
|
62
|
+
"@owlmeans/client-socket": "^0.1.18-rc.9",
|
|
63
|
+
"@owlmeans/config": "^0.1.18-rc.8",
|
|
63
64
|
"@owlmeans/context": "^0.1.18-rc.6",
|
|
64
|
-
"@owlmeans/did": "^0.1.18-rc.
|
|
65
|
+
"@owlmeans/did": "^0.1.18-rc.9",
|
|
66
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.8",
|
|
65
67
|
"@owlmeans/error": "^0.1.18-rc.6",
|
|
66
|
-
"@owlmeans/flow": "^0.1.18-rc.
|
|
67
|
-
"@owlmeans/
|
|
68
|
+
"@owlmeans/flow": "^0.1.18-rc.10",
|
|
69
|
+
"@owlmeans/i18n": "^0.1.18-rc.6",
|
|
68
70
|
"@owlmeans/resource": "^0.1.18-rc.7",
|
|
69
|
-
"@owlmeans/socket": "^0.1.18-rc.
|
|
70
|
-
"@owlmeans/web-flow": "^0.1.18-rc.
|
|
71
|
+
"@owlmeans/socket": "^0.1.18-rc.7",
|
|
72
|
+
"@owlmeans/web-flow": "^0.1.18-rc.11",
|
|
71
73
|
"@scure/base": "^2.3.0"
|
|
72
74
|
},
|
|
73
75
|
"peerDependencies": {
|
|
@@ -76,8 +78,8 @@
|
|
|
76
78
|
},
|
|
77
79
|
"devDependencies": {
|
|
78
80
|
"@owlmeans/dep-config": "workspace:*",
|
|
79
|
-
"@owlmeans/test-auth": "^0.1.18-rc.
|
|
80
|
-
"@types/bun": "^1.
|
|
81
|
+
"@owlmeans/test-auth": "^0.1.18-rc.9",
|
|
82
|
+
"@types/bun": "^1.4.0",
|
|
81
83
|
"@types/react": "^19.2.17",
|
|
82
84
|
"nodemon": "^3.1.14",
|
|
83
85
|
"typescript": "^7.0.2"
|
package/src/login/adopt.ts
CHANGED
|
@@ -17,3 +17,15 @@ import type { LoginContext } from './types.js'
|
|
|
17
17
|
export const adoptToken = async (ctx: LoginContext, token: string): Promise<void> => {
|
|
18
18
|
await ctx.service<AuthService>(AUTH_ALIAS).update(token)
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The one path this context's authentication is dropped, and the exact mirror of {@link adoptToken}.
|
|
23
|
+
*
|
|
24
|
+
* `undefined`, not `null`: `undefined` is the declared clearing value, and on the web the auth
|
|
25
|
+
* service reacts to it by navigating to the dispatcher. Everything that signs a user out goes
|
|
26
|
+
* through here — the hook, both browser plugins and the surrogate screen — so there is one place
|
|
27
|
+
* where "signed out" is defined rather than four that agree until one of them changes.
|
|
28
|
+
*/
|
|
29
|
+
export const revokeToken = async (ctx: LoginContext): Promise<void> => {
|
|
30
|
+
await ctx.service<AuthService>(AUTH_ALIAS).update(undefined)
|
|
31
|
+
}
|