mirror of
https://github.com/Yamato-Security/WELA.git
synced 2026-10-25 14:38:17 +01:00
fix: normalize native WEF reader tokens before strict validation
This commit is contained in:
1 parent
1dfb66fb40
commit
9692edcec6
4 files changed
+31
-5
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user