Skip to content

Commit

Permalink
removed future code
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Aug 7, 2023
1 parent 5517419 commit 3ff607e
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions PublicWebhooks/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,15 @@ if ($Request.CIPPID -in $Webhooks.CIPPID) {
$body = $request.query.ValidationToken
}
Write-Host "Request body: $($request.body | ConvertTo-Json -Depth 10)"
if ($Request.body.contentUri -ne $null) {
Write-Host "ContentUri received"
if ($Request.body.ContentUri -notlike "https://manage.office.com/api/v1.0/*") {
Write-Host "Potential url forgery detected. Quitting to not send headers."
exit
}
$TenantFilter = (Get-Tenants | Where-Object -Property customerId -EQ $Request.body.TenantId).defaultDomainName
Write-Host "TenantFilter: $TenantFilter"
$Data = New-GraphPostRequest -type GET -uri "$($request.body.contenturi)" -tenantid $TenantFilter -scope "https://manage.office.com/.default"
}
else {
$TenantFilter = $Data.Tenant
$Data = $Request.body
}

Write-Host "ContentUri received"
if ($Request.body.ContentUri -notlike "https://manage.office.com/api/v1.0/*") {
Write-Host "Potential url forgery detected. Quitting to not send headers."
exit
}
$TenantFilter = (Get-Tenants | Where-Object -Property customerId -EQ $Request.body.TenantId).defaultDomainName
Write-Host "TenantFilter: $TenantFilter"
$Data = New-GraphPostRequest -type GET -uri "$($request.body.contenturi)" -tenantid $TenantFilter -scope "https://manage.office.com/.default"
Write-Host "Data to process found: $(($data.operation).count) items"
$operations = $Webhookinfo.Operations -split ','
Write-Host "Operations to process for this client: $($Webhookinfo.Operations)"
Expand Down

0 comments on commit 3ff607e

Please sign in to comment.