Skip to content
Merged
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
28 changes: 20 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ env:
# vNext releases are prereleases: <version>-preview<n>.
PRERELEASE_LABEL: ${{ github.ref == 'refs/heads/vNext' && 'preview' || '' }}
# IdentityCommand version installed for tests and packaging; the module copies its private helpers.
IDENTITYCOMMAND_VERSION: '0.7.159'
IDENTITYCOMMAND_VERSION: '1.0.1'

defaults:
run:
Expand All @@ -63,6 +63,16 @@ jobs:
- uses: actions/checkout@v7
- name: Get Build Scripts
run: git clone --depth 1 --branch $env:BUILD_REF https://github.com/pspete/pspete.Build build
# CurrentUser modules are cached; install.ps1 and help.ps1 skip those found.
# The key rolls monthly so newer module versions are picked up.
- name: Cache Month
id: month
run: '"month=$(Get-Date -Format yyyy-MM)" >> $env:GITHUB_OUTPUT'
- name: Cache Modules
uses: actions/cache@v6
with:
path: ~/Documents/PowerShell/Modules
key: psmodules-test-${{ steps.month.outputs.month }}
- name: Install Dependencies
run: ./build/install.ps1
- name: Install IdentityCommand
Expand Down Expand Up @@ -145,15 +155,19 @@ jobs:
- name: PowerShell
os: windows-latest
shell: pwsh
modules: ~/Documents/PowerShell/Modules
- name: WindowsPowerShell
os: windows-latest
shell: powershell
modules: ~/Documents/WindowsPowerShell/Modules
- name: Linux
os: ubuntu-latest
shell: pwsh
modules: ~/.local/share/powershell/Modules
#- name: Mac
# os: macos-latest
# shell: pwsh
# modules: ~/.local/share/powershell/Modules
defaults:
run:
shell: ${{ matrix.shell }}
Expand All @@ -168,18 +182,16 @@ jobs:
with:
name: module
path: ${{ env.MODULE_NAME }}
# Windows PowerShell 5.1 has no PSResourceGet; install.ps1 skips its ~60s bootstrap when the module is found.
# The key rolls monthly so a newer PSResourceGet is picked up.
# CurrentUser modules are cached per leg; install.ps1 skips those found, including the PSResourceGet bootstrap on 5.1.
# The key rolls monthly so newer module versions are picked up.
- name: Cache Month
id: month
if: matrix.shell == 'powershell'
run: '"month=$(Get-Date -Format yyyy-MM)" >> $env:GITHUB_OUTPUT'
- name: Cache PSResourceGet
if: matrix.shell == 'powershell'
- name: Cache Modules
uses: actions/cache@v6
with:
path: ~/Documents/WindowsPowerShell/Modules/Microsoft.PowerShell.PSResourceGet
key: psresourceget-winps-${{ steps.month.outputs.month }}
path: ${{ matrix.modules }}
key: psmodules-${{ matrix.name }}-${{ steps.month.outputs.month }}
- name: Install Dependencies
run: ./build/install.ps1
- name: Install IdentityCommand
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ All notable changes to this project will be documented in this file.

## Unreleased

- N/A
### Added

- Commands find the Secure Infrastructure Access service url from the `IdentityCommand` session on first use, so no connection step is needed after `New-IDSession` or `New-IDPlatformToken`. Commands follow a later `New-IDSession` or `New-IDPlatformToken`, and fail after `Close-IDSession` until you authenticate again.

### Changed

- Requires `IdentityCommand` 1.0.1.
- A request refused with 401 because the session token has expired reports `Session expired at <time>:
authenticate again with New-IDSession or New-IDPlatformToken`. Previously, it reported `Unauthorized. Unauthorized.`.
- CI caches the PowerShell modules it installs, so dependency installs skip the PowerShell Gallery on a cache hit.

### Removed

- `Connect-SIATenant`. Authenticate with `New-IDSession` or `New-IDPlatformToken` from `IdentityCommand` instead.

## [0.6.68] - 2026-10-08

Expand Down
3 changes: 1 addition & 2 deletions IdentityCommand.SIA/IdentityCommand.SIA.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(
@{ModuleName = 'IdentityCommand'; GUID = 'f6bb2bdf-0c53-443f-be07-3c25264a09b1'; ModuleVersion = '0.7.159' }
@{ModuleName = 'IdentityCommand'; GUID = 'f6bb2bdf-0c53-443f-be07-3c25264a09b1'; ModuleVersion = '1.0.1' }
)

# Assemblies that must be loaded prior to importing this module
Expand All @@ -72,7 +72,6 @@

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @(
'Connect-SIATenant',
'Get-SIAModuleData',
'Get-SIAPolicy',
'Remove-SIAPolicy',
Expand Down
6 changes: 5 additions & 1 deletion IdentityCommand.SIA/IdentityCommand.SIA.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ $ISPSSSession = [ordered]@{
User = $null
TenantId = $null
SessionId = $null
Subdomain = $null
WebSession = $null
StartTime = $null
ElapsedTime = $null
Expand All @@ -151,4 +152,7 @@ $ISPSSSession = [ordered]@{
LastErrorTime = $null
} | Add-CustomType -Type IdCmd.Session

New-Variable -Name ISPSSSession -Value $ISPSSSession -Scope Script -Force
New-Variable -Name ISPSSSession -Value $ISPSSSession -Scope Script -Force

#Discovery key for Resolve-RequestUrl
New-Variable -Name ServiceKey -Value 'jit' -Scope Script -Force
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Add-SIAConnectorPoolMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Add-SIAConnectorPoolMember {

process {

$URI = "$($ISPSSSession.tenant_url)/api/connectors/connector-pools/$connector_pool_id"
$URI = "$(Resolve-RequestUrl)/api/connectors/connector-pools/$connector_pool_id"

#Create Request Body (ConvertTo-JsonBody keeps a single connector id a one-element JSON array)
$body = ConvertTo-JsonBody -Body @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Add-SIASSHHostKeyFingerprint {

process {

$URI = "$($ISPSSSession.tenant_url)/api/ssh-fingerprints"
$URI = "$(Resolve-RequestUrl)/api/ssh-fingerprints"

#Create Request Body
$body = $PSBoundParameters | Get-Parameter | ConvertTo-Json
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Add-SIATargetSet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Add-SIATargetSet {

process {

$URI = "$($ISPSSSession.tenant_url)/api/targetsets"
$URI = "$(Resolve-RequestUrl)/api/targetsets"

#Create Request Body
$boundParameters = $PSBoundParameters | Get-Parameter
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Connect-SIATarget.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function Connect-SIATarget {

process {

$URI = "$($ISPSSSession.tenant_url)/api/adb/sso/acquire"
$URI = "$(Resolve-RequestUrl)/api/adb/sso/acquire"

switch ($PSCmdlet.ParameterSetName) {
{ $PSItem -match 'RDP$' } {
Expand Down
116 changes: 0 additions & 116 deletions IdentityCommand.SIA/Public/Connect-SIATenant.ps1

This file was deleted.

2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIACertificate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Get-SIACertificate {

process {

$URI = "$($ISPSSSession.tenant_url)/api/certificates"
$URI = "$(Resolve-RequestUrl)/api/certificates"

#Send Request
$result = Invoke-IDRestMethod -Uri $URI -Method GET
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIAConnector.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Get-SIAConnector {

process {

$URI = "$($ISPSSSession.tenant_url)/api/connectors/$connector_id"
$URI = "$(Resolve-RequestUrl)/api/connectors/$connector_id"

#Send Request
$result = Invoke-IDRestMethod -Uri $URI -Method GET
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIAConnectorSetupScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Get-SIAConnectorSetupScript {

process {

$URI = "$($ISPSSSession.tenant_url)/api/connectors/setup-script"
$URI = "$(Resolve-RequestUrl)/api/connectors/setup-script"

#Create Request Body
$Body = $PSBoundParameters | Get-Parameter | ConvertTo-Json
Expand Down
4 changes: 2 additions & 2 deletions IdentityCommand.SIA/Public/Get-SIADatabaseStrongAccount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ function Get-SIADatabaseStrongAccount {
switch ($PSCmdlet.ParameterSetName) {

'ById' {
$URI = "$($ISPSSSession.tenant_url)/api/database-strong-accounts/$strong_account_id"
$URI = "$(Resolve-RequestUrl)/api/database-strong-accounts/$strong_account_id"
}

'List' {
$URI = "$($ISPSSSession.tenant_url)/api/database-strong-accounts"
$URI = "$(Resolve-RequestUrl)/api/database-strong-accounts"

$URI = Add-QueryString -URI $URI -Parameter ($PSBoundParameters | Get-Parameter)
}
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIADatabaseTarget.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function Get-SIADatabaseTarget {

process {

$URI = "$($ISPSSSession.tenant_url)/api/database-targets"
$URI = "$(Resolve-RequestUrl)/api/database-targets"

$URI = Add-QueryString -URI $URI -Parameter ($PSBoundParameters | Get-Parameter)

Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIAHttpsRelay.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Get-SIAHttpsRelay {

process {

$URI = "$($ISPSSSession.tenant_url)/api/https-relays"
$URI = "$(Resolve-RequestUrl)/api/https-relays"

#Send Request
$result = Invoke-IDRestMethod -Uri $URI -Method GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Get-SIAHttpsRelaySetupScript {

process {

$URI = "$($ISPSSSession.tenant_url)/api/https-relays/setup-script"
$URI = "$(Resolve-RequestUrl)/api/https-relays/setup-script"

#Create Request Body
$body = $PSBoundParameters | Get-Parameter | ConvertTo-Json
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIAMFAKey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Get-SIAMFAKey {

process {

$URI = "$($ISPSSSession.tenant_url)/api/ssh/sso/key"
$URI = "$(Resolve-RequestUrl)/api/ssh/sso/key"

if ($PSBoundParameters.ContainsKey('format')) {
$URI = "$URI`?format=$format"
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIAPolicy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Get-SIAPolicy {

process {

$URI = "$($ISPSSSession.tenant_url)/api/access-policies/$policyid"
$URI = "$(Resolve-RequestUrl)/api/access-policies/$policyid"

if (-not $PSBoundParameters.ContainsKey('policyid')) {

Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIAResource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function Get-SIAResource {
process {

#Paramterset name is the url path to send the query to.
$URI = "$($ISPSSSession.tenant_url)/api/$($PSCmdlet.ParameterSetName)/$workspaceId"
$URI = "$(Resolve-RequestUrl)/api/$($PSCmdlet.ParameterSetName)/$workspaceId"

#Send Request
$result = Invoke-IDRestMethod -Uri $URI -Method GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Get-SIASSHHostKeyFingerprint {

process {

$URI = "$($ISPSSSession.tenant_url)/api/ssh-fingerprints/$target_id"
$URI = "$(Resolve-RequestUrl)/api/ssh-fingerprints/$target_id"

#Send Request
$result = Invoke-IDRestMethod -Uri $URI -Method GET
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand.SIA/Public/Get-SIASSHPublicKey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function Get-SIASSHPublicKey {
#workspace type switch and workspaceId, and sends both as query parameters. Confirm against a
#tenant whether they are still accepted: aligning to the spec drops mandatory parameters and
#is a breaking change, so it is not being done on the strength of the spec alone.
$URI = "$($ISPSSSession.tenant_url)/api/public-keys"
$URI = "$(Resolve-RequestUrl)/api/public-keys"

$boundparameters = $PSBoundParameters | Get-Parameter -ParametersToRemove deploymentScript, AWS, AZURE, GCP, OnPrem

Expand Down
Loading
Loading