AMDEPYC / AMDEPYC/sev-certify

sev-verify: Pass parameters to callable steps

Offen
#305 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Python
Sterne
3
Forks
7
Ø Merge
1 T. 21 Std.
Gemergte PRs (30 T.)
8

Beschreibung

Follow-up from [PR #283](https://github.com/AMDEPYC/sev-certify/pull/283) - [(review thread from @DGonzalezVillal on `snphost_config_commit.py`)](https://github.com/AMDEPYC/sev-certify/pull/283#pullrequestreview-4986631251).

Callable steps are dispatched by name with no arguments other than the shared `StepContext`. This results in multiple function wrappers for the same function when called from a step. Enable passing parameters so functions may be called directly.

### Suggested Solution
- Add an optional `params: dict` (or similar) to the callable step definition (`BaseStep` / `Step.for_callable` in `sev_verify/models.py`).
- In `run_callable_step` (`sev_verify/runner.py`), pass those params to the handler - e.g. `fn(ctx, **params)` or via a field on `StepContext`, keeping the no-arg form working for existing handlers.

Then collapse the duplicated handlers into single parameterized functions, e.g.
one `verify_guest_report(ctx, *, report, expect_match_reported)`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.