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>
52 lines
2.2 KiB
C#
52 lines
2.2 KiB
C#
using System.Text.Json.Nodes;
|
|
using Febe.Core.Collection;
|
|
using Febe.Core.Collection.Requests;
|
|
|
|
namespace Febe.Tests.Collection.Support;
|
|
|
|
/// <summary>
|
|
/// The shipped Instagram catalog as it would be once the «pending» sources are settled for some operations: their
|
|
/// headers and fields with a «pending» source dropped and the operation configured (the «page» section already names a
|
|
/// place for every session value they use). Only for the tests of the site client contract, which need an Instagram
|
|
/// operation the guard lets through; the shipped file keeps them not configured (rule 9).
|
|
/// </summary>
|
|
public static class SettledCatalog
|
|
{
|
|
/// <summary>The operations whose variables the shapes show whole (only headers and fields still «pending» wait).</summary>
|
|
public static IReadOnlyList<string> KnownVariables { get; } =
|
|
[
|
|
"PolarisProfileReelsTabContentQuery", "PolarisProfileTaggedTabContentQuery",
|
|
"PolarisProfileStoryHighlightsTrayContentQuery", "media-info",
|
|
];
|
|
|
|
/// <summary>The Instagram catalog with <paramref name="names"/> (by default <see cref="KnownVariables"/>) settled.</summary>
|
|
public static RequestCatalog Instagram(params string[] names)
|
|
{
|
|
var settle = names.Length == 0 ? KnownVariables : names;
|
|
var file = JsonNode.Parse(SiteMap.ReadEmbeddedText("richieste.instagram.json"))!.AsObject();
|
|
foreach (var operation in file["operations"]!.AsArray().Select(o => o!.AsObject()))
|
|
{
|
|
if (!settle.Contains(operation["name"]!.GetValue<string>()))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
foreach (var part in new[] { "headers", "body" })
|
|
{
|
|
if (operation[part] is JsonObject sources)
|
|
{
|
|
foreach (var key in sources.Where(s => s.Value?.GetValue<string>() == "pending").Select(s => s.Key).ToList())
|
|
{
|
|
sources.Remove(key);
|
|
}
|
|
}
|
|
}
|
|
|
|
operation["configured"] = true;
|
|
operation.Remove("reason");
|
|
}
|
|
|
|
return RequestCatalog.Parse(file.ToJsonString(), "richieste.instagram.json (sistemato per le prove)");
|
|
}
|
|
}
|