Files
opengenesislinkserver/tools/ci/verify_ogl_profile_feed_interactive.py
T
OpenGenesis (MPL 2.0) c1643d7cdc feat(g1): Stadt NexVerse Feed v2 – modernes Webprofil, OAuth und opt-in Auto-Posts (#437)
* feat(feed): add followed-resident activity timeline and viewer reaction state

* feat(feed): authenticated avatar identity, following timeline and reaction metadata

* feat(feed): interactive same-origin OAuth PKCE web profile composer and timeline UI

* feat(feed): upgrade Firestorm web profile to interactive same-origin PKCE UI

* config(feed): inject registered public OAuth client and exact /feed callback

* config(feed): expose optional public OAuth client ID for direct viewer posting

* config(feed): expose optional public OAuth client ID for direct viewer posting

* config(feed): expose optional public OAuth client ID for direct viewer posting

* feat(feed): preserve own like state in following timeline

* feat(feed): return scoped reaction state in personalized timeline

* docs(api): document OAuth avatar identity and followed feed timeline endpoints

* docs(feed): production-oriented public OAuth registration and interactive viewer rollout

* ci(feed): verify OAuth PKCE, private profiles, timeline and real browser JS syntax

* test(feed): exercise real MariaDB followed timeline and viewer reaction state

* test(feed): import LINQ for followed timeline integration checks

* ci(feed): gate interactive OAuth feed on privacy contracts and browser syntax

* docs(feed): distinguish legacy read-only v1 from opt-in interactive webprofile v2

* feat(feed): idempotent first-party OAuth client bootstrap respecting admin disable

* feat(feed): enable by default and bootstrap OAuth public client on ROBUST startup

* config(feed): default enable web feed and automatic public OAuth provisioning

* config(feed): default enable web feed and automatic public OAuth provisioning

* config(feed): default enable web feed and automatic public OAuth provisioning

* style(feed): redesign responsive Stadt NexVerse feed, composer, profile and stream cards

* style(feed): Stadt NexVerse branded profile hero and cards, powered by OpenGenesisLINK footer

* style(feed): modern interactive avatar cards, action buttons, responsive timelines

* test(feed): align release contracts with safe auto-enabled feed default

* test(feed): align release contracts with safe auto-enabled feed default

* test(feed): align release contracts with safe auto-enabled feed default

* test(feed): verify Stadt NexVerse branding, mobile fallback and CSP

* ci(feed): gate modern NexVerse brand design and browser security

* test(feed): check stream title in client layout rather than static server HTML

* docs(feed): document default-enabled first-party web profile and safety gates

* docs(feed): document default-enabled first-party web profile and safety gates

* docs(feed): use automatic persistent OAuth client by default, manual override optional

* test(feed): cover built-in OAuth public client bootstrap and safe operator opt-out

* feat(feed): opt-in automatic event/classified activity settings and idempotent SQL receipts

* fix(feed): purge activity consent and dedup records in atomic self/admin account deletion

* feat(feed): validated and consent-gated auto posts for approved events/classifieds

* feat(feed): publish verified discovery approval events for consent-gated auto posts

* feat(feed): bind vetted discovery events to opt-in activity publisher

* feat(feed): authenticated per-avatar opt-in controls for automatic activities

* feat(feed): modern per-avatar opt-in switches for event and classified auto posts

* db(feed): migration for opt-in auto-post consent and dedup receipts

* test(feed): live MariaDB auto activity consent/dedup and account deletion

* docs(api): add authenticated personal auto-activity preference endpoints

* ci(feed): contract gate for consented auto posts and durable cleanup

* test(feed): match default-on feed config and atomic activity-consent deletion

* ci(feed): include privacy-gated automatic event and classified publication checks

* docs(feed): opt-in auto event/classified posts, NexVerse branding and safe activation

* fix(feed): accept MySQL TINYINT(1) boolean mapping in auto activity consent

* docs(release): reflect default-on interactive NexVerse feed and opt-in auto activity schema

* fix(feed): import OpenSim.Framework for avatar profile properties

* fix(feed): avoid C# out-variable scope collisions in activity preferences route

* docs(api): sync ChatGPT route index with profile feed OAuth and activity preferences

* test(feed): account for retention sweep in personalized timeline route

* test(feed): match multiline OAuth client lookup without false CI failure
2026-11-11 22:47:37 +01:00

71 lines
3.8 KiB
Python

#!/usr/bin/env python3
"""Non-bypassable OAuth/PKCE and privacy release contracts for interactive feed."""
from pathlib import Path
import os
import subprocess
import tempfile
root = Path(__file__).resolve().parents[2]
read = lambda file: (root / file).read_text(encoding="utf-8")
api = read("NexVerse/Server/Api/OglProfileFeedApi.cs")
store = read("NexVerse/Server/Api/OglProfileFeedStore.cs")
web = read("NexVerse/Server/Api/OglProfileFeedWebApp.cs")
connector = read("NexVerse/Server/Api/NexVerseWorldApiConnector.cs")
contract = read("NexVerse/Server/Api/NexVerseWorldApiHandlers.cs")
docs = read("doc/OpenGenesisLINK/OGL_PROFILE_FEED_INTERACTIVE_V2.md")
# Authenticated identity and owner-bound write paths.
for needle in ("p[3]==\"me\"", "p[3]==\"timeline\"",
"NexScopes.ProfileRead", "NexScopes.RelationshipsRead",
"viewerAccount.PrincipalID!=me", "ListFollowingPosts(",
"!properties.PublishProfile", "visibleIds.Add(",
"ListLikedFollowingPostIds(",
"OglProfileFeedWebApp.Controls()", "OglProfileFeedWebApp.Script(",
"OglProfileFeedWebApp.CallbackPage("):
assert needle in api, needle
assert api.index("if(p.Length==4 && (p[3]==\"me\" || p[3]==\"timeline\"))") < api.index("!UUID.TryParse(p[3]"), "route ordering"
for needle in ("ListFollowingPosts(", "IsFollowing(", "ListLikedPostIds(",
"ListLikedFollowingPostIds(", "p.created_at>=@cutoff",
"f.follower=@follower"):
assert needle in store, needle
assert "profile.PublishProfile ? m_Store.ListPosts(" in api, "SSR private-profile leak"
for needle in ('"ProfileFeedOAuthClientId", string.Empty',
"publicBaseUrl.TrimEnd('/') + \"/feed\""):
assert needle in connector, needle
assert "X-Frame-Options" in api
assert "script-src 'nonce-" in api and "connect-src 'self'" in api
assert "RandomNumberGenerator.GetBytes(16)" in api
assert "No OAuth" not in web
for needle in ("code_challenge_method: 'S256'", "crypto.getRandomValues",
"crypto.subtle.digest('SHA-256'", "sessionStorage.setItem(pendingKey",
"params.get('state') !== pending.state", "history.replaceState",
"grant_type: 'authorization_code'", "credentials: 'omit'",
"sessionStorage.removeItem(tokenKey)", "textContent",
"/oauth/authorize", "/oauth/token", "/oauth/revoke"):
assert needle in web, needle
for forbidden in ("localStorage", "document.cookie", "innerHTML", "client_secret"):
assert forbidden not in web, forbidden
assert "profile:read profile:write relationships:read relationships:write" in web
oauth_store = read("NexVerse/Core/Security/NexOAuthStore.cs")
assert "EnsureProfileFeedPublicClient(" in oauth_store
assert "ClientType = NexOAuthClientTypes.Public" in oauth_store
assert "existing.Enabled" in oauth_store
assert "ProfileFeedOAuthClientId" in docs
assert "EnableNativeTokens = true" in docs
assert "EnsureProfileFeedPublicClient(" in connector
for path in ("bin/Robust.HG.ini", "bin/Robust.HG.ini.example", "bin/Robust.ini.example"):
config = read(path)
assert "ProfileFeedOAuthClientId = \"\"" in config, path
assert "EnableProfileFeed = true" in config, path
for needle in ('["/api/v1/feed/me"]', '["/api/v1/feed/timeline"]'):
assert needle in contract
# Parse the JavaScript sent to the actual viewer rather than accepting a
# merely textual C# signature. GitHub Actions ubuntu-latest provides node.
script = web.split('private const string ScriptBody = """', 1)[1].rsplit('""";', 1)[0]
with tempfile.TemporaryDirectory() as directory:
source = Path(directory) / "feed-webapp.js"
source.write_text(script, encoding="utf-8")
subprocess.run(["node", "--check", os.fspath(source)], check=True)
print("Interactive OGL Feed v2 OAuth, timeline, privacy and browser JS: PASS")