Sessione salvata cifrata, copiata a «Ho finito» (#36, S4)
Il client del sito ha bisogno della sessione del browser di Febe: ora la copia c'è, cifrata e dietro un interruttore, senza cambiare nulla di predefinito. - Opzione «raccolta» (pagine predefinita, richieste): solo con «richieste» e almeno un'operazione configurata si costruiscono sessione salvata, client del sito e copia. Con Instagram nulla cambia: le dieci operazioni restano non configurate (mancano __spin_*, __req, __s, __dyn, __csr e altri). - Cookie con dominio, percorso, solo-host, Secure, HttpOnly e scadenza, mandati solo dove il browser li manderebbe (RFC 6265). - Sezione «page» del catalogo: dove la pagina tiene ogni valore; nuovi campi rev, hs, hsi, dpr, ccg, comet_req, entry_nonce. Il caricatore rifiuta un'operazione configurata con un valore di sessione senza fonte nella pagina. - Dati/sessione/sessione.json: DPAPI su Windows, AES-256-GCM in Docker (chiave da FEBE_CHIAVE_SESSIONE o chiave.bin), scrittura atomica, file illeggibile = nessuna sessione. «Scollega» la cancella; chiave.bin resta. - Copia a «Ho finito» con Network.getCookies e una sola Runtime.evaluate in sola lettura, solo da una pagina del sito e finché dura il permesso di guida. - FEBE_PASSWORD e FEBE_CHIAVE_SESSIONE non passano a Chromium, Xvfb, ffmpeg. - Sito di prova: csrftoken, cookie limitato a /api/, registro di moduli suo. - Revisione su tre lenti: 11 punti confermati, tutti corretti. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3046b2da47
commit
c87768766c
69 files changed
+5936
-415
No files matched your search
@@ -207,13 +207,23 @@ public sealed partial class TestSite : IAsyncDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Control.IsSession(context.Request.Cookies[SessionCookie]))
|
||||
var opened = !Control.IsSession(context.Request.Cookies[SessionCookie]);
|
||||
if (opened)
|
||||
{
|
||||
// No cookie, or one the site ended (a session that expired, a reset): the visit is a new login, with a new
|
||||
// value that the site client accepts too once copied.
|
||||
context.Response.Cookies.Append(SessionCookie, Control.OpenSession(), new CookieOptions { Path = "/", MaxAge = TimeSpan.FromDays(1), SameSite = SameSiteMode.Lax, HttpOnly = true });
|
||||
}
|
||||
|
||||
if (opened || string.IsNullOrEmpty(context.Request.Cookies[CsrfCookie]))
|
||||
{
|
||||
// What a real site gives its pages besides the session (issue #36, S4): the token the page reads and sends
|
||||
// back in x-csrftoken, and a cookie only for the addresses under /api/, which the copy at «Ho finito» must
|
||||
// keep with its path.
|
||||
context.Response.Cookies.Append(CsrfCookie, Control.NextCsrf(), new CookieOptions { Path = "/", MaxAge = TimeSpan.FromDays(1), SameSite = SameSiteMode.Lax });
|
||||
context.Response.Cookies.Append(ApiPathCookie, ApiPathCookieValue, new CookieOptions { Path = ApiPath, MaxAge = TimeSpan.FromDays(1), SameSite = SameSiteMode.Lax, HttpOnly = true });
|
||||
}
|
||||
|
||||
var segments = path.Split('/', StringSplitOptions.RemoveEmptyEntries).Select(Uri.UnescapeDataString).ToArray();
|
||||
string html;
|
||||
var status = 200;
|
||||
@@ -265,6 +275,15 @@ public sealed partial class TestSite : IAsyncDisposable
|
||||
html = html.Replace("<body ", "<body data-memoria-ricerca=\"si\" ", StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
// The modules of the page (issue #36, S4): what the copy at «Ho finito» reads, by the names of richieste.prova.json.
|
||||
string registry;
|
||||
lock (World.Gate)
|
||||
{
|
||||
registry = ModuleRegistryScript(World.Viewer.Id);
|
||||
}
|
||||
|
||||
html = InsertAfterHead(html, registry);
|
||||
|
||||
await HtmlAsync(context, status, html).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user