Skip to content

Commit b92115f

Browse files
Add Rust import preview and XLSX flow
1 parent c5ce08b commit b92115f

10 files changed

Lines changed: 1422 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ jobs:
4949
db_path="$tmpdir/iscy-nix-smoke.sqlite3"
5050
cookie_file="$tmpdir/iscy-nix-smoke.cookies"
5151
evidence_file="$tmpdir/evidence.txt"
52+
import_file="$tmpdir/import-preview.csv"
5253
export DATABASE_URL="sqlite:////${db_path#/}"
5354
export ISCY_MEDIA_ROOT="$tmpdir/media"
5455
export RUST_BACKEND_BIND="127.0.0.1:19001"
5556
export RUST_BACKEND_URL="http://127.0.0.1:19001"
5657
printf 'rust smoke evidence\n' > "$evidence_file"
58+
printf 'Name,Beschreibung,BusinessUnit,Status\nRust Smoke Process,Previewed import,Security Operations,PARTIAL\n' > "$import_file"
5759
5860
nix run .#iscy-backend -- init-demo
5961
nix run .#iscy-backend >"$tmpdir/iscy-backend.log" 2>&1 &
@@ -81,6 +83,7 @@ jobs:
8183
curl -fsS -b "$cookie_file" "$RUST_BACKEND_URL/api/v1/accounts/roles" >/dev/null
8284
curl -fsS -b "$cookie_file" "$RUST_BACKEND_URL/api/v1/accounts/groups" >/dev/null
8385
curl -fsS -b "$cookie_file" "$RUST_BACKEND_URL/api/v1/accounts/permissions" >/dev/null
86+
curl -fsS -b "$cookie_file" -F import_type='processes' -F "file=@$import_file;filename=preview.csv;type=text/csv" "$RUST_BACKEND_URL/api/v1/import-center/preview" >/dev/null
8487
curl -fsS -b "$cookie_file" -H "content-type: application/json" -d '{"import_type":"business_units","replace_existing":false,"csv_data":"name\nRust Smoke Import"}' "$RUST_BACKEND_URL/api/v1/import-center/csv" >/dev/null
8588
curl -fsS -b "$cookie_file" -F title='Rust Smoke Evidence' -F status='SUBMITTED' -F session_id='1' -F requirement_id='1' -F "file=@$evidence_file;filename=evidence.txt;type=text/plain" "$RUST_BACKEND_URL/api/v1/evidence/uploads" >/dev/null
8689
curl -fsS -H "x-iscy-tenant-id: 1" -H "x-iscy-user-id: 1" "$RUST_BACKEND_URL/api/v1/catalog/domains" >/dev/null

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ rust-smoke:
5959
db_url="sqlite:////$${db_path#/}"; \
6060
cookie_file="$$tmpdir/iscy-smoke.cookies"; \
6161
evidence_file="$$tmpdir/evidence.txt"; \
62+
import_file="$$tmpdir/import-preview.csv"; \
6263
bind="$${RUST_BACKEND_BIND:-127.0.0.1:19000}"; \
6364
host="$${bind%:*}"; \
6465
port="$${bind##*:}"; \
6566
if [ "$$host" = "0.0.0.0" ]; then host="127.0.0.1"; fi; \
6667
url="$${RUST_BACKEND_URL:-http://$$host:$$port}"; \
6768
printf 'rust smoke evidence\n' > "$$evidence_file"; \
69+
printf 'Name,Beschreibung,BusinessUnit,Status\nRust Smoke Process,Previewed import,Security Operations,PARTIAL\n' > "$$import_file"; \
6870
echo "Rust smoke DB: $$db_url"; \
6971
DATABASE_URL="$$db_url" cargo run --manifest-path $(RUST_BACKEND_MANIFEST) --bin iscy-backend -- init-demo; \
7072
DATABASE_URL="$$db_url" ISCY_MEDIA_ROOT="$$tmpdir/media" RUST_BACKEND_BIND="$$bind" cargo run --manifest-path $(RUST_BACKEND_MANIFEST) --bin iscy-backend >"$$tmpdir/iscy-backend.log" 2>&1 & \
@@ -90,6 +92,7 @@ rust-smoke:
9092
curl -fsS -b "$$cookie_file" "$$url/api/v1/accounts/roles" >/dev/null; \
9193
curl -fsS -b "$$cookie_file" "$$url/api/v1/accounts/groups" >/dev/null; \
9294
curl -fsS -b "$$cookie_file" "$$url/api/v1/accounts/permissions" >/dev/null; \
95+
curl -fsS -b "$$cookie_file" -F import_type='processes' -F "file=@$$import_file;filename=preview.csv;type=text/csv" "$$url/api/v1/import-center/preview" >/dev/null; \
9396
curl -fsS -b "$$cookie_file" -H "content-type: application/json" -d '{"import_type":"business_units","replace_existing":false,"csv_data":"name\nRust Smoke Import"}' "$$url/api/v1/import-center/csv" >/dev/null; \
9497
curl -fsS -b "$$cookie_file" -F title='Rust Smoke Evidence' -F status='SUBMITTED' -F session_id='1' -F requirement_id='1' -F "file=@$$evidence_file;filename=evidence.txt;type=text/plain" "$$url/api/v1/evidence/uploads" >/dev/null; \
9598
curl -fsS "$$url/dashboard/?tenant_id=1&user_id=1" >/dev/null; \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ make rust-smoke
273273

274274
`make local-test` deckt aktuell die Basis-Gesundheitschecks, mandantenbezogene Report-Views und die Product-Security-Routen ab.
275275
`make team-test` ist der Legacy-Django-Kompatibilitaetscheck.
276-
`make rust-smoke` ist der Rust-only Betriebs-Smoke mit DB-Bootstrap, Healthcheck, Rust-Session-Cookie, Dashboard ohne Query-Kontext, Evidence-Upload, Import-Center-CSV-Probe und zentralen API-Probes.
276+
`make rust-smoke` ist der Rust-only Betriebs-Smoke mit DB-Bootstrap, Healthcheck, Rust-Session-Cookie, Dashboard ohne Query-Kontext, Evidence-Upload, Import-Center-Preview/CSV-Probe und zentralen API-Probes.
277277

278278
## Support-Matrix
279279

docs/RUST_CUTOVER_STATUS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ISCY Rust-Cutover-Status
22

3-
Stand: 2026-04-23
3+
Stand: 2026-04-24
44

55
## Kurzfassung
66

@@ -60,7 +60,7 @@ Der alte Django-Runserver ist damit nicht mehr der lokale Standardpfad.
6060
- `start.sh` startet lokal Rust-only statt Django-runserver.
6161
- Roadmap Liste, Detail, Kanban, Task-Updates und Exportdaten.
6262
- Wizard Start-/Result-Flows.
63-
- Import-Center bestaetigte Importjobs plus Rust-CSV-API `/api/v1/import-center/csv` und Rust-Webroute `/imports/` fuer CSV-Importe von Business-Units, Prozessen, Lieferanten und Assets.
63+
- Import-Center bestaetigte Importjobs plus Rust-Preview-/CSV-APIs `/api/v1/import-center/preview` und `/api/v1/import-center/csv` sowie Rust-Webflow `/imports/` + `/imports/preview/` fuer CSV-/XLSX-/XLSM-Importe, Mapping-Vorschau und Bestaetigung von Business-Units, Prozessen, Lieferanten und Assets.
6464
- Evidence-Upload-API `/api/v1/evidence/uploads` und Rust-Webupload unter `/evidence/` mit Django-kompatibler Dateiablage `evidence/YYYY/MM/...`.
6565
- Product-Security Liste, Produktdetail, Roadmap, Task-Updates und Vulnerability-Updates.
6666
- Rust-only-/Strict-Guards fuer migrierte Backend-Schalter.
@@ -70,7 +70,7 @@ Der alte Django-Runserver ist damit nicht mehr der lokale Standardpfad.
7070
1. **Weboberflaeche:** Rust liefert fuer `/dashboard/`, `/risks/`, `/evidence/`, `/reports/`, `/roadmap/`, `/assets/`, `/imports/` und `/processes/` bereits echte serverseitige Seiten. Die restlichen Views, Detail-/Form-Flows und Exporte liegen noch in Django-Templates und Django-Views.
7171
2. **Auth, Sessions und Admin:** Rust-Sessions, Passwort-Login, Rollen-/Schreibrechte sowie Account-Administration fuer User/Rollen-/Gruppen-/Direktrechtewechsel sind vorhanden. Die Django-kompatiblen Tabellen fuer Gruppen, Permissions und User-Zuordnung sind gebootstrapped; vollstaendige Django-Admin-Paritaet ist noch nicht komplett ersetzt.
7272
3. **Migrations und Seeds:** Ein Rust-eigener Bootstrap fuer operative Kern-Tabellen inklusive Product-Security, Catalog und Requirements ist vorhanden. Einzelne historische Django-Schema-Details ausserhalb dieser Cutover-Slices sind noch nicht vollstaendig abgeloest.
73-
4. **Formulare und Uploads:** CSV-Importe fuer Business-Units, Prozesse, Lieferanten und Assets sowie Evidence-Dateiuploads laufen direkt ueber Rust-Web/API. XLSX-Importe und Mapping-Vorschauen sind noch teilweise Django-orchestriert.
73+
4. **Formulare und Uploads:** Evidence-Dateiuploads sowie Import-Center Datei-Upload, CSV/XLSX/XLSM-Parsing und Mapping-Vorschau laufen direkt ueber Rust-Web/API. Weitere Django-Formreste ausserhalb dieser Cutover-Slices muessen noch ersetzt werden.
7474
5. **Python-Dateien im Repo:** CI und lokaler Start sind Rust-first. Python/Django-Dateien bleiben noch als Legacy-Kompatibilitaet und muessen nach Abschluss von Auth/Web/Form-Flows gezielt entfernt werden.
7575

7676
## Naechster fachlich sinnvoller Cutover-Schritt
@@ -79,7 +79,7 @@ Der naechste Abschlussblock ist nicht mehr ein weiterer einzelner API-Endpunkt,
7979

8080
1. Letzte Admin-Paritaet in Rust finalisieren.
8181
2. Django-Templates durch Rust-Web oder ein separates Frontend auf Rust-API ersetzen.
82-
3. XLSX-Importe und Mapping-Vorschauen ohne Django bereitstellen.
82+
3. Verbleibende Django-Template-/Form-Reste systematisch durch Rust-Web oder ein separates Frontend auf Rust-API ersetzen.
8383
4. Python-Dateien, Requirements, Django-Settings und Django-Startpfade entfernen.
8484

8585
## Cutover-Entscheidung

docs/RUST_REWRITE_ROADMAP.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ ISCY schrittweise von Django/Python auf Rust ueberfuehren, ohne Fachfunktionalit
9898
- `import_center` hat tenantgeschuetzte Importjob-Writes in Rust:
9999
- `POST /api/v1/import-center/jobs` legt gemappte Business-Units, Prozesse, Lieferanten und Assets an oder aktualisiert sie; optional ersetzt es vorhandene Eintraege dieses Typs
100100
- `POST /api/v1/import-center/csv` parst CSV direkt in Rust und wendet Business-Unit-, Prozess-, Lieferanten- und Asset-Importe tenantgeschuetzt an
101-
- `/imports/` stellt den CSV-Import als Rust-Webformular bereit
102-
- Django behaelt nur noch Datei-/XLSX-Upload und Mapping-Vorschau fuer nicht migrierte Importvarianten
101+
- `POST /api/v1/import-center/preview` parst CSV/XLSX/XLSM-Dateien direkt in Rust, leitet Default-Mappings aus Headern ab und liefert die Mapping-Vorschau als Rust-API
102+
- `/imports/` und `/imports/preview/` stellen Datei-Upload, Mapping-Vorschau und Import-Bestaetigung als Rust-Webflow bereit
103+
- Django behaelt fuer den Import-Center-Cutover keinen fachlich notwendigen Datei-/Mapping-Pfad mehr
103104
- `product_security` hat tenantgeschuetzte Read-APIs in Rust:
104105
- `GET /api/v1/product-security/overview` liefert Product-Security-Matrix, Posture-Kennzahlen, Produktliste und letzte Snapshots fuer den aktuellen Tenant
105106
- `GET /api/v1/product-security/products/{product_id}` liefert den Detailbaum mit Releases, Komponenten, Threat Models, TARAs, Schwachstellen, AI-Systemen, PSIRT, Advisories, Snapshot und Roadmap-Aufgaben

rust/iscy-backend/Cargo.lock

Lines changed: 135 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/iscy-backend/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77
anyhow = "1"
88
axum = "0.8"
99
base64 = "0.22"
10+
calamine = "0.26"
1011
serde = { version = "1", features = ["derive"] }
1112
serde_json = "1"
1213
tokio = { version = "1", features = ["macros", "rt-multi-thread", "net"] }

0 commit comments

Comments
 (0)