fix: normalize native WEF reader tokens before strict validation

This commit is contained in:
Shirofune-Security committed 2026-09-22 12:30:51 +09:00
1 parent 1dfb66fb40
commit 9692edcec6
4 files changed
+31 -5

No files matched your search

+9 -1
View File
@@ -22,7 +22,15 @@ function Get-WelaWefQuerySources {
}
function Get-WelaWefQueryToken {
Initialize-WelaWefQueryNative
[Wela.WefQueryToken.Native]::Snapshot()
ConvertTo-WelaWefQueryTokenObservation ([Wela.WefQueryToken.Native]::Snapshot())
}
function ConvertTo-WelaWefQueryTokenObservation {
param($Token)
if($Token -isnot [Wela.WefQueryToken.Token]){throw 'Expected the native query token observation.'}
# Normalize native DTOs at the boundary, using the same strict shape as worker receipts.
$observed=ConvertFrom-WelaArrivalJson (Get-WelaWefQueryKey $Token)
$null=Get-WelaWefQueryTokenKey $observed
$observed
}
function Get-WelaWefQueryTokenKey {
param($Token)