Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One identity release 7.4 #516

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pipeline-templates/global-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ variables:
- name: version
value: "7.4"
- name: isPrerelease
value: ${{ true }}
value: ${{ false }}
- name: shouldPublishDocker
value: $[ eq( variables.isPrerelease, false ) ]
8 changes: 7 additions & 1 deletion src/safeguard-ps.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,13 @@ PrivateData = @{
ReleaseNotes = @"
safeguard-ps Release Notes:

- bug fixes
- X-TokenLifetimeRemaining header may return a string array in newer versions of powershell. ps New-Timespan just wants a string.
- fix string.split call to force the correct .NET overload
- Update Read.Me with -Browser notes for PKCE.
- Update safeguard-ps to use PKCE
- Add the new set a2a credential cmdlets to the public commands.
- Add cmdlets to set passwords and sshkeys through the A2A service
- Allow calling A2A endpoints without a body
"@

} # End of PSData hashtable
Expand Down
62 changes: 36 additions & 26 deletions src/safeguard-ps.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -618,31 +618,31 @@ function Invoke-WithoutBody
$local:Url = (New-SafeguardUrl $Appliance $Service $Version $RelativeUrl -Parameters $Parameters)
Write-Verbose "Url=$($local:Url)"
Write-Verbose "Parameters=$(ConvertTo-Json -InputObject $Parameters)"
$arguments = @{
Method = $Method;
Headers = $Headers;
Uri = $local:Url;
TimeoutSec = $Timeout
}
if ($InFile)
{
if ($LongRunningTask)
{
$local:Response = (Invoke-WebRequest -Method $Method -Headers $Headers -Uri $local:Url `
-InFile $InFile -OutFile $OutFile -TimeoutSec $Timeout)
Wait-LongRunningTask $local:Response $Headers $Timeout
}
else
{
Invoke-RestMethod -Method $Method -Headers $Headers -Uri $local:Url -InFile $InFile -OutFile $OutFile -TimeoutSec $Timeout
}
Write-Verbose "InFile=$InFile"
$arguments = $arguments + @{ InFile = $InFile }
}
if ($OutFile)
{
Write-Verbose "OutFile=$OutFile"
$arguments = $arguments + @{ OutFile = $OutFile }
}

if ($LongRunningTask)
{
$local:Response = (Invoke-WebRequest @arguments)
Wait-LongRunningTask $local:Response $Headers $Timeout
}
else
{
if ($LongRunningTask)
{
$local:Response = $(Invoke-RestMethod -Method $Method -Headers $Headers -Uri $local:Url `
-InFile $InFile -OutFile $OutFile -TimeoutSec $Timeout)
Wait-LongRunningTask $local:Response $Headers $Timeout
}
else
{
Invoke-RestMethod -Method $Method -Headers $Headers -Uri $local:Url -OutFile $OutFile -TimeoutSec $Timeout
}
Invoke-RestMethod @arguments
}
}
function Invoke-WithBody
Expand Down Expand Up @@ -688,18 +688,28 @@ function Invoke-WithBody
Write-Verbose "Parameters=$(ConvertTo-Json -InputObject $Parameters)"
Write-Verbose "---Request Body---"
Write-Verbose "$($local:BodyInternal)"
$arguments = @{
Method = $Method;
Headers = $Headers;
Uri = $local:Url;
Body = ([System.Text.Encoding]::UTF8.GetBytes($local:BodyInternal));
TimeoutSec = $Timeout
}
if ($OutFile)
{
Write-Verbose "OutFile=$OutFile"
$arguments = $arguments + @{ OutFile = $OutFile }
}


if ($LongRunningTask)
{
$local:Response = (Invoke-WebRequest -Method $Method -Headers $Headers -Uri $local:Url `
-Body ([System.Text.Encoding]::UTF8.GetBytes($local:BodyInternal)) `
-OutFile $OutFile -TimeoutSec $Timeout)
$local:Response = (Invoke-WebRequest @arguments)
Wait-LongRunningTask $local:Response $Headers $Timeout
}
else
{
Invoke-RestMethod -Method $Method -Headers $Headers -Uri $local:Url `
-Body ([System.Text.Encoding]::UTF8.GetBytes($local:BodyInternal)) `
-OutFile $OutFile -TimeoutSec $Timeout
Invoke-RestMethod @arguments
}
}

Expand Down
Loading