feat(settings): hub auth-policy panel — T4/T5 security parity in the GUI
Some checks failed
Security / Security check (push) Failing after 1s
Some checks failed
Security / Security check (push) Failing after 1s
Settings → Security now shows the hub's effective auth policy via the new read-only AuthStatus RPC: active token validator (static / jwt-rs256 with issuer, audience, JWKS source), anonymous-access warning, per-token cards with scope grants, env-var presence and rate limits, plus a localized admin-denied story for non-admin tokens. Live-reloads on endpoint change. Also fixes a batch of fai→chain rename leftovers this panel's verification uncovered: hub_auth_token.dart and registry_token.dart read/wrote ~/.fai/ while the hub reads ~/.chain/ (stored registry tokens never reached the hub), today_story_loader + tools/today used ~/.fai/today, chain_log legacy ~/.fai/logs migration removed per the no-legacy-recognisers decision, and UI strings still advertised the retired .fai bundle extension. Includes 5 widget tests for the panel, an integration-test screenshot harness (auth_policy_shots_test.dart, guide-shots style), and DE+EN l10n. flutter analyze clean, 58 tests green. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
c6da5025ce
commit
efaa089454
18 changed files with 1208 additions and 74 deletions
|
|
@ -1455,7 +1455,7 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
|
||||
@override
|
||||
String get registryCredentialsBlurb =>
|
||||
'Token zum Herunterladen von .fai-Modulen aus einer Registry mit Anmeldepflicht (Forgejo, private GitHub-Repos). Gespeichert in ~/.chain/registry-token, Modus 0600. Die Umgebungsvariable CHAIN_REGISTRY_TOKEN hat weiterhin Vorrang, wenn gesetzt.';
|
||||
'Token zum Herunterladen von .chain-Modulen aus einer Registry mit Anmeldepflicht (Forgejo, private GitHub-Repos). Gespeichert in ~/.chain/registry-token, Modus 0600. Die Umgebungsvariable CHAIN_REGISTRY_TOKEN hat weiterhin Vorrang, wenn gesetzt.';
|
||||
|
||||
@override
|
||||
String registryTokenStatusConfigured(int chars) {
|
||||
|
|
@ -1492,6 +1492,78 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
return 'Speichern fehlgeschlagen: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String get authPolicyHeader => 'ZUGRIFFSSCHUTZ DES HUBS';
|
||||
|
||||
@override
|
||||
String get authPolicyBlurb =>
|
||||
'Wie der Hub eingehende Aufrufe prüft: aktives Prüfverfahren, Tokens und ihre Rechte (Scopes). Geheimnisse bleiben in Umgebungsvariablen — hier erscheinen nur deren Namen.';
|
||||
|
||||
@override
|
||||
String get authPolicyValidatorStatic =>
|
||||
'Prüfverfahren: statische Token-Liste';
|
||||
|
||||
@override
|
||||
String get authPolicyValidatorJwt =>
|
||||
'Prüfverfahren: JWT (RS256) über eine externe Identitätsstelle';
|
||||
|
||||
@override
|
||||
String get authPolicyAnonymous =>
|
||||
'Keine Tokens konfiguriert — der Hub akzeptiert anonyme Aufrufe. Für lokales Arbeiten in Ordnung; für den Produktivbetrieb Tokens in ~/.chain/config.yaml einrichten.';
|
||||
|
||||
@override
|
||||
String get authPolicyNeedsAdmin =>
|
||||
'Diese Ansicht braucht ein Token mit admin-Recht. Hinterlegen Sie es oben unter „Hub-Authentifizierung“ und laden Sie neu.';
|
||||
|
||||
@override
|
||||
String get authPolicyHubTooOld =>
|
||||
'Der verbundene Hub kennt diese Ansicht noch nicht — er ist älter als Studio. Aktualisieren Sie den Hub (chain update apply) und laden Sie neu.';
|
||||
|
||||
@override
|
||||
String get authPolicyRetry => 'Erneut versuchen';
|
||||
|
||||
@override
|
||||
String get authPolicyReload => 'Tokens neu laden';
|
||||
|
||||
@override
|
||||
String authPolicyReloadDone(int n) {
|
||||
return 'Neu geladen — $n Token aktiv.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get authPolicyEditHint =>
|
||||
'Bearbeitet wird die Richtlinie in ~/.chain/config.yaml (Abschnitt auth:). Nach einer Änderung oder Token-Rotation hier neu laden — der Hub übernimmt sie ohne Neustart.';
|
||||
|
||||
@override
|
||||
String authPolicyEnvSet(String env) {
|
||||
return 'Umgebungsvariable $env ist gesetzt';
|
||||
}
|
||||
|
||||
@override
|
||||
String authPolicyEnvMissing(String env) {
|
||||
return 'Umgebungsvariable $env FEHLT — das Token ist nicht nutzbar';
|
||||
}
|
||||
|
||||
@override
|
||||
String authPolicyRateLimit(int n) {
|
||||
return '$n/min';
|
||||
}
|
||||
|
||||
@override
|
||||
String get authPolicyJwtKeySource => 'Schlüsselquelle';
|
||||
|
||||
@override
|
||||
String get authPolicyJwtAudience => 'Audience (aud)';
|
||||
|
||||
@override
|
||||
String get authPolicyJwtIssuer => 'Aussteller (iss)';
|
||||
|
||||
@override
|
||||
String get authPolicyJwtScopeClaim => 'Scope-Claim';
|
||||
|
||||
@override
|
||||
String get authPolicyNotChecked => 'wird nicht geprüft';
|
||||
|
||||
@override
|
||||
String get hubAuthTokenHeader => 'HUB-AUTHENTIFIZIERUNG';
|
||||
|
||||
|
|
@ -2648,22 +2720,22 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
|
||||
@override
|
||||
String addSourceIntro(String capability) {
|
||||
return '`$capability` ist nicht im öffentlichen Store. Zeig dem Hub eine `.fai`-Bundle-URL oder einen lokalen Bundle-Pfad — der Hub lädt es herunter, prüft (sha256 + Signatur) und installiert.';
|
||||
return '`$capability` ist nicht im öffentlichen Store. Zeig dem Hub eine `.chain`-Bundle-URL oder einen lokalen Bundle-Pfad — der Hub lädt es herunter, prüft (sha256 + Signatur) und installiert.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get addSourceField => 'URL oder Pfad zum .fai-Bundle';
|
||||
String get addSourceField => 'URL oder Pfad zum .chain-Bundle';
|
||||
|
||||
@override
|
||||
String get addSourceHint =>
|
||||
'https://git.flemming.ai/deine-org/dein-modul/releases/download/v0.1.0/foo-0.1.0.fai';
|
||||
'https://git.flemming.ai/deine-org/dein-modul/releases/download/v0.1.0/foo-0.1.0.chain';
|
||||
|
||||
@override
|
||||
String get addSourceHowItWorksTitle => 'Wie private Module funktionieren';
|
||||
|
||||
@override
|
||||
String get addSourceHowItWorksBody =>
|
||||
'Ein Modul ist ein Verzeichnis mit module.yaml + WASM-Artefakt. Zum Teilen: `chain pack <verzeichnis>` baut ein `.fai`-Bundle, das du beliebig hosten kannst (eigene Forgejo / GitHub / S3). Der Hub installiert per URL und prüft die Signatur gegen seinen Trust-Store.\n\nLokal entwickeln? Nimm das CLI — Studio installiert (noch) nicht aus einem unverpackten Verzeichnis:';
|
||||
'Ein Modul ist ein Verzeichnis mit module.yaml + WASM-Artefakt. Zum Teilen: `chain pack <verzeichnis>` baut ein `.chain`-Bundle, das du beliebig hosten kannst (eigene Forgejo / GitHub / S3). Der Hub installiert per URL und prüft die Signatur gegen seinen Trust-Store.\n\nLokal entwickeln? Nimm das CLI — Studio installiert (noch) nicht aus einem unverpackten Verzeichnis:';
|
||||
|
||||
@override
|
||||
String get addSourceCliExample => 'chain install --link /pfad/zum/modul';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue