Skip to content

Commit e03b162

Browse files
authored
Merge pull request #996 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents cc40d5c + c584938 commit e03b162

4 files changed

Lines changed: 25 additions & 4 deletions

File tree

Modules/CIPPCore/Public/Assert-CippVersion.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ function Assert-CippVersion {
1111
1212
#>
1313
param($CIPPVersion)
14-
$APIVersion = (Get-Content -Path (Join-Path $env:CIPPRootPath 'version_latest.txt')).trim()
14+
15+
if ($env:CIPPNG -eq 'true') {
16+
$APIVersion = $env:APP_VERSION
17+
if (!$CIPPVersion) {
18+
$CIPPVersion = $env:APP_VERSION
19+
}
20+
} else {
21+
$APIVersion = (Get-Content -Path (Join-Path $env:CIPPRootPath 'version_latest.txt')).trim()
22+
}
1523

1624
$RemoteAPIVersion = (Invoke-CIPPRestMethod -Uri 'https://raw.githubusercontent.com/KelvinTegelaar/CIPP-API/master/version_latest.txt').trim()
1725
$RemoteCIPPVersion = (Invoke-CIPPRestMethod -Uri 'https://raw.githubusercontent.com/KelvinTegelaar/CIPP/main/public/version.json').version

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Scheduler/Invoke-ListScheduledItemDetails.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ function Invoke-ListScheduledItemDetails {
4040
# Process the task (similar to the way it's done in Invoke-ListScheduledItems)
4141
if ($Task.Parameters) {
4242
$Task.Parameters = $Task.Parameters | ConvertFrom-Json -ErrorAction SilentlyContinue
43+
# Remove headers from parameters for cleaner display, and because they may contain sensitive information. Headers are only used for execution, not needed for display.
44+
if ($Task.Parameters.Headers) {
45+
$Task.Parameters.PSObject.Properties.Remove('Headers')
46+
}
4347
} else {
4448
$Task | Add-Member -NotePropertyName Parameters -NotePropertyValue @{}
4549
}

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Scheduler/Invoke-ListScheduledItems.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ function Invoke-ListScheduledItems {
7878

7979
if ($Task.Parameters) {
8080
$Task.Parameters = $Task.Parameters | ConvertFrom-Json -ErrorAction SilentlyContinue
81+
# Remove headers from parameters for cleaner display, and because they may contain sensitive information. Headers are only used for execution, not needed for display.
82+
if ($Task.Parameters.Headers) {
83+
$Task.Parameters.PSObject.Properties.Remove('Headers')
84+
}
8185
} else {
8286
$Task | Add-Member -NotePropertyName Parameters -NotePropertyValue @{}
8387
}

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecUpdateRefreshToken.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ function Invoke-ExecUpdateRefreshToken {
3131
Add-CIPPAzDataTableEntity @DevSecretsTable -Entity $Secret -Force
3232
} else {
3333
if ($IsPartnerTenant) {
34-
Set-CippKeyVaultSecret -VaultName $kv -Name 'RefreshToken' -SecretValue (ConvertTo-SecureString -String $Request.body.refreshtoken -AsPlainText -Force)
34+
$null = Set-CippKeyVaultSecret -VaultName $kv -Name 'RefreshToken' -SecretValue (ConvertTo-SecureString -String $Request.body.refreshtoken -AsPlainText -Force)
3535
Set-Item -Path env:RefreshToken -Value $Request.body.refreshtoken -Force
3636
} else {
3737
Write-Information "$($env:TenantID) does not match $($Request.body.tenantId) - adding a new secret for the tenant."
3838
$name = $Request.body.tenantId
3939
try {
40-
Set-CippKeyVaultSecret -VaultName $kv -Name $name -SecretValue (ConvertTo-SecureString -String $Request.body.refreshtoken -AsPlainText -Force)
40+
$null = Set-CippKeyVaultSecret -VaultName $kv -Name $name -SecretValue (ConvertTo-SecureString -String $Request.body.refreshtoken -AsPlainText -Force)
4141
Set-Item -Path env:$name -Value $Request.body.refreshtoken -Force
4242
} catch {
4343
Write-Information "Failed to set secret $name in KeyVault. $($_.Exception.Message)"
@@ -60,7 +60,7 @@ function Invoke-ExecUpdateRefreshToken {
6060
OrchestratorName = 'UpdatePermissionsOrchestrator'
6161
Batch = @($TenantBatch)
6262
}
63-
Start-CIPPOrchestrator -InputObject $InputObject
63+
$null = Start-CIPPOrchestrator -InputObject $InputObject
6464
Write-Information 'Started permissions update orchestrator for Partner Tenant'
6565
} catch {
6666
Write-Warning "Failed to start permissions orchestrator: $($_.Exception.Message)"
@@ -76,6 +76,11 @@ function Invoke-ExecUpdateRefreshToken {
7676
'resultText' = "Successfully updated the credentials for $($TenantName). You may continue to the next step, or add additional tenants if required."
7777
'state' = 'success'
7878
}
79+
80+
return ([HttpResponseContext]@{
81+
StatusCode = [HttpStatusCode]::OK
82+
Body = $Results
83+
})
7984
} catch {
8085
$Results = [pscustomobject]@{
8186
'Results' = @{

0 commit comments

Comments
 (0)