Address remaining safe security hardening

This commit is contained in:
BigBodyCobain
2026-06-02 13:34:11 -06:00
parent 10a8c7b5be
commit c3dd95f6a9
14 changed files with 94 additions and 47 deletions
+2 -2
View File
@@ -7,7 +7,7 @@
},
{
"name": "BBC",
"url": "http://feeds.bbci.co.uk/news/world/rss.xml",
"url": "https://feeds.bbci.co.uk/news/world/rss.xml",
"weight": 3
},
{
@@ -47,7 +47,7 @@
},
{
"name": "Xinhua",
"url": "http://www.news.cn/english/rss/worldrss.xml",
"url": "https://www.news.cn/english/rss/worldrss.xml",
"weight": 2
},
{
+5
View File
@@ -167,6 +167,11 @@ def cmd_hash(args: argparse.Namespace) -> int:
print("")
print("Updater pin:")
print(f"MESH_UPDATE_SHA256={digest}")
print("")
print("Release checklist:")
print(" - add this digest to SHA256SUMS.txt for the GitHub release")
print(" - add/update backend/data/release_digests.json for bundled updater verification")
print(" - keep MESH_UPDATE_SHA256 available as the operator override path")
return 0 if asset_matches else 2
@@ -1,14 +1,20 @@
"""Function Keys — anonymous citizenship proof.
"""Function Keys — anonymous credential scaffolding.
Source of truth: ``infonet-economy/IMPLEMENTATION_PLAN.md`` §4.4,
``infonet-economy/BRAINDUMP.md`` §11 item 9.
A citizen should be able to prove "I am a UBI-eligible Infonet
citizen" to a real-world operator (food bank, community service)
**without revealing their Infonet identity**. The naive approach
(scramble a public key, record each redemption on chain) leaks
identity through metadata correlation (time, location, operator,
frequency).
A citizen should eventually be able to prove "I am a UBI-eligible
Infonet citizen" to a real-world operator (food bank, community
service) **without revealing their Infonet identity**. The current
Python implementation wires the accounting, nullifier, receipt, and
operator flows, but its HMAC challenge-response is a placeholder for
integration tests. It is not a production anonymous or zero-knowledge
citizenship proof until blind signatures or anonymous credentials are
selected and wired.
The naive approach (scramble a public key, record each redemption on
chain) leaks identity through metadata correlation (time, location,
operator, frequency).
The full design has six pieces; five are implemented in pure Python
here. The remaining piece — issuance via blind signatures or
@@ -27,7 +33,8 @@ Pieces:
operator: tracked via ``NullifierTracker``.
3. **Challenge-response** (`challenge_response.py`) — operator
issues a fresh nonce, key-holder signs with the Function Key's
secret. Prevents screenshot attacks, key sharing, replay.
secret. This is HMAC placeholder plumbing for screenshot/replay
resistance, not the final anonymous credential proof.
4. **Two-phase commit receipts** (`receipt.py`) — Phase 1
verification receipt (operator-signed, day-level date NOT
timestamp, no node_id). Phase 2 fulfillment receipt (citizen
+4 -2
View File
@@ -12,6 +12,8 @@ logger = logging.getLogger(__name__)
CONFIG_PATH = Path(__file__).parent.parent / "config" / "news_feeds.json"
MAX_FEEDS = 50
_FEED_URL_REPLACEMENTS = {
"http://feeds.bbci.co.uk/news/world/rss.xml": "https://feeds.bbci.co.uk/news/world/rss.xml",
"http://www.news.cn/english/rss/worldrss.xml": "https://www.news.cn/english/rss/worldrss.xml",
"https://www.channelnewsasia.com/rssfeed/8395986": "https://www.channelnewsasia.com/api/v1/rss-outbound-feed?_format=xml",
}
_DEAD_FEED_URLS = {
@@ -27,7 +29,7 @@ _DEAD_FEED_URLS = {
DEFAULT_FEEDS = [
{"name": "NPR", "url": "https://feeds.npr.org/1004/rss.xml", "weight": 4},
{"name": "BBC", "url": "http://feeds.bbci.co.uk/news/world/rss.xml", "weight": 3},
{"name": "BBC", "url": "https://feeds.bbci.co.uk/news/world/rss.xml", "weight": 3},
{"name": "AlJazeera", "url": "https://www.aljazeera.com/xml/rss/all.xml", "weight": 2},
{"name": "NYT", "url": "https://rss.nytimes.com/services/xml/rss/nyt/World.xml", "weight": 1},
{"name": "GDACS", "url": "https://www.gdacs.org/xml/rss.xml", "weight": 5},
@@ -35,7 +37,7 @@ DEFAULT_FEEDS = [
{"name": "Bellingcat", "url": "https://www.bellingcat.com/feed/", "weight": 4},
{"name": "Guardian", "url": "https://www.theguardian.com/world/rss", "weight": 3},
{"name": "TASS", "url": "https://tass.com/rss/v2.xml", "weight": 2},
{"name": "Xinhua", "url": "http://www.news.cn/english/rss/worldrss.xml", "weight": 2},
{"name": "Xinhua", "url": "https://www.news.cn/english/rss/worldrss.xml", "weight": 2},
{"name": "CNA", "url": "https://www.channelnewsasia.com/api/v1/rss-outbound-feed?_format=xml", "weight": 3},
{"name": "Mercopress", "url": "https://en.mercopress.com/rss/", "weight": 3},
{"name": "SCMP", "url": "https://www.scmp.com/rss/91/feed", "weight": 4},
+12 -1
View File
@@ -5,7 +5,7 @@ from pathlib import Path
import pytest
from services.fetchers.news import _resolve_coords
from services.news_feed_config import DEFAULT_FEEDS
from services.news_feed_config import DEFAULT_FEEDS, _normalise_feeds
CONFIG_PATH = Path(__file__).parent.parent / "config" / "news_feeds.json"
@@ -152,3 +152,14 @@ class TestFeedConfig:
urls = {f["url"] for f in DEFAULT_FEEDS}
assert "https://www.reutersagency.com/feed/?best-topics=world" not in urls
assert "https://rsshub.app/apnews/topics/world-news" not in urls
def test_legacy_http_feeds_are_migrated_to_https(self):
feeds = _normalise_feeds(
[
{"name": "BBC", "url": "http://feeds.bbci.co.uk/news/world/rss.xml", "weight": 3},
{"name": "Xinhua", "url": "http://www.news.cn/english/rss/worldrss.xml", "weight": 2},
]
)
urls = {f["url"] for f in feeds}
assert "https://feeds.bbci.co.uk/news/world/rss.xml" in urls
assert "https://www.news.cn/english/rss/worldrss.xml" in urls