audit: Nacharbeit Umsetzungsaudit 25.09.2026 — Bildfreigabe, Beweisarchiv, KI-Atomarität, Berichte (Block 8, N01–N05, N07, N08, N10–N21, 5.1, 5.2)
Bilder (N01, N05, N07, N08): gemeinsamer Freigabezustand PressReleaseImage::isPubliclyDeliverable() für Seiten, OG und Medienroute (Bestand bleibt sichtbar, v2 nur mit Bestätigung, Admin-Upload bis zum Kundenklick nicht öffentlich); eigene Ability confirmImageRights nur für den Kontoinhaber, ohne Super-Admin-Kurzschluss, Identität und ausstehende Bestätigung auch im Service; Status-Regel unter der PM-Sperre; Cache-Flush nach dem Commit außerhalb der Dateibereinigung; Snapshot nach Bestätigung an veröffentlichter PM; Bestätigungstexte an die gezeigte Kennung gebunden. Beweisarchiv (N02, N10, N11, N12, N13, 5.1): Tombstone unter Zeilensperre mit erneuter Hold-/Fristprüfung; Dateioperationen ausgewertet, Commands mit FAILURE; record() über .tmp + move; Marker archive_pending_at mit archive:retry-pending und archive:sweep-orphans; Anonymisierung entfernt Bilder über den Remover mit Antragsbezug; Draft-Purge räumt Medien nie veröffentlichter abgelehnter Einreichungen; App-Kopien fallen mit dem Archiv-Tombstone; label_corrected nur für veröffentlichte Bilder; archive_entries.legal_request_id; FileDeletion-Helfer; Systemstatus-Checks. KI und Hintergrund (N03, N04, N14, N20, N21): Ergebnis-UPDATE und Audit in einer Transaktion; erwarteter Hash bis in reject()/holdForManualReview(); Ablaufmail per beanspruchtem Marker in einer Transaktion; strikte Schemaprüfung der Vision-Antwort; Fortschrittsmarke ungecacht. Berichte und Canonical (N15–N19, 5.2): lückenlose Alterskohorten; Feed-Identität mit Portal und Sprache; Sitemap-Rolle in der Kundenansicht; Indexverteilung auf einer Grundgesamtheit; Kopien nach Wegfall der Erstquelle neu bewertet; Kategorie-Admin leert Seiten-Caches; Dry-Run zählt alle Tabellen. Gesamtsuite: 2.122 Tests grün, einer übersprungen; Larastan und Pint sauber. Zwei Migrationen (nullable Spalten, INSTANT). N09 offen. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
34fa342c7f
commit
2a2215b3c3
66 changed files with 3092 additions and 368 deletions
|
|
@ -6,11 +6,14 @@ use App\Models\ImageRightsConfirmation;
|
|||
use App\Models\PressRelease;
|
||||
use App\Models\PressReleaseImage;
|
||||
use App\Models\User;
|
||||
use App\Services\Image\ImageProvenanceInspector;
|
||||
use Database\Seeders\LegalDocumentSeeder;
|
||||
use Database\Seeders\LegalTextSeeder;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use Mockery\MockInterface;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
|
|
@ -181,3 +184,37 @@ test('the api docs page lists the rights fields with the current text version',
|
|||
->assertSeeText('confirm_text_version')
|
||||
->assertSeeText('img-confirm-v2');
|
||||
});
|
||||
|
||||
test('a status change during the upload answers 422 and stores nothing', function () {
|
||||
/** @var TestCase $this */
|
||||
['pressRelease' => $pressRelease] = rightsV2ApiDraft();
|
||||
$real = app(ImageProvenanceInspector::class);
|
||||
|
||||
// Die PM wird während der Herkunftsprüfung eingereicht und veröffentlicht
|
||||
// (Audit N07): der Uploader prüft die Statusregel unter der Sperre erneut.
|
||||
$this->instance(ImageProvenanceInspector::class, Mockery::mock(ImageProvenanceInspector::class, function (MockInterface $mock) use ($real, $pressRelease): void {
|
||||
$mock->shouldReceive('inspect')->andReturnUsing(function (string $path) use ($real, $pressRelease) {
|
||||
DB::table('press_releases')->where('id', $pressRelease->id)->update([
|
||||
'status' => PressReleaseStatus::Published->value,
|
||||
'published_at' => now(),
|
||||
]);
|
||||
|
||||
return $real->inspect($path);
|
||||
});
|
||||
}));
|
||||
|
||||
$response = $this->postJson("/api/v1/press-releases/{$pressRelease->id}/images", [
|
||||
'image' => rightsV2ApiFixture('plain.png'),
|
||||
'ai_declaration' => 'original',
|
||||
'copyright' => 'Musterfirma',
|
||||
'rights_confirmed' => true,
|
||||
'confirm_text_version' => 'img-confirm-v2',
|
||||
]);
|
||||
|
||||
$response->assertStatus(422);
|
||||
|
||||
expect($response->json('message'))->toContain('Status der Meldung')
|
||||
->and(PressReleaseImage::query()->count())->toBe(0)
|
||||
->and(ImageRightsConfirmation::query()->count())->toBe(0)
|
||||
->and(Storage::disk('local')->allFiles())->toBe([]);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue