/* * SPDX-FileCopyrightText: oxmc / PawletOS * SPDX-License-Identifier: Apache-2.0 */ package pawletos.cache; interface IPawletCacheService { // Rewrites originUrl to a local cache URL if a trusted cache server is // currently active and its allowlist covers this origin; otherwise // returns originUrl unchanged. Never blocks on network — resolution // reads state refreshed in the background (see PawletCacheService), // so this is safe to call before every download. String resolveAssetUrl(String originUrl); // Base64 SHA-256 of the active cache's TLS SubjectPublicKeyInfo, for the // caller to pin its HTTPS connection against — the cache's cert is // self-signed, this fingerprint (verified against the signed CacheToken) // is the actual trust anchor, not a CA chain. Null if no cache is active. String getActiveCacheTlsSpkiSha256(); // Diagnostics for a future settings UI. boolean isCacheActive(); String getActiveCacheHost(); }