refactor: une application ne fournit pas sa propre identité
configure() acceptait un champ currentUser publié. Il faisait manier à l'appelant ce que la cible ne lui remettra jamais : en amont, session_start reçoit un identifiant qui VIENT du portefeuille qu'une personne a ouvert. Et il rouvrait la porte qu'on venait de fermer : renseigné, il fait sauter la barrière en page de tête — exactement le comportement retiré au commit précédent. Un commentaire disait « rien de ce qu'expédie une application ne fait ça » ; c'est une note, pas un mécanisme, et une exception nommée cesse d'en être une dès qu'elle est publiée. Personne ne s'en servait — aucun test, aucun harnais, aucun exemple. Un symbole gardé parce qu'il était déjà là n'est pas une décision. Le chemin interne subsiste pour les harnais qui pilotent la surface sans navigateur, mais il n'est plus atteignable depuis la surface publiée.
This commit is contained in:
@@ -31,7 +31,6 @@ export interface EventuallyConfig {
|
|||||||
getSession?: () => Promise<RegistrySession>; // resolve the session (a thunk)
|
getSession?: () => Promise<RegistrySession>; // resolve the session (a thunk)
|
||||||
normalizeId?: (id: string) => string;
|
normalizeId?: (id: string) => string;
|
||||||
sharedWallet?: SharedWalletConfig; // { fileUrl, password, importUrl? }
|
sharedWallet?: SharedWalletConfig; // { fileUrl, password, importUrl? }
|
||||||
currentUser?: PrincipalId;
|
|
||||||
debugAccessLog?: boolean;
|
debugAccessLog?: boolean;
|
||||||
init?: (...args: any[]) => any;
|
init?: (...args: any[]) => any;
|
||||||
initNg?: (...args: any[]) => any;
|
initNg?: (...args: any[]) => any;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ export interface EventuallyConfig {
|
|||||||
normalizeId?: (id: string) => string;
|
normalizeId?: (id: string) => string;
|
||||||
pointerGuard?: { attempts?: number; baseMs?: number; maxStepMs?: number };
|
pointerGuard?: { attempts?: number; baseMs?: number; maxStepMs?: number };
|
||||||
sharedWallet?: SharedWalletConfig; // the gate's, § 2bis
|
sharedWallet?: SharedWalletConfig; // the gate's, § 2bis
|
||||||
currentUser?: PrincipalId;
|
|
||||||
debugAccessLog?: boolean;
|
debugAccessLog?: boolean;
|
||||||
init?: (...args: any[]) => any;
|
init?: (...args: any[]) => any;
|
||||||
initNg?: (...args: any[]) => any;
|
initNg?: (...args: any[]) => any;
|
||||||
|
|||||||
@@ -85,8 +85,6 @@ export interface EventuallyConfig {
|
|||||||
* itself. Disappears with the gate: upstream a user opens their own wallet.
|
* itself. Disappears with the gate: upstream a user opens their own wallet.
|
||||||
*/
|
*/
|
||||||
sharedWallet?: SharedWalletConfig;
|
sharedWallet?: SharedWalletConfig;
|
||||||
/** Initial current user; may also be set later via {@link setCurrentUser}. */
|
|
||||||
currentUser?: PrincipalId;
|
|
||||||
/**
|
/**
|
||||||
* Turn on the OFF-by-default document access log (see {@link ./access-log}):
|
* Turn on the OFF-by-default document access log (see {@link ./access-log}):
|
||||||
* every real read/write is printed, prefixed by the active identity, to
|
* every real read/write is printed, prefixed by the active identity, to
|
||||||
@@ -135,7 +133,10 @@ let caps = new CapRegistry(capsHolder);
|
|||||||
|
|
||||||
export function configure(c: EventuallyConfig): void {
|
export function configure(c: EventuallyConfig): void {
|
||||||
cfg = c;
|
cfg = c;
|
||||||
currentUser = c.currentUser ?? null;
|
// Not taken from the config: an application never supplies its own identity — upstream
|
||||||
|
// it comes FROM the wallet a person opened. Accepting one here would also let a caller
|
||||||
|
// skip the barrier on a top-level page, which is the one thing it exists to prevent.
|
||||||
|
currentUser = null;
|
||||||
setAccessLog(c.debugAccessLog ?? false);
|
setAccessLog(c.debugAccessLog ?? false);
|
||||||
// The session wiring is part of the same act — see {@link EventuallyConfig}. Omitted
|
// The session wiring is part of the same act — see {@link EventuallyConfig}. Omitted
|
||||||
// only by unit suites that never touch the registry; those get the same
|
// only by unit suites that never touch the registry; those get the same
|
||||||
|
|||||||
Reference in New Issue
Block a user