This commit is contained in:
@@ -5,6 +5,22 @@ param(
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$coreContainer = "assistant-core-runtime-1"
|
||||
$continuityContainer = "assistant-continuity-runtime-1"
|
||||
|
||||
function Post-ContinuityJson([string]$url, [object]$body) {
|
||||
$json = $body | ConvertTo-Json -Depth 8 -Compress
|
||||
$local = New-TemporaryFile
|
||||
$remote = "/tmp/domovoy-$([guid]::NewGuid().ToString('N')).json"
|
||||
try {
|
||||
[IO.File]::WriteAllText($local, $json, [Text.UTF8Encoding]::new($false))
|
||||
docker --context $DockerContext cp $local "${continuityContainer}:$remote" | Out-Null
|
||||
docker --context $DockerContext exec $continuityContainer wget -qO- --header "Content-Type: application/json" --post-file $remote $url
|
||||
if ($LASTEXITCODE -ne 0) { throw "Continuity fixture creation failed" }
|
||||
} finally {
|
||||
docker --context $DockerContext exec --user root $continuityContainer rm -f $remote 2>$null
|
||||
Remove-Item -LiteralPath $local -Force
|
||||
}
|
||||
}
|
||||
|
||||
$health = Invoke-RestMethod -Uri "$BaseURL/healthz" -Method Get
|
||||
if ($health.status -ne "ok" -or $health.runtime -ne "creator-web") { throw "Creator web health response is invalid" }
|
||||
@@ -15,6 +31,8 @@ if (-not $page.Headers["Content-Security-Policy"]) { throw "Creator console secu
|
||||
|
||||
$denied = Invoke-WebRequest -Uri "$BaseURL/api/focus-task-commits" -Method Post -SkipHttpErrorCheck
|
||||
if ($denied.StatusCode -ne 404) { throw "Internal mutation route was exposed" }
|
||||
$continuityMutation = Invoke-WebRequest -Uri "$BaseURL/api/prospective-items/blocked" -Method Post -SkipHttpErrorCheck
|
||||
if ($continuityMutation.StatusCode -ne 404) { throw "Continuity mutation route was exposed" }
|
||||
$invalid = Invoke-WebRequest -Uri "$BaseURL/api/session/current" -Headers @{Authorization="Bearer invalid"} -SkipHttpErrorCheck
|
||||
if ($invalid.StatusCode -ne 401) { throw "Invalid Creator session was not denied" }
|
||||
|
||||
@@ -30,4 +48,14 @@ if ($current.ActorID -ne "domovoy-creator-actor") { throw "Creator identity was
|
||||
$capability = Invoke-RestMethod -Uri "$BaseURL/api/capabilities/cognitive-proposal/health" -Method Get -Headers @{Authorization="Bearer $($issued.Token)"}
|
||||
if ($capability.CapabilityID -ne "cognitive-proposal") { throw "Capability health was not returned through the gateway" }
|
||||
|
||||
Write-Output "DEV-000025 remote Creator web console: PASS"
|
||||
$suffix = [guid]::NewGuid().ToString("N")
|
||||
$prospectiveID = "web-prospective-$suffix"
|
||||
Post-ContinuityJson "http://localhost:8081/v1/prospective-items" @{
|
||||
ID=$prospectiveID;CommitmentID="web-commitment-$suffix";OwnerPrincipalID="domovoy-creator-principal"
|
||||
ScopeID="domovoy-global-scope";GoalID="web-goal-$suffix";TriggerAtUnixMillis=1800000000000
|
||||
State="ARMED";Revision=1
|
||||
}
|
||||
$prospective = Invoke-RestMethod -Uri "$BaseURL/api/prospective-items/$prospectiveID" -Method Get -Headers @{Authorization="Bearer $($issued.Token)"}
|
||||
if ($prospective.ID -ne $prospectiveID -or $prospective.State -ne "ARMED") { throw "ProspectiveItem was not returned through the gateway" }
|
||||
|
||||
Write-Output "DEV-000027 remote Creator Continuity console: PASS"
|
||||
|
||||
Reference in New Issue
Block a user