Adapt the failing direct sign-up tests to the declarer notification decision
This commit is contained in:
@@ -1337,6 +1337,47 @@ async function directSignup(): Promise<void> {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A direct sign-up to an event whose declarer is NOT the participant's contact
|
||||
* (FP-001, R6/R7): Alice signs up to Carol's event CE, Carol being no contact of
|
||||
* hers. The declarer is told, anonymously, and gains no right to read the act, the
|
||||
* list or the participations. Runs once CE exists (forged.setup-carol-meeting-point).
|
||||
*/
|
||||
async function directSignupToDeclared(): Promise<void> {
|
||||
const G = "direct sign-up to CE (Alice; Carol declared CE and is not Alice's contact)";
|
||||
const alice = (): ApodsSession => need(S.alice, 'Alice');
|
||||
const carol = (): ApodsSession => need(S.carol, 'Carol');
|
||||
const CE = (): string => need(S.CE, "Carol's event CE");
|
||||
const noticed = (change: 'join' | 'leave'): Promise<CheckOutcome> =>
|
||||
notifiedLine(CE(), change, false, { creator: carol(), participant: alice(), name: USERS.alice });
|
||||
await m.hard('direct.notify-anonymous', G, 'Alice posts a Join naming CE: Carol, its declarer, is notified in her own inbox, naming neither her name nor her WebID', 'a join notification about CE naming neither the display name nor the WebID, within 30 s', async () => {
|
||||
await postOutboxActivity(alice(), 'Join', CE(), appActorUri(config));
|
||||
return noticed('join');
|
||||
});
|
||||
await m.hard('direct.activity-declarer-refused', G, "Carol — CE's declarer, not her contact — GETs Alice's Join naming CE (its URI handed out of band)", 'refused 403', async () => {
|
||||
const act = need(await poll(() => ownActivity(alice(), 'Join', CE()), v => !!v, 15000), "Alice's Join naming CE");
|
||||
const r = await http('GET', need(recordUri(act), "the Join's URI"), { token: carol().token });
|
||||
return { ok: refused(r.status, AUTHN), actual: brief(r).slice(0, 80) };
|
||||
});
|
||||
await m.hard('direct.list-opaque', G, "CE's own attendee list (anonymous read) holds Alice's member URN, computed from her secret with CE as anchor, and no WebID", 'her URN ∈ items, her WebID ∉ items', async () => {
|
||||
const list = need(await attachedCollection(CE(), carol()), "CE's attendees collection");
|
||||
const urn = await ownMemberUrn(alice(), CE());
|
||||
const r = await refIn(list, urn, true);
|
||||
return { ok: r.ok && !r.items.includes(alice().webId), actual: `HTTP ${r.status} items=${JSON.stringify(r.items)}` };
|
||||
});
|
||||
await m.hard('direct.declarer-refused-participations', G, "Carol, the declarer and no contact of Alice, is refused Alice's participations collection although it lists CE (URI handed out of band)", 'refused (403, or the pod\'s 404 while Alice reads it 200)', async () => {
|
||||
const uri = need(await ownParticipations(alice()), 'her participations collection');
|
||||
const listed = await refIn(uri, CE(), true, alice().token);
|
||||
need(listed.ok, 'the direct sign-up landed (direct.notify-anonymous)');
|
||||
const refusal = await collectionRefusal(uri, carol().token, alice(), AUTHN);
|
||||
return { ok: refusal.ok, actual: refusal.actual };
|
||||
});
|
||||
await m.hard('direct.leave-notify-anonymous', G, 'Alice posts a Leave naming CE (the group leaves the event as it found it): Carol is notified of the withdrawal, anonymously', 'a leave notification about CE naming neither the display name nor the WebID, within 30 s', async () => {
|
||||
await postOutboxActivity(alice(), 'Leave', CE(), appActorUri(config));
|
||||
return noticed('leave');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Who reads a person's participations is her /contacts WAC group, through ONE
|
||||
* stable `acl:agentGroup` grant the backend never revisits: the platform keeps the
|
||||
@@ -1893,6 +1934,7 @@ async function cleanupAccounts(): Promise<void> {
|
||||
await directSignup();
|
||||
await visibility();
|
||||
await forgedContact();
|
||||
await directSignupToDeclared();
|
||||
await contactChanges();
|
||||
} finally {
|
||||
await uiHygiene();
|
||||
|
||||
Reference in New Issue
Block a user