CI: add dotnet --info / df -h / free -m diagnostics and an explicit 'Restore NuGet packages' step before build to isolate restore failures (build of e15f650 on main exited with code -1 and zero dotnet output).
#5
@@ -9,7 +9,7 @@
|
|||||||
<command:noun>Infisical</command:noun>
|
<command:noun>Infisical</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Authenticates against an Infisical instance using one of the supported auth providers (UniversalAuth, Token, JWT, OIDC, LDAP, Azure, GCP IAM) and stores the resulting connection in the module-level session manager. Subsequent cmdlets pick up the connection automatically. If parameters such as BaseUri, OrganizationId, ProjectId, Environment, ClientId, or ClientSecret are not supplied, the cmdlet attempts to resolve them from a curated list of environment-variable name patterns across Process, User, and Machine scopes.</maml:para>
|
<maml:para>Authenticates against an Infisical instance using one of the supported auth providers (UniversalAuth, Token, JWT, OIDC, LDAP, Azure, GCP IAM) and stores the resulting connection in the module-level session manager. Subsequent cmdlets pick up the connection automatically. If parameters such as BaseUri, OrganizationId, ClientId, or ClientSecret are not supplied, the cmdlet attempts to resolve them from a curated list of environment-variable name patterns across Process, User, and Machine scopes. The connection no longer carries a default ProjectId, Environment, or SecretPath; downstream cmdlets accept those as explicit (mandatory where applicable) parameters.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Connect-Infisical -BaseUri 'https://app.infisical.com' -ClientId $ClientId -ClientSecret $ClientSecret -OrganizationId $OrgId -ProjectId $ProjectId -Environment 'dev'</dev:code>
|
<dev:code>Connect-Infisical -BaseUri 'https://app.infisical.com' -ClientId $ClientId -ClientSecret $ClientSecret -OrganizationId $OrgId</dev:code>
|
||||||
<dev:remarks><maml:para>Performs a Universal-Auth machine-identity login and stores the resulting session for subsequent cmdlets.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Performs a Universal-Auth machine-identity login and stores the resulting session for subsequent cmdlets.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
@@ -29,11 +29,8 @@
|
|||||||
<dev:code>$ConnectInfisicalParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
<dev:code>$ConnectInfisicalParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$ConnectInfisicalParameters.BaseUri = 'https://app.infisical.com'
|
$ConnectInfisicalParameters.BaseUri = 'https://app.infisical.com'
|
||||||
$ConnectInfisicalParameters.OrganizationId = $OrganizationId
|
$ConnectInfisicalParameters.OrganizationId = $OrganizationId
|
||||||
$ConnectInfisicalParameters.ProjectId = $ProjectId
|
|
||||||
$ConnectInfisicalParameters.Environment = 'dev'
|
|
||||||
$ConnectInfisicalParameters.ClientId = $ClientId
|
$ConnectInfisicalParameters.ClientId = $ClientId
|
||||||
$ConnectInfisicalParameters.ClientSecret = $ClientSecret
|
$ConnectInfisicalParameters.ClientSecret = $ClientSecret
|
||||||
$ConnectInfisicalParameters.SecretPath = '/'
|
|
||||||
$ConnectInfisicalParameters.ApiVersion = 'v4'
|
$ConnectInfisicalParameters.ApiVersion = 'v4'
|
||||||
$ConnectInfisicalParameters.PassThru = $True
|
$ConnectInfisicalParameters.PassThru = $True
|
||||||
$ConnectInfisicalParameters.Verbose = $True
|
$ConnectInfisicalParameters.Verbose = $True
|
||||||
@@ -86,7 +83,7 @@ $DisconnectInfisicalResult = Disconnect-Infisical @DisconnectInfisicalParameters
|
|||||||
<command:noun>InfisicalSecret</command:noun>
|
<command:noun>InfisicalSecret</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) enumerates secrets under the active session's project and environment, optionally recursing through subfolders and filtering by metadata or tag slugs. When -SecretName is supplied (Single parameter set) the cmdlet returns one secret by name; -Version and -Type tune the single-record fetch. ProjectId, Environment, SecretPath, and ApiVersion default to the values pinned on the active InfisicalConnection in both modes.</maml:para>
|
<maml:para>Default (List parameter set) enumerates secrets under the supplied project and environment, optionally recursing through subfolders and filtering by metadata or tag slugs. When -SecretName is supplied (Single parameter set) the cmdlet returns one secret by name; -Version and -Type tune the single-record fetch. -ProjectId and -Environment are mandatory in both modes; -SecretPath defaults to '/' and -ApiVersion defaults to the value pinned on the active InfisicalConnection.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -97,8 +94,8 @@ $DisconnectInfisicalResult = Disconnect-Infisical @DisconnectInfisicalParameters
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalSecret -SecretPath '/Windows' -Recursive</dev:code>
|
<dev:code>Get-InfisicalSecret -ProjectId $ProjectId -Environment 'dev' -SecretPath '/Windows' -Recursive</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every secret under /Windows in the active project and environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every secret under /Windows in the dev environment of the specified project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -108,8 +105,8 @@ $DisconnectInfisicalResult = Disconnect-Infisical @DisconnectInfisicalParameters
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
<dev:code>$GetInfisicalSecretParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
<dev:code>$GetInfisicalSecretParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$GetInfisicalSecretParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$GetInfisicalSecretParameters.ProjectId = $ProjectId
|
||||||
$GetInfisicalSecretParameters.Environment = $ConnectInfisicalParameters.Environment
|
$GetInfisicalSecretParameters.Environment = 'dev'
|
||||||
$GetInfisicalSecretParameters.SecretPath = "/Windows/$($CallingScriptPath.BaseName)"
|
$GetInfisicalSecretParameters.SecretPath = "/Windows/$($CallingScriptPath.BaseName)"
|
||||||
$GetInfisicalSecretParameters.Recursive = $True
|
$GetInfisicalSecretParameters.Recursive = $True
|
||||||
$GetInfisicalSecretParameters.ExpandSecretReferences = $True
|
$GetInfisicalSecretParameters.ExpandSecretReferences = $True
|
||||||
@@ -142,19 +139,19 @@ $GetInfisicalSecretResult = Get-InfisicalSecret @GetInfisicalSecretParameters</d
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>New-InfisicalSecret -SecretName 'API_KEY' -SecretValue 'super-secret-value'</dev:code>
|
<dev:code>New-InfisicalSecret -SecretName 'API_KEY' -SecretValue 'super-secret-value' -ProjectId $ProjectId -Environment 'dev'</dev:code>
|
||||||
<dev:remarks><maml:para>Creates a single shared secret in the active project/environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Creates a single shared secret in the specified project/environment.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>$GetInfisicalTagResult = Get-InfisicalTag -ProjectId $ConnectInfisicalParameters.ProjectId
|
<dev:code>$GetInfisicalTagResult = Get-InfisicalTag -ProjectId $ProjectId
|
||||||
|
|
||||||
$NewInfisicalSecretParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$NewInfisicalSecretParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$NewInfisicalSecretParameters.SecretName = 'API_KEY'
|
$NewInfisicalSecretParameters.SecretName = 'API_KEY'
|
||||||
$NewInfisicalSecretParameters.SecretValue = 'super-secret-value'
|
$NewInfisicalSecretParameters.SecretValue = 'super-secret-value'
|
||||||
$NewInfisicalSecretParameters.SecretComment = 'Issued by deployment pipeline'
|
$NewInfisicalSecretParameters.SecretComment = 'Issued by deployment pipeline'
|
||||||
$NewInfisicalSecretParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$NewInfisicalSecretParameters.ProjectId = $ProjectId
|
||||||
$NewInfisicalSecretParameters.Environment = $ConnectInfisicalParameters.Environment
|
$NewInfisicalSecretParameters.Environment = 'dev'
|
||||||
$NewInfisicalSecretParameters.SecretPath = "/Windows/$($CallingScriptPath.BaseName)"
|
$NewInfisicalSecretParameters.SecretPath = "/Windows/$($CallingScriptPath.BaseName)"
|
||||||
$NewInfisicalSecretParameters.TagIds = @($GetInfisicalTagResult[0].Id)
|
$NewInfisicalSecretParameters.TagIds = @($GetInfisicalTagResult[0].Id)
|
||||||
$NewInfisicalSecretParameters.Verbose = $True
|
$NewInfisicalSecretParameters.Verbose = $True
|
||||||
@@ -184,8 +181,8 @@ $NewInfisicalSecretResult = New-InfisicalSecret @NewInfisicalSecretParameters</d
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Update-InfisicalSecret -SecretName 'API_KEY' -SecretValue 'rotated-value'</dev:code>
|
<dev:code>Update-InfisicalSecret -SecretName 'API_KEY' -SecretValue 'rotated-value' -ProjectId $ProjectId -Environment 'dev'</dev:code>
|
||||||
<dev:remarks><maml:para>Rotates the API_KEY secret in the active project/environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Rotates the API_KEY secret in the specified project/environment.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -194,8 +191,8 @@ $UpdateInfisicalSecretParameters.SecretName = 'API_KEY'
|
|||||||
$UpdateInfisicalSecretParameters.NewSecretName = 'API_KEY_V2'
|
$UpdateInfisicalSecretParameters.NewSecretName = 'API_KEY_V2'
|
||||||
$UpdateInfisicalSecretParameters.SecretValue = 'rotated-value'
|
$UpdateInfisicalSecretParameters.SecretValue = 'rotated-value'
|
||||||
$UpdateInfisicalSecretParameters.SecretComment = 'Rotated by scheduled job'
|
$UpdateInfisicalSecretParameters.SecretComment = 'Rotated by scheduled job'
|
||||||
$UpdateInfisicalSecretParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$UpdateInfisicalSecretParameters.ProjectId = $ProjectId
|
||||||
$UpdateInfisicalSecretParameters.Environment = $ConnectInfisicalParameters.Environment
|
$UpdateInfisicalSecretParameters.Environment = 'dev'
|
||||||
$UpdateInfisicalSecretParameters.SecretPath = "/Windows/$($CallingScriptPath.BaseName)"
|
$UpdateInfisicalSecretParameters.SecretPath = "/Windows/$($CallingScriptPath.BaseName)"
|
||||||
$UpdateInfisicalSecretParameters.Verbose = $True
|
$UpdateInfisicalSecretParameters.Verbose = $True
|
||||||
|
|
||||||
@@ -224,15 +221,15 @@ $UpdateInfisicalSecretResult = Update-InfisicalSecret @UpdateInfisicalSecretPara
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Remove-InfisicalSecret -SecretName 'API_KEY_V1' -Confirm:$False</dev:code>
|
<dev:code>Remove-InfisicalSecret -SecretName 'API_KEY_V1' -ProjectId $ProjectId -Environment 'dev' -Confirm:$False</dev:code>
|
||||||
<dev:remarks><maml:para>Deletes a single secret without prompting.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Deletes a single secret without prompting.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>$RemoveInfisicalSecretParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
<dev:code>$RemoveInfisicalSecretParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$RemoveInfisicalSecretParameters.SecretNames = @('LEGACY_KEY_1','LEGACY_KEY_2','LEGACY_KEY_3')
|
$RemoveInfisicalSecretParameters.SecretNames = @('LEGACY_KEY_1','LEGACY_KEY_2','LEGACY_KEY_3')
|
||||||
$RemoveInfisicalSecretParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$RemoveInfisicalSecretParameters.ProjectId = $ProjectId
|
||||||
$RemoveInfisicalSecretParameters.Environment = $ConnectInfisicalParameters.Environment
|
$RemoveInfisicalSecretParameters.Environment = 'dev'
|
||||||
$RemoveInfisicalSecretParameters.SecretPath = "/Windows/$($CallingScriptPath.BaseName)"
|
$RemoveInfisicalSecretParameters.SecretPath = "/Windows/$($CallingScriptPath.BaseName)"
|
||||||
$RemoveInfisicalSecretParameters.PassThru = $True
|
$RemoveInfisicalSecretParameters.PassThru = $True
|
||||||
$RemoveInfisicalSecretParameters.Confirm = $False
|
$RemoveInfisicalSecretParameters.Confirm = $False
|
||||||
@@ -263,17 +260,17 @@ $RemoveInfisicalSecretResult = Remove-InfisicalSecret @RemoveInfisicalSecretPara
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalSecret | Select-Object -ExpandProperty Id | Copy-InfisicalSecret -DestinationEnvironment 'staging' -CopySecretValue</dev:code>
|
<dev:code>Get-InfisicalSecret -ProjectId $ProjectId -Environment 'dev' | Select-Object -ExpandProperty Id | Copy-InfisicalSecret -ProjectId $ProjectId -SourceEnvironment 'dev' -DestinationEnvironment 'staging' -CopySecretValue</dev:code>
|
||||||
<dev:remarks><maml:para>Copies all secrets from the active environment into 'staging', including their values.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Copies all secrets from dev into staging, including their values.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>$GetInfisicalSecretResult = Get-InfisicalSecret -SecretPath '/Windows' -Recursive
|
<dev:code>$GetInfisicalSecretResult = Get-InfisicalSecret -ProjectId $ProjectId -Environment 'dev' -SecretPath '/Windows' -Recursive
|
||||||
|
|
||||||
$CopyInfisicalSecretParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$CopyInfisicalSecretParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$CopyInfisicalSecretParameters.SecretId = $GetInfisicalSecretResult.Id
|
$CopyInfisicalSecretParameters.SecretId = $GetInfisicalSecretResult.Id
|
||||||
$CopyInfisicalSecretParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$CopyInfisicalSecretParameters.ProjectId = $ProjectId
|
||||||
$CopyInfisicalSecretParameters.SourceEnvironment = $ConnectInfisicalParameters.Environment
|
$CopyInfisicalSecretParameters.SourceEnvironment = 'dev'
|
||||||
$CopyInfisicalSecretParameters.SourceSecretPath = '/Windows'
|
$CopyInfisicalSecretParameters.SourceSecretPath = '/Windows'
|
||||||
$CopyInfisicalSecretParameters.DestinationEnvironment = 'staging'
|
$CopyInfisicalSecretParameters.DestinationEnvironment = 'staging'
|
||||||
$CopyInfisicalSecretParameters.DestinationSecretPath = '/Windows'
|
$CopyInfisicalSecretParameters.DestinationSecretPath = '/Windows'
|
||||||
@@ -285,7 +282,7 @@ $CopyInfisicalSecretParameters.CopyMetadata = $True
|
|||||||
$CopyInfisicalSecretParameters.Verbose = $True
|
$CopyInfisicalSecretParameters.Verbose = $True
|
||||||
|
|
||||||
$CopyInfisicalSecretResult = Copy-InfisicalSecret @CopyInfisicalSecretParameters</dev:code>
|
$CopyInfisicalSecretResult = Copy-InfisicalSecret @CopyInfisicalSecretParameters</dev:code>
|
||||||
<dev:remarks><maml:para>Promotes every Windows secret from the active environment into staging with full value/comment/tag/metadata propagation.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Promotes every Windows secret from dev into staging with full value/comment/tag/metadata propagation.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
</command:examples>
|
</command:examples>
|
||||||
</command:command>
|
</command:command>
|
||||||
@@ -309,12 +306,12 @@ $CopyInfisicalSecretResult = Copy-InfisicalSecret @CopyInfisicalSecretParameters
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalSecret | ConvertTo-InfisicalSecretDictionary -AsPlainText</dev:code>
|
<dev:code>Get-InfisicalSecret -ProjectId $ProjectId -Environment 'dev' | ConvertTo-InfisicalSecretDictionary -AsPlainText</dev:code>
|
||||||
<dev:remarks><maml:para>Builds a plain-text dictionary of every secret in the active environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Builds a plain-text dictionary of every secret in the dev environment of the specified project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>$GetInfisicalSecretResult = Get-InfisicalSecret -SecretPath "/Windows/$($CallingScriptPath.BaseName)" -Recursive
|
<dev:code>$GetInfisicalSecretResult = Get-InfisicalSecret -ProjectId $ProjectId -Environment 'dev' -SecretPath "/Windows/$($CallingScriptPath.BaseName)" -Recursive
|
||||||
|
|
||||||
$ConvertToInfisicalSecretDictionaryParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$ConvertToInfisicalSecretDictionaryParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$ConvertToInfisicalSecretDictionaryParameters.InputObject = $GetInfisicalSecretResult
|
$ConvertToInfisicalSecretDictionaryParameters.InputObject = $GetInfisicalSecretResult
|
||||||
@@ -347,12 +344,12 @@ $ConvertToInfisicalSecretDictionaryResult = ConvertTo-InfisicalSecretDictionary
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalSecret | Export-InfisicalSecrets -Format DotEnv -Path '.\.env' -Force</dev:code>
|
<dev:code>Get-InfisicalSecret -ProjectId $ProjectId -Environment 'dev' | Export-InfisicalSecrets -Format DotEnv -Path '.\.env' -Force</dev:code>
|
||||||
<dev:remarks><maml:para>Writes the active environment's secrets to a .env file.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Writes the dev environment's secrets for the specified project to a .env file.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>$GetInfisicalSecretResult = Get-InfisicalSecret -SecretPath "/Windows/$($CallingScriptPath.BaseName)" -Recursive
|
<dev:code>$GetInfisicalSecretResult = Get-InfisicalSecret -ProjectId $ProjectId -Environment 'dev' -SecretPath "/Windows/$($CallingScriptPath.BaseName)" -Recursive
|
||||||
|
|
||||||
$ExportInfisicalSecretsParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$ExportInfisicalSecretsParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$ExportInfisicalSecretsParameters.InputObject = $GetInfisicalSecretResult
|
$ExportInfisicalSecretsParameters.InputObject = $GetInfisicalSecretResult
|
||||||
@@ -375,7 +372,7 @@ $ExportInfisicalSecretsResult = Export-InfisicalSecrets @ExportInfisicalSecretsP
|
|||||||
<command:noun>InfisicalProject</command:noun>
|
<command:noun>InfisicalProject</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) returns every project the active session can see; project visibility is governed by Infisical's role assignments. When -ProjectId is supplied (Single parameter set) the cmdlet returns the one matching record.</maml:para>
|
<maml:para>Default (List parameter set) returns every project the active session can see; project visibility is governed by Infisical's role assignments. -Type filters the list to a single product surface (secret-manager, cert-manager, kms, ssh, secret-scanning, pam, ai). -IncludeRoles asks the server to return the caller's role bindings on each project. When -ProjectId is supplied (Single parameter set) the cmdlet returns the one matching record.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -391,19 +388,24 @@ $ExportInfisicalSecretsResult = Export-InfisicalSecrets @ExportInfisicalSecretsP
|
|||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalProject -ProjectId $ConnectInfisicalParameters.ProjectId</dev:code>
|
<dev:code>Get-InfisicalProject -ProjectId $ProjectId</dev:code>
|
||||||
<dev:remarks><maml:para>Retrieves the canonical record for the project pinned by the active session.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Retrieves the canonical record for a single project by id.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
<dev:code>$GetInfisicalProjectListResult = Get-InfisicalProject | Where-Object { $_.Slug -ilike 'platform-*' }
|
<dev:code>Get-InfisicalProject -Type 'cert-manager' -IncludeRoles</dev:code>
|
||||||
|
<dev:remarks><maml:para>Lists every Certificate Manager project visible to the session, including the caller's role bindings.</maml:para></dev:remarks>
|
||||||
|
</command:example>
|
||||||
|
<command:example>
|
||||||
|
<maml:title>EXAMPLE 4</maml:title>
|
||||||
|
<dev:code>$GetInfisicalProjectListResult = Get-InfisicalProject -Type 'secret-manager' | Where-Object { $_.Slug -ilike 'platform-*' }
|
||||||
|
|
||||||
$GetInfisicalProjectParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$GetInfisicalProjectParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$GetInfisicalProjectParameters.ProjectId = $GetInfisicalProjectListResult[0].Id
|
$GetInfisicalProjectParameters.ProjectId = $GetInfisicalProjectListResult[0].Id
|
||||||
$GetInfisicalProjectParameters.Verbose = $True
|
$GetInfisicalProjectParameters.Verbose = $True
|
||||||
|
|
||||||
$GetInfisicalProjectResult = Get-InfisicalProject @GetInfisicalProjectParameters</dev:code>
|
$GetInfisicalProjectResult = Get-InfisicalProject @GetInfisicalProjectParameters</dev:code>
|
||||||
<dev:remarks><maml:para>Filters the project list to slugs that begin with 'platform-' and refetches the first match by id.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Filters Secret Manager projects to slugs that begin with 'platform-' and refetches the first match by id.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
</command:examples>
|
</command:examples>
|
||||||
</command:command>
|
</command:command>
|
||||||
@@ -454,7 +456,7 @@ $NewInfisicalProjectResult = New-InfisicalProject @NewInfisicalProjectParameters
|
|||||||
<command:noun>InfisicalProject</command:noun>
|
<command:noun>InfisicalProject</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Updates mutable attributes on a project. -ProjectId defaults to the pinned session project when omitted. Only parameters that are bound are sent to the server. Honors -WhatIf and -Confirm.</maml:para>
|
<maml:para>Updates mutable attributes on a project. -ProjectId is required. Only parameters that are bound are sent to the server. Honors -WhatIf and -Confirm.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -466,7 +468,7 @@ $NewInfisicalProjectResult = New-InfisicalProject @NewInfisicalProjectParameters
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Update-InfisicalProject -Name 'Platform Telemetry (v2)'</dev:code>
|
<dev:code>Update-InfisicalProject -Name 'Platform Telemetry (v2)'</dev:code>
|
||||||
<dev:remarks><maml:para>Renames the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Renames the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -493,7 +495,7 @@ $UpdateInfisicalProjectResult = Update-InfisicalProject @UpdateInfisicalProjectP
|
|||||||
<command:noun>InfisicalProject</command:noun>
|
<command:noun>InfisicalProject</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Deletes a project by Id. Defaults to the session-pinned project when -ProjectId is omitted. High ConfirmImpact prompts unless -Confirm:$False is supplied. -PassThru emits the removed project id.</maml:para>
|
<maml:para>Deletes a project by Id. -ProjectId is required. High ConfirmImpact prompts unless -Confirm:$False is supplied. -PassThru emits the removed project id.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -505,7 +507,7 @@ $UpdateInfisicalProjectResult = Update-InfisicalProject @UpdateInfisicalProjectP
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Remove-InfisicalProject -Confirm:$False</dev:code>
|
<dev:code>Remove-InfisicalProject -Confirm:$False</dev:code>
|
||||||
<dev:remarks><maml:para>Deletes the session-pinned project without prompting.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Deletes the supplied project without prompting.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -531,7 +533,7 @@ $RemoveInfisicalProjectResult = Remove-InfisicalProject @RemoveInfisicalProjectP
|
|||||||
<command:noun>InfisicalEnvironment</command:noun>
|
<command:noun>InfisicalEnvironment</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) returns every environment configured on the session-pinned project. When -EnvironmentSlugOrId is supplied (Single parameter set) the cmdlet returns one environment by slug or id. -ProjectId defaults to the session-pinned project in both modes.</maml:para>
|
<maml:para>Default (List parameter set) returns every environment configured on the supplied project. When -EnvironmentSlugOrId is supplied (Single parameter set) the cmdlet returns one environment by slug or id. -ProjectId is required in both modes.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -543,12 +545,12 @@ $RemoveInfisicalProjectResult = Remove-InfisicalProject @RemoveInfisicalProjectP
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalEnvironment</dev:code>
|
<dev:code>Get-InfisicalEnvironment</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every environment defined on the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every environment defined on the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalEnvironment -EnvironmentSlugOrId 'dev'</dev:code>
|
<dev:code>Get-InfisicalEnvironment -EnvironmentSlugOrId 'dev'</dev:code>
|
||||||
<dev:remarks><maml:para>Retrieves the 'dev' environment from the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Retrieves the 'dev' environment from the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
@@ -573,7 +575,7 @@ $GetInfisicalEnvironmentResult = Get-InfisicalEnvironment @GetInfisicalEnvironme
|
|||||||
<command:noun>InfisicalEnvironment</command:noun>
|
<command:noun>InfisicalEnvironment</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Creates an environment with the supplied display name and slug, optionally setting its sort -Position. -ProjectId defaults to the session-pinned project when omitted. Honors -WhatIf and -Confirm.</maml:para>
|
<maml:para>Creates an environment with the supplied display name and slug, optionally setting its sort -Position. -ProjectId is required. Honors -WhatIf and -Confirm.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -585,7 +587,7 @@ $GetInfisicalEnvironmentResult = Get-InfisicalEnvironment @GetInfisicalEnvironme
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>New-InfisicalEnvironment -Name 'Staging' -Slug 'staging'</dev:code>
|
<dev:code>New-InfisicalEnvironment -Name 'Staging' -Slug 'staging'</dev:code>
|
||||||
<dev:remarks><maml:para>Adds a Staging environment to the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Adds a Staging environment to the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -612,7 +614,7 @@ $NewInfisicalEnvironmentResult = New-InfisicalEnvironment @NewInfisicalEnvironme
|
|||||||
<command:noun>InfisicalEnvironment</command:noun>
|
<command:noun>InfisicalEnvironment</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Updates an environment identified by -EnvironmentId. -ProjectId defaults to the session-pinned project when omitted. Only bound parameters are sent to the server. Honors -WhatIf and -Confirm.</maml:para>
|
<maml:para>Updates an environment identified by -EnvironmentId. -ProjectId is required. Only bound parameters are sent to the server. Honors -WhatIf and -Confirm.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -624,7 +626,7 @@ $NewInfisicalEnvironmentResult = New-InfisicalEnvironment @NewInfisicalEnvironme
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Update-InfisicalEnvironment -EnvironmentId $EnvId -Name 'Pre-Production'</dev:code>
|
<dev:code>Update-InfisicalEnvironment -EnvironmentId $EnvId -Name 'Pre-Production'</dev:code>
|
||||||
<dev:remarks><maml:para>Renames an environment in the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Renames an environment in the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -632,7 +634,7 @@ $NewInfisicalEnvironmentResult = New-InfisicalEnvironment @NewInfisicalEnvironme
|
|||||||
|
|
||||||
$UpdateInfisicalEnvironmentParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$UpdateInfisicalEnvironmentParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$UpdateInfisicalEnvironmentParameters.EnvironmentId = $GetInfisicalEnvironmentResult.Id
|
$UpdateInfisicalEnvironmentParameters.EnvironmentId = $GetInfisicalEnvironmentResult.Id
|
||||||
$UpdateInfisicalEnvironmentParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$UpdateInfisicalEnvironmentParameters.ProjectId = $ProjectId
|
||||||
$UpdateInfisicalEnvironmentParameters.Name = 'Pre-Production'
|
$UpdateInfisicalEnvironmentParameters.Name = 'Pre-Production'
|
||||||
$UpdateInfisicalEnvironmentParameters.Slug = 'preprod'
|
$UpdateInfisicalEnvironmentParameters.Slug = 'preprod'
|
||||||
$UpdateInfisicalEnvironmentParameters.Position = 25
|
$UpdateInfisicalEnvironmentParameters.Position = 25
|
||||||
@@ -652,7 +654,7 @@ $UpdateInfisicalEnvironmentResult = Update-InfisicalEnvironment @UpdateInfisical
|
|||||||
<command:noun>InfisicalEnvironment</command:noun>
|
<command:noun>InfisicalEnvironment</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Removes an environment by Id. -ProjectId defaults to the session-pinned project when omitted. High ConfirmImpact prompts unless -Confirm:$False is supplied. -PassThru emits the removed environment id.</maml:para>
|
<maml:para>Removes an environment by Id. -ProjectId is required. High ConfirmImpact prompts unless -Confirm:$False is supplied. -PassThru emits the removed environment id.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -672,7 +674,7 @@ $UpdateInfisicalEnvironmentResult = Update-InfisicalEnvironment @UpdateInfisical
|
|||||||
|
|
||||||
$RemoveInfisicalEnvironmentParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$RemoveInfisicalEnvironmentParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$RemoveInfisicalEnvironmentParameters.EnvironmentId = $GetInfisicalEnvironmentResult.Id
|
$RemoveInfisicalEnvironmentParameters.EnvironmentId = $GetInfisicalEnvironmentResult.Id
|
||||||
$RemoveInfisicalEnvironmentParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$RemoveInfisicalEnvironmentParameters.ProjectId = $ProjectId
|
||||||
$RemoveInfisicalEnvironmentParameters.PassThru = $True
|
$RemoveInfisicalEnvironmentParameters.PassThru = $True
|
||||||
$RemoveInfisicalEnvironmentParameters.Confirm = $False
|
$RemoveInfisicalEnvironmentParameters.Confirm = $False
|
||||||
$RemoveInfisicalEnvironmentParameters.Verbose = $True
|
$RemoveInfisicalEnvironmentParameters.Verbose = $True
|
||||||
@@ -691,7 +693,7 @@ $RemoveInfisicalEnvironmentResult = Remove-InfisicalEnvironment @RemoveInfisical
|
|||||||
<command:noun>InfisicalFolder</command:noun>
|
<command:noun>InfisicalFolder</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) enumerates folders directly under the supplied -Path within the active project and environment. When -FolderNameOrId is supplied (Single parameter set) the cmdlet returns one folder by name or id under -Path. -ProjectId, -Environment, and -Path default to the session-pinned values in both modes.</maml:para>
|
<maml:para>Default (List parameter set) enumerates folders directly under the supplied -Path within the project and environment. When -FolderNameOrId is supplied (Single parameter set) the cmdlet returns one folder by name or id under -Path. -ProjectId and -Environment are required in both modes; -Path defaults to '/'.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -702,13 +704,13 @@ $RemoveInfisicalEnvironmentResult = Remove-InfisicalEnvironment @RemoveInfisical
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalFolder -Path '/Windows'</dev:code>
|
<dev:code>Get-InfisicalFolder -ProjectId $ProjectId -Environment 'dev' -Path '/Windows'</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every folder directly under /Windows in the active project and environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every folder directly under /Windows in the supplied project and environment.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalFolder -FolderNameOrId 'Deployments' -Path '/Windows'</dev:code>
|
<dev:code>Get-InfisicalFolder -FolderNameOrId 'Deployments' -ProjectId $ProjectId -Environment 'dev' -Path '/Windows'</dev:code>
|
||||||
<dev:remarks><maml:para>Retrieves the Deployments folder under /Windows in the active project and environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Retrieves the Deployments folder under /Windows in the supplied project and environment.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
@@ -716,8 +718,8 @@ $RemoveInfisicalEnvironmentResult = Remove-InfisicalEnvironment @RemoveInfisical
|
|||||||
|
|
||||||
$GetInfisicalFolderParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$GetInfisicalFolderParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$GetInfisicalFolderParameters.FolderNameOrId = $GetInfisicalFolderListResult.Id
|
$GetInfisicalFolderParameters.FolderNameOrId = $GetInfisicalFolderListResult.Id
|
||||||
$GetInfisicalFolderParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$GetInfisicalFolderParameters.ProjectId = $ProjectId
|
||||||
$GetInfisicalFolderParameters.Environment = $ConnectInfisicalParameters.Environment
|
$GetInfisicalFolderParameters.Environment = 'dev'
|
||||||
$GetInfisicalFolderParameters.Path = '/Windows'
|
$GetInfisicalFolderParameters.Path = '/Windows'
|
||||||
$GetInfisicalFolderParameters.Verbose = $True
|
$GetInfisicalFolderParameters.Verbose = $True
|
||||||
|
|
||||||
@@ -735,7 +737,7 @@ $GetInfisicalFolderResult = Get-InfisicalFolder @GetInfisicalFolderParameters</d
|
|||||||
<command:noun>InfisicalFolder</command:noun>
|
<command:noun>InfisicalFolder</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Creates a folder with the supplied -Name beneath the supplied -Path. -ProjectId, -Environment, and -Path default to the session-pinned values when omitted. Honors -WhatIf and -Confirm.</maml:para>
|
<maml:para>Creates a folder with the supplied -Name beneath the supplied -Path. -ProjectId and -Environment are required; -Path defaults to '/'. Honors -WhatIf and -Confirm.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -746,20 +748,20 @@ $GetInfisicalFolderResult = Get-InfisicalFolder @GetInfisicalFolderParameters</d
|
|||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>New-InfisicalFolder -Name 'Deployments' -Path '/Windows'</dev:code>
|
<dev:code>New-InfisicalFolder -Name 'Deployments' -ProjectId $ProjectId -Environment 'dev' -Path '/Windows'</dev:code>
|
||||||
<dev:remarks><maml:para>Creates the Deployments folder under /Windows in the active project and environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Creates the Deployments folder under /Windows in the supplied project and environment.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>$NewInfisicalFolderParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
<dev:code>$NewInfisicalFolderParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$NewInfisicalFolderParameters.Name = $CallingScriptPath.BaseName
|
$NewInfisicalFolderParameters.Name = $CallingScriptPath.BaseName
|
||||||
$NewInfisicalFolderParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$NewInfisicalFolderParameters.ProjectId = $ProjectId
|
||||||
$NewInfisicalFolderParameters.Environment = $ConnectInfisicalParameters.Environment
|
$NewInfisicalFolderParameters.Environment = 'dev'
|
||||||
$NewInfisicalFolderParameters.Path = '/Windows'
|
$NewInfisicalFolderParameters.Path = '/Windows'
|
||||||
$NewInfisicalFolderParameters.Verbose = $True
|
$NewInfisicalFolderParameters.Verbose = $True
|
||||||
|
|
||||||
$NewInfisicalFolderResult = New-InfisicalFolder @NewInfisicalFolderParameters</dev:code>
|
$NewInfisicalFolderResult = New-InfisicalFolder @NewInfisicalFolderParameters</dev:code>
|
||||||
<dev:remarks><maml:para>Creates a script-named folder under /Windows using the session-pinned project and environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Creates a script-named folder under /Windows in the supplied project and environment.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
</command:examples>
|
</command:examples>
|
||||||
</command:command>
|
</command:command>
|
||||||
@@ -772,7 +774,7 @@ $NewInfisicalFolderResult = New-InfisicalFolder @NewInfisicalFolderParameters</d
|
|||||||
<command:noun>InfisicalFolder</command:noun>
|
<command:noun>InfisicalFolder</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Renames a folder identified by -FolderId to the supplied -Name. -ProjectId, -Environment, and -Path default to the session-pinned values when omitted. Honors -WhatIf and -Confirm.</maml:para>
|
<maml:para>Renames a folder identified by -FolderId to the supplied -Name. -ProjectId and -Environment are required; -Path defaults to '/'. Honors -WhatIf and -Confirm.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -784,7 +786,7 @@ $NewInfisicalFolderResult = New-InfisicalFolder @NewInfisicalFolderParameters</d
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Update-InfisicalFolder -FolderId $FolderId -Name 'Deployments-Archive'</dev:code>
|
<dev:code>Update-InfisicalFolder -FolderId $FolderId -Name 'Deployments-Archive'</dev:code>
|
||||||
<dev:remarks><maml:para>Renames a folder in the session-pinned project/environment.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Renames a folder in the supplied project/environment.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -793,8 +795,8 @@ $NewInfisicalFolderResult = New-InfisicalFolder @NewInfisicalFolderParameters</d
|
|||||||
$UpdateInfisicalFolderParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$UpdateInfisicalFolderParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$UpdateInfisicalFolderParameters.FolderId = $GetInfisicalFolderResult.Id
|
$UpdateInfisicalFolderParameters.FolderId = $GetInfisicalFolderResult.Id
|
||||||
$UpdateInfisicalFolderParameters.Name = 'Deployments-Archive'
|
$UpdateInfisicalFolderParameters.Name = 'Deployments-Archive'
|
||||||
$UpdateInfisicalFolderParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$UpdateInfisicalFolderParameters.ProjectId = $ProjectId
|
||||||
$UpdateInfisicalFolderParameters.Environment = $ConnectInfisicalParameters.Environment
|
$UpdateInfisicalFolderParameters.Environment = 'dev'
|
||||||
$UpdateInfisicalFolderParameters.Path = '/Windows'
|
$UpdateInfisicalFolderParameters.Path = '/Windows'
|
||||||
$UpdateInfisicalFolderParameters.Verbose = $True
|
$UpdateInfisicalFolderParameters.Verbose = $True
|
||||||
|
|
||||||
@@ -812,7 +814,7 @@ $UpdateInfisicalFolderResult = Update-InfisicalFolder @UpdateInfisicalFolderPara
|
|||||||
<command:noun>InfisicalFolder</command:noun>
|
<command:noun>InfisicalFolder</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Removes a folder by Id from the supplied -Path. -ProjectId, -Environment, and -Path default to the session-pinned values when omitted. High ConfirmImpact prompts unless -Confirm:$False is supplied. -PassThru emits the removed folder id.</maml:para>
|
<maml:para>Removes a folder by Id from the supplied -Path. -ProjectId and -Environment are required; -Path defaults to '/'. High ConfirmImpact prompts unless -Confirm:$False is supplied. -PassThru emits the removed folder id.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -824,7 +826,7 @@ $UpdateInfisicalFolderResult = Update-InfisicalFolder @UpdateInfisicalFolderPara
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Remove-InfisicalFolder -FolderId $FolderId -Confirm:$False</dev:code>
|
<dev:code>Remove-InfisicalFolder -FolderId $FolderId -Confirm:$False</dev:code>
|
||||||
<dev:remarks><maml:para>Deletes a folder from the session-pinned project/environment without prompting.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Deletes a folder from the supplied project/environment without prompting.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -832,8 +834,8 @@ $UpdateInfisicalFolderResult = Update-InfisicalFolder @UpdateInfisicalFolderPara
|
|||||||
|
|
||||||
$RemoveInfisicalFolderParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$RemoveInfisicalFolderParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$RemoveInfisicalFolderParameters.FolderId = $GetInfisicalFolderResult.Id
|
$RemoveInfisicalFolderParameters.FolderId = $GetInfisicalFolderResult.Id
|
||||||
$RemoveInfisicalFolderParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$RemoveInfisicalFolderParameters.ProjectId = $ProjectId
|
||||||
$RemoveInfisicalFolderParameters.Environment = $ConnectInfisicalParameters.Environment
|
$RemoveInfisicalFolderParameters.Environment = 'dev'
|
||||||
$RemoveInfisicalFolderParameters.Path = '/Windows'
|
$RemoveInfisicalFolderParameters.Path = '/Windows'
|
||||||
$RemoveInfisicalFolderParameters.PassThru = $True
|
$RemoveInfisicalFolderParameters.PassThru = $True
|
||||||
$RemoveInfisicalFolderParameters.Confirm = $False
|
$RemoveInfisicalFolderParameters.Confirm = $False
|
||||||
@@ -853,7 +855,7 @@ $RemoveInfisicalFolderResult = Remove-InfisicalFolder @RemoveInfisicalFolderPara
|
|||||||
<command:noun>InfisicalTag</command:noun>
|
<command:noun>InfisicalTag</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) returns every tag configured on the project. When -TagSlugOrId is supplied (Single parameter set) the cmdlet returns the one matching record. -ProjectId defaults to the session-pinned project in both modes.</maml:para>
|
<maml:para>Default (List parameter set) returns every tag configured on the project. When -TagSlugOrId is supplied (Single parameter set) the cmdlet returns the one matching record. -ProjectId is required in both modes.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -865,12 +867,12 @@ $RemoveInfisicalFolderResult = Remove-InfisicalFolder @RemoveInfisicalFolderPara
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalTag</dev:code>
|
<dev:code>Get-InfisicalTag</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every tag defined on the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every tag defined on the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalTag -TagSlugOrId 'critical'</dev:code>
|
<dev:code>Get-InfisicalTag -TagSlugOrId 'critical'</dev:code>
|
||||||
<dev:remarks><maml:para>Retrieves the 'critical' tag from the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Retrieves the 'critical' tag from the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
@@ -895,7 +897,7 @@ $GetInfisicalTagResult = Get-InfisicalTag @GetInfisicalTagParameters</dev:code>
|
|||||||
<command:noun>InfisicalTag</command:noun>
|
<command:noun>InfisicalTag</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Creates a tag with the supplied -Slug, optional -Name and -Color. -ProjectId defaults to the session-pinned project when omitted. Honors -WhatIf and -Confirm.</maml:para>
|
<maml:para>Creates a tag with the supplied -Slug, optional -Name and -Color. -ProjectId is required. Honors -WhatIf and -Confirm.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -907,7 +909,7 @@ $GetInfisicalTagResult = Get-InfisicalTag @GetInfisicalTagParameters</dev:code>
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>New-InfisicalTag -Slug 'critical' -Name 'Critical' -Color '#FF0000'</dev:code>
|
<dev:code>New-InfisicalTag -Slug 'critical' -Name 'Critical' -Color '#FF0000'</dev:code>
|
||||||
<dev:remarks><maml:para>Creates a red Critical tag in the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Creates a red Critical tag in the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -915,7 +917,7 @@ $GetInfisicalTagResult = Get-InfisicalTag @GetInfisicalTagParameters</dev:code>
|
|||||||
$NewInfisicalTagParameters.Slug = 'critical'
|
$NewInfisicalTagParameters.Slug = 'critical'
|
||||||
$NewInfisicalTagParameters.Name = 'Critical'
|
$NewInfisicalTagParameters.Name = 'Critical'
|
||||||
$NewInfisicalTagParameters.Color = '#FF0000'
|
$NewInfisicalTagParameters.Color = '#FF0000'
|
||||||
$NewInfisicalTagParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$NewInfisicalTagParameters.ProjectId = $ProjectId
|
||||||
$NewInfisicalTagParameters.Verbose = $True
|
$NewInfisicalTagParameters.Verbose = $True
|
||||||
|
|
||||||
$NewInfisicalTagResult = New-InfisicalTag @NewInfisicalTagParameters</dev:code>
|
$NewInfisicalTagResult = New-InfisicalTag @NewInfisicalTagParameters</dev:code>
|
||||||
@@ -932,7 +934,7 @@ $NewInfisicalTagResult = New-InfisicalTag @NewInfisicalTagParameters</dev:code>
|
|||||||
<command:noun>InfisicalTag</command:noun>
|
<command:noun>InfisicalTag</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Updates a tag identified by -TagId. -ProjectId defaults to the session-pinned project when omitted. Only bound parameters are sent to the server. Honors -WhatIf and -Confirm.</maml:para>
|
<maml:para>Updates a tag identified by -TagId. -ProjectId is required. Only bound parameters are sent to the server. Honors -WhatIf and -Confirm.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -944,7 +946,7 @@ $NewInfisicalTagResult = New-InfisicalTag @NewInfisicalTagParameters</dev:code>
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Update-InfisicalTag -TagId $TagId -Color '#FFA500'</dev:code>
|
<dev:code>Update-InfisicalTag -TagId $TagId -Color '#FFA500'</dev:code>
|
||||||
<dev:remarks><maml:para>Changes the display color of a tag in the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Changes the display color of a tag in the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -955,7 +957,7 @@ $UpdateInfisicalTagParameters.TagId = $GetInfisicalTagResult.Id
|
|||||||
$UpdateInfisicalTagParameters.Slug = 'critical-v2'
|
$UpdateInfisicalTagParameters.Slug = 'critical-v2'
|
||||||
$UpdateInfisicalTagParameters.Name = 'Critical (v2)'
|
$UpdateInfisicalTagParameters.Name = 'Critical (v2)'
|
||||||
$UpdateInfisicalTagParameters.Color = '#FFA500'
|
$UpdateInfisicalTagParameters.Color = '#FFA500'
|
||||||
$UpdateInfisicalTagParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$UpdateInfisicalTagParameters.ProjectId = $ProjectId
|
||||||
$UpdateInfisicalTagParameters.Verbose = $True
|
$UpdateInfisicalTagParameters.Verbose = $True
|
||||||
|
|
||||||
$UpdateInfisicalTagResult = Update-InfisicalTag @UpdateInfisicalTagParameters</dev:code>
|
$UpdateInfisicalTagResult = Update-InfisicalTag @UpdateInfisicalTagParameters</dev:code>
|
||||||
@@ -972,7 +974,7 @@ $UpdateInfisicalTagResult = Update-InfisicalTag @UpdateInfisicalTagParameters</d
|
|||||||
<command:noun>InfisicalTag</command:noun>
|
<command:noun>InfisicalTag</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Removes a tag by Id. -ProjectId defaults to the session-pinned project when omitted. High ConfirmImpact prompts unless -Confirm:$False is supplied. -PassThru emits the removed tag id.</maml:para>
|
<maml:para>Removes a tag by Id. -ProjectId is required. High ConfirmImpact prompts unless -Confirm:$False is supplied. -PassThru emits the removed tag id.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -984,7 +986,7 @@ $UpdateInfisicalTagResult = Update-InfisicalTag @UpdateInfisicalTagParameters</d
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Remove-InfisicalTag -TagId $TagId -Confirm:$False</dev:code>
|
<dev:code>Remove-InfisicalTag -TagId $TagId -Confirm:$False</dev:code>
|
||||||
<dev:remarks><maml:para>Deletes a tag from the session-pinned project without prompting.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Deletes a tag from the supplied project without prompting.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -992,7 +994,7 @@ $UpdateInfisicalTagResult = Update-InfisicalTag @UpdateInfisicalTagParameters</d
|
|||||||
|
|
||||||
$RemoveInfisicalTagParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$RemoveInfisicalTagParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$RemoveInfisicalTagParameters.TagId = $GetInfisicalTagResult.Id
|
$RemoveInfisicalTagParameters.TagId = $GetInfisicalTagResult.Id
|
||||||
$RemoveInfisicalTagParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$RemoveInfisicalTagParameters.ProjectId = $ProjectId
|
||||||
$RemoveInfisicalTagParameters.PassThru = $True
|
$RemoveInfisicalTagParameters.PassThru = $True
|
||||||
$RemoveInfisicalTagParameters.Confirm = $False
|
$RemoveInfisicalTagParameters.Confirm = $False
|
||||||
$RemoveInfisicalTagParameters.Verbose = $True
|
$RemoveInfisicalTagParameters.Verbose = $True
|
||||||
@@ -1011,7 +1013,7 @@ $RemoveInfisicalTagResult = Remove-InfisicalTag @RemoveInfisicalTagParameters</d
|
|||||||
<command:noun>InfisicalCertificateAuthority</command:noun>
|
<command:noun>InfisicalCertificateAuthority</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>When -CaId is supplied (ById parameter set) returns a single internal CA. Otherwise (List parameter set) returns CAs scoped by -Kind: Internal (default, /api/v1/cert-manager/ca/internal), Any (/api/v1/cert-manager/ca returning both internal and ACME), or Acme (filters the generic endpoint to ACME issuers only). -ProjectId defaults to the session-pinned project when omitted.</maml:para>
|
<maml:para>When -CaId is supplied (ById parameter set) returns a single internal CA. Otherwise (List parameter set) returns CAs scoped by -Kind: Internal (default, /api/v1/cert-manager/ca/internal), Any (/api/v1/cert-manager/ca returning both internal and ACME), or Acme (filters the generic endpoint to ACME issuers only). -ProjectId is required.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -1023,12 +1025,12 @@ $RemoveInfisicalTagResult = Remove-InfisicalTag @RemoveInfisicalTagParameters</d
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificateAuthority</dev:code>
|
<dev:code>Get-InfisicalCertificateAuthority</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every internal CA visible in the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every internal CA visible in the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificateAuthority -Kind Any</dev:code>
|
<dev:code>Get-InfisicalCertificateAuthority -Kind Any</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every CA (internal and ACME) visible in the session-pinned project; inspect the Type property to distinguish them.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every CA (internal and ACME) visible in the supplied project; inspect the Type property to distinguish them.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
@@ -1036,7 +1038,7 @@ $RemoveInfisicalTagResult = Remove-InfisicalTag @RemoveInfisicalTagParameters</d
|
|||||||
|
|
||||||
$GetInfisicalCertificateAuthorityParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$GetInfisicalCertificateAuthorityParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$GetInfisicalCertificateAuthorityParameters.CaId = $GetInfisicalCertificateAuthorityListResult.Id
|
$GetInfisicalCertificateAuthorityParameters.CaId = $GetInfisicalCertificateAuthorityListResult.Id
|
||||||
$GetInfisicalCertificateAuthorityParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$GetInfisicalCertificateAuthorityParameters.ProjectId = $ProjectId
|
||||||
$GetInfisicalCertificateAuthorityParameters.Verbose = $True
|
$GetInfisicalCertificateAuthorityParameters.Verbose = $True
|
||||||
|
|
||||||
$GetInfisicalCertificateAuthorityResult = Get-InfisicalCertificateAuthority @GetInfisicalCertificateAuthorityParameters</dev:code>
|
$GetInfisicalCertificateAuthorityResult = Get-InfisicalCertificateAuthority @GetInfisicalCertificateAuthorityParameters</dev:code>
|
||||||
@@ -1053,7 +1055,7 @@ $GetInfisicalCertificateAuthorityResult = Get-InfisicalCertificateAuthority @Get
|
|||||||
<command:noun>InfisicalCertificate</command:noun>
|
<command:noun>InfisicalCertificate</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) enumerates certificates with optional filters for -CommonName, -FriendlyName, -Status, and -CaId; -Limit and -Offset drive a single page and pages are walked automatically until exhausted unless -NoAutoPage is supplied. When -SerialNumber is supplied (Single parameter set) the cmdlet returns one certificate record. -ProjectId defaults to the session-pinned project in both modes.</maml:para>
|
<maml:para>Default (List parameter set) enumerates certificates with optional filters for -CommonName, -FriendlyName, -Status, and -CaId; -Limit and -Offset drive a single page and pages are walked automatically until exhausted unless -NoAutoPage is supplied. When -SerialNumber is supplied (Single parameter set) the cmdlet returns one certificate record. -ProjectId is required in both modes.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -1065,7 +1067,7 @@ $GetInfisicalCertificateAuthorityResult = Get-InfisicalCertificateAuthority @Get
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificate -Status 'active'</dev:code>
|
<dev:code>Get-InfisicalCertificate -Status 'active'</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every active certificate in the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every active certificate in the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
@@ -1077,7 +1079,7 @@ $GetInfisicalCertificateAuthorityResult = Get-InfisicalCertificateAuthority @Get
|
|||||||
<dev:code>$GetInfisicalCertificateAuthorityListResult = Get-InfisicalCertificateAuthority | Where-Object { $_.FriendlyName -eq 'Issuing CA - Platform' }
|
<dev:code>$GetInfisicalCertificateAuthorityListResult = Get-InfisicalCertificateAuthority | Where-Object { $_.FriendlyName -eq 'Issuing CA - Platform' }
|
||||||
|
|
||||||
$GetInfisicalCertificateParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$GetInfisicalCertificateParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$GetInfisicalCertificateParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$GetInfisicalCertificateParameters.ProjectId = $ProjectId
|
||||||
$GetInfisicalCertificateParameters.CommonName = $env:COMPUTERNAME
|
$GetInfisicalCertificateParameters.CommonName = $env:COMPUTERNAME
|
||||||
$GetInfisicalCertificateParameters.FriendlyName = 'web-tier'
|
$GetInfisicalCertificateParameters.FriendlyName = 'web-tier'
|
||||||
$GetInfisicalCertificateParameters.Status = 'active'
|
$GetInfisicalCertificateParameters.Status = 'active'
|
||||||
@@ -1099,7 +1101,7 @@ $GetInfisicalCertificateListResult = Get-InfisicalCertificate @GetInfisicalCerti
|
|||||||
<command:noun>InfisicalPkiSubscriber</command:noun>
|
<command:noun>InfisicalPkiSubscriber</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) returns every PKI subscriber configured on the project. When -Name is supplied (ByName parameter set) the cmdlet returns one subscriber by its slug. -ProjectId defaults to the session-pinned project in both modes.</maml:para>
|
<maml:para>Default (List parameter set) returns every PKI subscriber configured on the project. When -Name is supplied (ByName parameter set) the cmdlet returns one subscriber by its slug. -ProjectId is required in both modes.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -1111,12 +1113,12 @@ $GetInfisicalCertificateListResult = Get-InfisicalCertificate @GetInfisicalCerti
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalPkiSubscriber</dev:code>
|
<dev:code>Get-InfisicalPkiSubscriber</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every PKI subscriber defined on the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every PKI subscriber defined on the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalPkiSubscriber -Name 'mecm'</dev:code>
|
<dev:code>Get-InfisicalPkiSubscriber -Name 'mecm'</dev:code>
|
||||||
<dev:remarks><maml:para>Retrieves the 'mecm' PKI subscriber from the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Retrieves the 'mecm' PKI subscriber from the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
@@ -1124,7 +1126,7 @@ $GetInfisicalCertificateListResult = Get-InfisicalCertificate @GetInfisicalCerti
|
|||||||
|
|
||||||
$GetInfisicalPkiSubscriberParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$GetInfisicalPkiSubscriberParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$GetInfisicalPkiSubscriberParameters.Name = $GetInfisicalPkiSubscriberListResult[0].Name
|
$GetInfisicalPkiSubscriberParameters.Name = $GetInfisicalPkiSubscriberListResult[0].Name
|
||||||
$GetInfisicalPkiSubscriberParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$GetInfisicalPkiSubscriberParameters.ProjectId = $ProjectId
|
||||||
$GetInfisicalPkiSubscriberParameters.Verbose = $True
|
$GetInfisicalPkiSubscriberParameters.Verbose = $True
|
||||||
|
|
||||||
$GetInfisicalPkiSubscriberResult = Get-InfisicalPkiSubscriber @GetInfisicalPkiSubscriberParameters</dev:code>
|
$GetInfisicalPkiSubscriberResult = Get-InfisicalPkiSubscriber @GetInfisicalPkiSubscriberParameters</dev:code>
|
||||||
@@ -1141,7 +1143,7 @@ $GetInfisicalPkiSubscriberResult = Get-InfisicalPkiSubscriber @GetInfisicalPkiSu
|
|||||||
<command:noun>InfisicalCertificateProfile</command:noun>
|
<command:noun>InfisicalCertificateProfile</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) returns every certificate profile configured on the project via /api/v1/cert-manager/certificate-profiles, with optional -Limit, -Offset, and -IncludeConfigs. When -ProfileId is supplied (ById parameter set) the cmdlet returns one profile by its id. -ProjectId defaults to the session-pinned project in both modes.</maml:para>
|
<maml:para>Default (List parameter set) returns every certificate profile configured on the project via /api/v1/cert-manager/certificate-profiles, with optional -Limit, -Offset, and -IncludeConfigs. When -ProfileId is supplied (ById parameter set) the cmdlet returns one profile by its id. -ProjectId is required in both modes.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -1153,12 +1155,12 @@ $GetInfisicalPkiSubscriberResult = Get-InfisicalPkiSubscriber @GetInfisicalPkiSu
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificateProfile</dev:code>
|
<dev:code>Get-InfisicalCertificateProfile</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every certificate profile defined on the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every certificate profile defined on the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificateProfile -ProfileId '8257641e-c808-454e-ac92-8dc920be865f'</dev:code>
|
<dev:code>Get-InfisicalCertificateProfile -ProfileId '8257641e-c808-454e-ac92-8dc920be865f'</dev:code>
|
||||||
<dev:remarks><maml:para>Retrieves a single certificate profile by id from the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Retrieves a single certificate profile by id from the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
@@ -1166,7 +1168,7 @@ $GetInfisicalPkiSubscriberResult = Get-InfisicalPkiSubscriber @GetInfisicalPkiSu
|
|||||||
|
|
||||||
$GetInfisicalCertificateProfileParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$GetInfisicalCertificateProfileParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$GetInfisicalCertificateProfileParameters.ProfileId = $GetInfisicalCertificateProfileListResult[0].Id
|
$GetInfisicalCertificateProfileParameters.ProfileId = $GetInfisicalCertificateProfileListResult[0].Id
|
||||||
$GetInfisicalCertificateProfileParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$GetInfisicalCertificateProfileParameters.ProjectId = $ProjectId
|
||||||
$GetInfisicalCertificateProfileParameters.Verbose = $True
|
$GetInfisicalCertificateProfileParameters.Verbose = $True
|
||||||
|
|
||||||
$GetInfisicalCertificateProfileResult = Get-InfisicalCertificateProfile @GetInfisicalCertificateProfileParameters</dev:code>
|
$GetInfisicalCertificateProfileResult = Get-InfisicalCertificateProfile @GetInfisicalCertificateProfileParameters</dev:code>
|
||||||
@@ -1183,7 +1185,7 @@ $GetInfisicalCertificateProfileResult = Get-InfisicalCertificateProfile @GetInfi
|
|||||||
<command:noun>InfisicalCertificatePolicy</command:noun>
|
<command:noun>InfisicalCertificatePolicy</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Default (List parameter set) returns every certificate policy configured on the project via /api/v1/cert-manager/certificate-policies, with optional -Limit and -Offset. When -PolicyId is supplied (ById parameter set) the cmdlet returns one policy by its id. -ProjectId defaults to the session-pinned project in both modes.</maml:para>
|
<maml:para>Default (List parameter set) returns every certificate policy configured on the project via /api/v1/cert-manager/certificate-policies, with optional -Limit and -Offset. When -PolicyId is supplied (ById parameter set) the cmdlet returns one policy by its id. -ProjectId is required in both modes.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -1195,12 +1197,12 @@ $GetInfisicalCertificateProfileResult = Get-InfisicalCertificateProfile @GetInfi
|
|||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificatePolicy</dev:code>
|
<dev:code>Get-InfisicalCertificatePolicy</dev:code>
|
||||||
<dev:remarks><maml:para>Lists every certificate policy defined on the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists every certificate policy defined on the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificatePolicy -PolicyId '3e69306a-e7c1-4fd2-a140-7fb300e53c43'</dev:code>
|
<dev:code>Get-InfisicalCertificatePolicy -PolicyId '3e69306a-e7c1-4fd2-a140-7fb300e53c43'</dev:code>
|
||||||
<dev:remarks><maml:para>Retrieves a single certificate policy by id from the session-pinned project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Retrieves a single certificate policy by id from the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 3</maml:title>
|
<maml:title>EXAMPLE 3</maml:title>
|
||||||
@@ -1208,7 +1210,7 @@ $GetInfisicalCertificateProfileResult = Get-InfisicalCertificateProfile @GetInfi
|
|||||||
|
|
||||||
$GetInfisicalCertificatePolicyParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$GetInfisicalCertificatePolicyParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$GetInfisicalCertificatePolicyParameters.PolicyId = $GetInfisicalCertificatePolicyListResult[0].Id
|
$GetInfisicalCertificatePolicyParameters.PolicyId = $GetInfisicalCertificatePolicyListResult[0].Id
|
||||||
$GetInfisicalCertificatePolicyParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$GetInfisicalCertificatePolicyParameters.ProjectId = $ProjectId
|
||||||
$GetInfisicalCertificatePolicyParameters.Verbose = $True
|
$GetInfisicalCertificatePolicyParameters.Verbose = $True
|
||||||
|
|
||||||
$GetInfisicalCertificatePolicyResult = Get-InfisicalCertificatePolicy @GetInfisicalCertificatePolicyParameters</dev:code>
|
$GetInfisicalCertificatePolicyResult = Get-InfisicalCertificatePolicy @GetInfisicalCertificatePolicyParameters</dev:code>
|
||||||
@@ -1225,7 +1227,7 @@ $GetInfisicalCertificatePolicyResult = Get-InfisicalCertificatePolicy @GetInfisi
|
|||||||
<command:noun>InfisicalCertificate</command:noun>
|
<command:noun>InfisicalCertificate</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Performs a server-side search across certificates with filters for friendly name, common name, free-text search, status, CA/profile/application/enrollment scope, key/signature algorithm, source, and validity window (-NotBeforeFrom/-NotBeforeTo/-NotAfterFrom/-NotAfterTo). Results are paged automatically unless -NoAutoPage is supplied. -ProjectId defaults to the session-pinned project when omitted.</maml:para>
|
<maml:para>Performs a server-side search across certificates with filters for friendly name, common name, free-text search, status, CA/profile/application/enrollment scope, key/signature algorithm, source, and validity window (-NotBeforeFrom/-NotBeforeTo/-NotAfterFrom/-NotAfterTo). Results are paged automatically unless -NoAutoPage is supplied. -ProjectId is required.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<maml:alertSet>
|
<maml:alertSet>
|
||||||
<maml:title>Notes</maml:title>
|
<maml:title>Notes</maml:title>
|
||||||
@@ -1244,7 +1246,7 @@ $GetInfisicalCertificatePolicyResult = Get-InfisicalCertificatePolicy @GetInfisi
|
|||||||
<dev:code>$GetInfisicalCertificateAuthorityListResult = Get-InfisicalCertificateAuthority | Where-Object { $_.FriendlyName -eq 'Issuing CA - Platform' }
|
<dev:code>$GetInfisicalCertificateAuthorityListResult = Get-InfisicalCertificateAuthority | Where-Object { $_.FriendlyName -eq 'Issuing CA - Platform' }
|
||||||
|
|
||||||
$SearchInfisicalCertificateParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
$SearchInfisicalCertificateParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$SearchInfisicalCertificateParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$SearchInfisicalCertificateParameters.ProjectId = $ProjectId
|
||||||
$SearchInfisicalCertificateParameters.CommonName = $env:COMPUTERNAME
|
$SearchInfisicalCertificateParameters.CommonName = $env:COMPUTERNAME
|
||||||
$SearchInfisicalCertificateParameters.Status = 'active'
|
$SearchInfisicalCertificateParameters.Status = 'active'
|
||||||
$SearchInfisicalCertificateParameters.CaId = @($GetInfisicalCertificateAuthorityListResult.Id)
|
$SearchInfisicalCertificateParameters.CaId = @($GetInfisicalCertificateAuthorityListResult.Id)
|
||||||
@@ -1287,7 +1289,7 @@ $SearchInfisicalCertificateResult = Search-InfisicalCertificate @SearchInfisical
|
|||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>$RequestInfisicalCertificateParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
<dev:code>$RequestInfisicalCertificateParameters = New-Object -TypeName 'System.Collections.Specialized.OrderedDictionary' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
$RequestInfisicalCertificateParameters.PkiSubscriberSlug = 'web-tier'
|
$RequestInfisicalCertificateParameters.PkiSubscriberSlug = 'web-tier'
|
||||||
$RequestInfisicalCertificateParameters.ProjectId = $ConnectInfisicalParameters.ProjectId
|
$RequestInfisicalCertificateParameters.ProjectId = $ProjectId
|
||||||
$RequestInfisicalCertificateParameters.CommonName = ([System.Net.Dns]::GetHostEntry($env:COMPUTERNAME)).HostName
|
$RequestInfisicalCertificateParameters.CommonName = ([System.Net.Dns]::GetHostEntry($env:COMPUTERNAME)).HostName
|
||||||
$RequestInfisicalCertificateParameters.DnsName = @(([System.Net.Dns]::GetHostEntry($env:COMPUTERNAME)).HostName, $env:COMPUTERNAME)
|
$RequestInfisicalCertificateParameters.DnsName = @(([System.Net.Dns]::GetHostEntry($env:COMPUTERNAME)).HostName, $env:COMPUTERNAME)
|
||||||
$RequestInfisicalCertificateParameters.KeyAlgorithm = 'Rsa'
|
$RequestInfisicalCertificateParameters.KeyAlgorithm = 'Rsa'
|
||||||
@@ -1480,22 +1482,22 @@ $UninstallInfisicalCertificateResult = Uninstall-InfisicalCertificate @Uninstall
|
|||||||
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
|
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
|
||||||
<command:details>
|
<command:details>
|
||||||
<command:name>Get-InfisicalCertificateApplication</command:name>
|
<command:name>Get-InfisicalCertificateApplication</command:name>
|
||||||
<maml:description><maml:para>Lists or retrieves an Infisical Certificate Manager Application from the active project.</maml:para></maml:description>
|
<maml:description><maml:para>Lists or retrieves an Infisical Certificate Manager Application from the supplied project.</maml:para></maml:description>
|
||||||
<command:verb>Get</command:verb>
|
<command:verb>Get</command:verb>
|
||||||
<command:noun>InfisicalCertificateApplication</command:noun>
|
<command:noun>InfisicalCertificateApplication</command:noun>
|
||||||
</command:details>
|
</command:details>
|
||||||
<maml:description>
|
<maml:description>
|
||||||
<maml:para>Reads Infisical certificate-manager Applications (the join target used by EST/ACME/SCEP profile attachments) using the active connection's project scope. The List parameter set returns all applications visible to the caller; the ById and ByName sets return a single application. ProjectId falls back to the active connection when omitted.</maml:para>
|
<maml:para>Reads Infisical certificate-manager Applications (the join target used by EST/ACME/SCEP profile attachments) for the supplied project. The List parameter set returns all applications visible to the caller; the ById and ByName sets return a single application. -ProjectId is required.</maml:para>
|
||||||
</maml:description>
|
</maml:description>
|
||||||
<command:examples>
|
<command:examples>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 1</maml:title>
|
<maml:title>EXAMPLE 1</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificateApplication</dev:code>
|
<dev:code>Get-InfisicalCertificateApplication -ProjectId $ProjectId</dev:code>
|
||||||
<dev:remarks><maml:para>Lists certificate-manager applications for the active project.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Lists certificate-manager applications for the supplied project.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
<maml:title>EXAMPLE 2</maml:title>
|
<maml:title>EXAMPLE 2</maml:title>
|
||||||
<dev:code>Get-InfisicalCertificateApplication -ApplicationName 'workstation-mdm'</dev:code>
|
<dev:code>Get-InfisicalCertificateApplication -ApplicationName 'workstation-mdm' -ProjectId $ProjectId</dev:code>
|
||||||
<dev:remarks><maml:para>Retrieves a single application by name.</maml:para></dev:remarks>
|
<dev:remarks><maml:para>Retrieves a single application by name.</maml:para></dev:remarks>
|
||||||
</command:example>
|
</command:example>
|
||||||
<command:example>
|
<command:example>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using System.Reflection;
|
|||||||
using PSInfisicalAPI.Cmdlets;
|
using PSInfisicalAPI.Cmdlets;
|
||||||
using PSInfisicalAPI.Connections;
|
using PSInfisicalAPI.Connections;
|
||||||
using PSInfisicalAPI.Logging;
|
using PSInfisicalAPI.Logging;
|
||||||
using PSInfisicalAPI.Models;
|
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace PSInfisicalAPI.Tests
|
namespace PSInfisicalAPI.Tests
|
||||||
@@ -26,21 +25,6 @@ namespace PSInfisicalAPI.Tests
|
|||||||
[Cmdlet(VerbsCommon.Get, "TestCmdlet")]
|
[Cmdlet(VerbsCommon.Get, "TestCmdlet")]
|
||||||
private sealed class TestCmdlet : InfisicalCmdletBase
|
private sealed class TestCmdlet : InfisicalCmdletBase
|
||||||
{
|
{
|
||||||
public string CallResolveProjectId(InfisicalConnection connection, string explicitValue)
|
|
||||||
{
|
|
||||||
return ResolveProjectId(connection, explicitValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string CallResolveEnvironment(InfisicalConnection connection, string explicitValue)
|
|
||||||
{
|
|
||||||
return ResolveEnvironment(connection, explicitValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string CallResolveSecretPath(InfisicalConnection connection, string explicitValue)
|
|
||||||
{
|
|
||||||
return ResolveSecretPath(connection, explicitValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string CallResolveApiVersion(InfisicalConnection connection, string explicitValue)
|
public string CallResolveApiVersion(InfisicalConnection connection, string explicitValue)
|
||||||
{
|
{
|
||||||
return ResolveApiVersion(connection, explicitValue);
|
return ResolveApiVersion(connection, explicitValue);
|
||||||
@@ -65,60 +49,11 @@ namespace PSInfisicalAPI.Tests
|
|||||||
return new InfisicalConnection
|
return new InfisicalConnection
|
||||||
{
|
{
|
||||||
BaseUri = new Uri("https://app.example.com"),
|
BaseUri = new Uri("https://app.example.com"),
|
||||||
ProjectId = "proj-conn",
|
|
||||||
Environment = "prod-conn",
|
|
||||||
DefaultSecretPath = "/db",
|
|
||||||
OrganizationId = "org-conn",
|
OrganizationId = "org-conn",
|
||||||
PinnedApiVersion = "v3"
|
PinnedApiVersion = "v3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Explicit_Value_Overrides_Connection_And_Does_Not_Log()
|
|
||||||
{
|
|
||||||
RecordingLogger logger = new RecordingLogger();
|
|
||||||
TestCmdlet cmdlet = CreateCmdletWith(logger);
|
|
||||||
|
|
||||||
string resolved = cmdlet.CallResolveProjectId(ConnectionWithDefaults(), "explicit-proj");
|
|
||||||
Assert.Equal("explicit-proj", resolved);
|
|
||||||
Assert.Empty(logger.VerboseEntries);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Missing_Value_Inherits_From_Connection_And_Logs()
|
|
||||||
{
|
|
||||||
RecordingLogger logger = new RecordingLogger();
|
|
||||||
TestCmdlet cmdlet = CreateCmdletWith(logger);
|
|
||||||
|
|
||||||
string resolved = cmdlet.CallResolveProjectId(ConnectionWithDefaults(), null);
|
|
||||||
Assert.Equal("proj-conn", resolved);
|
|
||||||
Assert.Single(logger.VerboseEntries);
|
|
||||||
Assert.Contains("Inherited ProjectId", logger.VerboseEntries[0]);
|
|
||||||
Assert.Contains("proj-conn", logger.VerboseEntries[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void ResolveSecretPath_Defaults_To_Root_When_Connection_Has_No_Default()
|
|
||||||
{
|
|
||||||
RecordingLogger logger = new RecordingLogger();
|
|
||||||
TestCmdlet cmdlet = CreateCmdletWith(logger);
|
|
||||||
|
|
||||||
InfisicalConnection bareConnection = new InfisicalConnection { BaseUri = new Uri("https://app.example.com") };
|
|
||||||
string resolved = cmdlet.CallResolveSecretPath(bareConnection, null);
|
|
||||||
Assert.Equal("/", resolved);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void ResolveSecretPath_Inherits_From_Connection_When_Set()
|
|
||||||
{
|
|
||||||
RecordingLogger logger = new RecordingLogger();
|
|
||||||
TestCmdlet cmdlet = CreateCmdletWith(logger);
|
|
||||||
|
|
||||||
string resolved = cmdlet.CallResolveSecretPath(ConnectionWithDefaults(), null);
|
|
||||||
Assert.Equal("/db", resolved);
|
|
||||||
Assert.Contains(logger.VerboseEntries, v => v.Contains("SecretPath") && v.Contains("/db"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ResolveApiVersion_Prefers_PinnedApiVersion_From_Connection()
|
public void ResolveApiVersion_Prefers_PinnedApiVersion_From_Connection()
|
||||||
{
|
{
|
||||||
@@ -130,14 +65,24 @@ namespace PSInfisicalAPI.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ResolveEnvironment_And_ResolveOrganizationId_Inherit()
|
public void ResolveOrganizationId_Inherits_From_Connection_And_Logs()
|
||||||
{
|
{
|
||||||
RecordingLogger logger = new RecordingLogger();
|
RecordingLogger logger = new RecordingLogger();
|
||||||
TestCmdlet cmdlet = CreateCmdletWith(logger);
|
TestCmdlet cmdlet = CreateCmdletWith(logger);
|
||||||
|
|
||||||
Assert.Equal("prod-conn", cmdlet.CallResolveEnvironment(ConnectionWithDefaults(), null));
|
|
||||||
Assert.Equal("org-conn", cmdlet.CallResolveOrganizationId(ConnectionWithDefaults(), null));
|
Assert.Equal("org-conn", cmdlet.CallResolveOrganizationId(ConnectionWithDefaults(), null));
|
||||||
Assert.Equal(2, logger.VerboseEntries.Count);
|
Assert.Single(logger.VerboseEntries);
|
||||||
|
Assert.Contains("OrganizationId", logger.VerboseEntries[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void ResolveOrganizationId_Explicit_Value_Wins_And_Does_Not_Log()
|
||||||
|
{
|
||||||
|
RecordingLogger logger = new RecordingLogger();
|
||||||
|
TestCmdlet cmdlet = CreateCmdletWith(logger);
|
||||||
|
|
||||||
|
Assert.Equal("explicit-org", cmdlet.CallResolveOrganizationId(ConnectionWithDefaults(), "explicit-org"));
|
||||||
|
Assert.Empty(logger.VerboseEntries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,26 +26,6 @@ namespace PSInfisicalAPI.Tests
|
|||||||
Assert.True(MatchesAny(name, InfisicalEnvironmentResolver.OrganizationIdPatterns), "Expected match for " + name);
|
Assert.True(MatchesAny(name, InfisicalEnvironmentResolver.OrganizationIdPatterns), "Expected match for " + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("INFISICAL_PROJECT_ID")]
|
|
||||||
[InlineData("INFISICAL_WORKSPACE_ID")]
|
|
||||||
[InlineData("CLOUDINIT_INFISICAL_PROJECTID")]
|
|
||||||
public void ProjectIdPatterns_Match_Expected_Names(string name)
|
|
||||||
{
|
|
||||||
Assert.True(MatchesAny(name, InfisicalEnvironmentResolver.ProjectIdPatterns), "Expected match for " + name);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("INFISICAL_ENVIRONMENT")]
|
|
||||||
[InlineData("INFISICAL_ENVIRONMENT_NAME")]
|
|
||||||
[InlineData("INFISICAL_ENV")]
|
|
||||||
[InlineData("INFISICAL_ENV_SLUG")]
|
|
||||||
[InlineData("CLOUDINIT_INFISICAL_ENVIRONMENT")]
|
|
||||||
public void EnvironmentPatterns_Match_Expected_Names(string name)
|
|
||||||
{
|
|
||||||
Assert.True(MatchesAny(name, InfisicalEnvironmentResolver.EnvironmentPatterns), "Expected match for " + name);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("INFISICAL_CLIENT_ID")]
|
[InlineData("INFISICAL_CLIENT_ID")]
|
||||||
[InlineData("INFISICAL_UNIVERSAL_AUTH_CLIENT_ID")]
|
[InlineData("INFISICAL_UNIVERSAL_AUTH_CLIENT_ID")]
|
||||||
@@ -78,15 +58,6 @@ namespace PSInfisicalAPI.Tests
|
|||||||
Assert.True(MatchesAny(name, InfisicalEnvironmentResolver.AccessTokenPatterns), "Expected match for " + name);
|
Assert.True(MatchesAny(name, InfisicalEnvironmentResolver.AccessTokenPatterns), "Expected match for " + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("INFISICAL_SECRET_PATH")]
|
|
||||||
[InlineData("INFISICAL_DEFAULT_SECRET_PATH")]
|
|
||||||
[InlineData("CLOUDINIT_INFISICAL_SECRETPATH")]
|
|
||||||
public void SecretPathPatterns_Match_Expected_Names(string name)
|
|
||||||
{
|
|
||||||
Assert.True(MatchesAny(name, InfisicalEnvironmentResolver.SecretPathPatterns), "Expected match for " + name);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("INFISICAL_SECRET_PATH")]
|
[InlineData("INFISICAL_SECRET_PATH")]
|
||||||
[InlineData("INFISICAL_DEFAULT_SECRET_PATH")]
|
[InlineData("INFISICAL_DEFAULT_SECRET_PATH")]
|
||||||
@@ -108,9 +79,6 @@ namespace PSInfisicalAPI.Tests
|
|||||||
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.AccessTokenPatterns));
|
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.AccessTokenPatterns));
|
||||||
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.BaseUriPatterns));
|
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.BaseUriPatterns));
|
||||||
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.OrganizationIdPatterns));
|
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.OrganizationIdPatterns));
|
||||||
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.ProjectIdPatterns));
|
|
||||||
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.EnvironmentPatterns));
|
|
||||||
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.SecretPathPatterns));
|
|
||||||
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.ApiVersionPatterns));
|
Assert.False(MatchesAny(name, InfisicalEnvironmentResolver.ApiVersionPatterns));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,18 +33,6 @@ namespace PSInfisicalAPI.Authentication
|
|||||||
new Regex(@".*INFISICAL.*ORG(ANIZATION)?.*ID.*", DefaultRegexOptions)
|
new Regex(@".*INFISICAL.*ORG(ANIZATION)?.*ID.*", DefaultRegexOptions)
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly Regex[] ProjectIdPatterns = new[]
|
|
||||||
{
|
|
||||||
new Regex(@".*INFISICAL.*(PROJECT|WORKSPACE).*ID.*", DefaultRegexOptions)
|
|
||||||
};
|
|
||||||
|
|
||||||
public static readonly Regex[] EnvironmentPatterns = new[]
|
|
||||||
{
|
|
||||||
new Regex(@".*INFISICAL.*ENV(IRONMENT)?.*NAME.*", DefaultRegexOptions),
|
|
||||||
new Regex(@".*INFISICAL.*ENV(IRONMENT)?.*SLUG.*", DefaultRegexOptions),
|
|
||||||
new Regex(@".*INFISICAL.*ENV(IRONMENT)?.*", DefaultRegexOptions)
|
|
||||||
};
|
|
||||||
|
|
||||||
public static readonly Regex[] ClientIdPatterns = new[]
|
public static readonly Regex[] ClientIdPatterns = new[]
|
||||||
{
|
{
|
||||||
new Regex(@".*INFISICAL.*CLIENT.*ID.*", DefaultRegexOptions),
|
new Regex(@".*INFISICAL.*CLIENT.*ID.*", DefaultRegexOptions),
|
||||||
@@ -64,12 +52,6 @@ namespace PSInfisicalAPI.Authentication
|
|||||||
new Regex(@".*INFISICAL.*TOKEN.*", DefaultRegexOptions)
|
new Regex(@".*INFISICAL.*TOKEN.*", DefaultRegexOptions)
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly Regex[] SecretPathPatterns = new[]
|
|
||||||
{
|
|
||||||
new Regex(@".*INFISICAL.*SECRET.*PATH.*", DefaultRegexOptions),
|
|
||||||
new Regex(@".*INFISICAL.*DEFAULT.*PATH.*", DefaultRegexOptions)
|
|
||||||
};
|
|
||||||
|
|
||||||
public static readonly Regex[] ApiVersionPatterns = new[]
|
public static readonly Regex[] ApiVersionPatterns = new[]
|
||||||
{
|
{
|
||||||
new Regex(@".*INFISICAL.*API.*VERSION.*", DefaultRegexOptions)
|
new Regex(@".*INFISICAL.*API.*VERSION.*", DefaultRegexOptions)
|
||||||
|
|||||||
@@ -28,12 +28,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public string OrganizationId { get; set; }
|
public string OrganizationId { get; set; }
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string ProjectId { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Environment { get; set; }
|
|
||||||
|
|
||||||
[Parameter(ParameterSetName = ParameterSetUniversalAuth)]
|
[Parameter(ParameterSetName = ParameterSetUniversalAuth)]
|
||||||
public string ClientId { get; set; }
|
public string ClientId { get; set; }
|
||||||
|
|
||||||
@@ -62,9 +56,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Parameter(Mandatory = true, ParameterSetName = ParameterSetLdap)]
|
[Parameter(Mandatory = true, ParameterSetName = ParameterSetLdap)]
|
||||||
public SecureString Password { get; set; }
|
public SecureString Password { get; set; }
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string SecretPath { get; set; } = "/";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string ApiVersion { get; set; } = "v4";
|
public string ApiVersion { get; set; } = "v4";
|
||||||
|
|
||||||
@@ -185,9 +176,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
PinnedApiVersion = apiVersionExplicitlyBound ? ApiVersion : null,
|
PinnedApiVersion = apiVersionExplicitlyBound ? ApiVersion : null,
|
||||||
AuthType = authType,
|
AuthType = authType,
|
||||||
OrganizationId = OrganizationId,
|
OrganizationId = OrganizationId,
|
||||||
ProjectId = ProjectId,
|
|
||||||
Environment = Environment,
|
|
||||||
DefaultSecretPath = string.IsNullOrEmpty(SecretPath) ? "/" : SecretPath,
|
|
||||||
ConnectedAtUtc = DateTimeOffset.UtcNow,
|
ConnectedAtUtc = DateTimeOffset.UtcNow,
|
||||||
ExpiresAtUtc = authResult.ExpiresAtUtc,
|
ExpiresAtUtc = authResult.ExpiresAtUtc,
|
||||||
IsConnected = true,
|
IsConnected = true,
|
||||||
@@ -215,8 +203,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
bool needsScan =
|
bool needsScan =
|
||||||
BaseUri == null ||
|
BaseUri == null ||
|
||||||
string.IsNullOrWhiteSpace(OrganizationId) ||
|
string.IsNullOrWhiteSpace(OrganizationId) ||
|
||||||
string.IsNullOrWhiteSpace(ProjectId) ||
|
|
||||||
string.IsNullOrWhiteSpace(Environment) ||
|
|
||||||
(tokenSet && (AccessToken == null || AccessToken.Length == 0)) ||
|
(tokenSet && (AccessToken == null || AccessToken.Length == 0)) ||
|
||||||
(universalSet && string.IsNullOrWhiteSpace(ClientId)) ||
|
(universalSet && string.IsNullOrWhiteSpace(ClientId)) ||
|
||||||
(universalSet && (ClientSecret == null || ClientSecret.Length == 0));
|
(universalSet && (ClientSecret == null || ClientSecret.Length == 0));
|
||||||
@@ -242,8 +228,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
OrganizationId = InfisicalEnvironmentResolver.ResolveString("OrganizationId", InfisicalEnvironmentResolver.OrganizationIdPatterns, OrganizationId, Logger);
|
OrganizationId = InfisicalEnvironmentResolver.ResolveString("OrganizationId", InfisicalEnvironmentResolver.OrganizationIdPatterns, OrganizationId, Logger);
|
||||||
ProjectId = InfisicalEnvironmentResolver.ResolveString("ProjectId", InfisicalEnvironmentResolver.ProjectIdPatterns, ProjectId, Logger);
|
|
||||||
Environment = InfisicalEnvironmentResolver.ResolveString("Environment", InfisicalEnvironmentResolver.EnvironmentPatterns, Environment, Logger);
|
|
||||||
|
|
||||||
if (tokenSet)
|
if (tokenSet)
|
||||||
{
|
{
|
||||||
@@ -255,15 +239,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
ClientSecret = InfisicalEnvironmentResolver.ResolveSecureString("ClientSecret", InfisicalEnvironmentResolver.ClientSecretPatterns, ClientSecret, Logger);
|
ClientSecret = InfisicalEnvironmentResolver.ResolveSecureString("ClientSecret", InfisicalEnvironmentResolver.ClientSecretPatterns, ClientSecret, Logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!MyInvocation.BoundParameters.ContainsKey("SecretPath"))
|
|
||||||
{
|
|
||||||
string resolvedPath = InfisicalEnvironmentResolver.ResolveString("SecretPath", InfisicalEnvironmentResolver.SecretPathPatterns, null, Logger);
|
|
||||||
if (!string.IsNullOrWhiteSpace(resolvedPath))
|
|
||||||
{
|
|
||||||
SecretPath = resolvedPath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!MyInvocation.BoundParameters.ContainsKey("ApiVersion"))
|
if (!MyInvocation.BoundParameters.ContainsKey("ApiVersion"))
|
||||||
{
|
{
|
||||||
string resolvedVersion = InfisicalEnvironmentResolver.ResolveString("ApiVersion", InfisicalEnvironmentResolver.ApiVersionPatterns, null, Logger);
|
string resolvedVersion = InfisicalEnvironmentResolver.ResolveString("ApiVersion", InfisicalEnvironmentResolver.ApiVersionPatterns, null, Logger);
|
||||||
@@ -280,8 +255,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
if (BaseUri == null) { missing.Add("BaseUri"); }
|
if (BaseUri == null) { missing.Add("BaseUri"); }
|
||||||
if (string.IsNullOrWhiteSpace(OrganizationId)) { missing.Add("OrganizationId"); }
|
if (string.IsNullOrWhiteSpace(OrganizationId)) { missing.Add("OrganizationId"); }
|
||||||
if (string.IsNullOrWhiteSpace(ProjectId)) { missing.Add("ProjectId"); }
|
|
||||||
if (string.IsNullOrWhiteSpace(Environment)) { missing.Add("Environment"); }
|
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, ParameterSetToken, StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, ParameterSetToken, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
public string DestinationEnvironment { get; set; }
|
public string DestinationEnvironment { get; set; }
|
||||||
|
|
||||||
[Parameter] public string DestinationSecretPath { get; set; }
|
[Parameter] public string DestinationSecretPath { get; set; }
|
||||||
[Parameter] public string SourceEnvironment { get; set; }
|
[Parameter(Mandatory = true)] public string SourceEnvironment { get; set; }
|
||||||
[Parameter] public string SourceSecretPath { get; set; }
|
[Parameter] public string SourceSecretPath { get; set; }
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string ApiVersion { get; set; }
|
[Parameter] public string ApiVersion { get; set; }
|
||||||
[Parameter] public SwitchParameter OverwriteExisting { get; set; }
|
[Parameter] public SwitchParameter OverwriteExisting { get; set; }
|
||||||
[Parameter] public SwitchParameter CopySecretValue { get; set; }
|
[Parameter] public SwitchParameter CopySecretValue { get; set; }
|
||||||
@@ -35,9 +35,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
if (SecretId == null || SecretId.Length == 0) { return; }
|
if (SecretId == null || SecretId.Length == 0) { return; }
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
string resolvedSourceEnv = ResolveEnvironment(connection, SourceEnvironment);
|
|
||||||
string resolvedSourcePath = ResolveSecretPath(connection, SourceSecretPath);
|
|
||||||
string resolvedApiVersion = ResolveApiVersion(connection, ApiVersion);
|
string resolvedApiVersion = ResolveApiVersion(connection, ApiVersion);
|
||||||
|
|
||||||
string target = string.Concat(SecretId.Length, " secret(s) -> ", DestinationEnvironment);
|
string target = string.Concat(SecretId.Length, " secret(s) -> ", DestinationEnvironment);
|
||||||
@@ -45,10 +42,10 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
InfisicalDuplicateSecretsRequest request = new InfisicalDuplicateSecretsRequest
|
InfisicalDuplicateSecretsRequest request = new InfisicalDuplicateSecretsRequest
|
||||||
{
|
{
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = ProjectId,
|
||||||
SourceEnvironment = resolvedSourceEnv,
|
SourceEnvironment = SourceEnvironment,
|
||||||
DestinationEnvironment = DestinationEnvironment,
|
DestinationEnvironment = DestinationEnvironment,
|
||||||
SourceSecretPath = resolvedSourcePath,
|
SourceSecretPath = SourceSecretPath,
|
||||||
DestinationSecretPath = DestinationSecretPath,
|
DestinationSecretPath = DestinationSecretPath,
|
||||||
SecretIds = SecretId,
|
SecretIds = SecretId,
|
||||||
ApiVersion = resolvedApiVersion,
|
ApiVersion = resolvedApiVersion,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Name")]
|
[Alias("Name")]
|
||||||
public string ApplicationName { get; set; }
|
public string ApplicationName { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
[Parameter(ParameterSetName = "List")] public int? Limit { get; set; }
|
[Parameter(ParameterSetName = "List")] public int? Limit { get; set; }
|
||||||
|
|
||||||
@@ -30,23 +30,22 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "ById", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "ById", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
InfisicalCertificateApplication app = client.GetCertificateApplication(connection, Id, resolvedProjectId);
|
InfisicalCertificateApplication app = client.GetCertificateApplication(connection, Id, ProjectId);
|
||||||
if (app != null) { WriteObject(app); }
|
if (app != null) { WriteObject(app); }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "ByName", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "ByName", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
InfisicalCertificateApplication app = client.GetCertificateApplicationByName(connection, ApplicationName, resolvedProjectId);
|
InfisicalCertificateApplication app = client.GetCertificateApplicationByName(connection, ApplicationName, ProjectId);
|
||||||
if (app != null) { WriteObject(app); }
|
if (app != null) { WriteObject(app); }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalCertificateApplication[] all = client.ListCertificateApplications(connection, resolvedProjectId, Limit, Offset);
|
InfisicalCertificateApplication[] all = client.ListCertificateApplications(connection, ProjectId, Limit, Offset);
|
||||||
foreach (InfisicalCertificateApplication app in all)
|
foreach (InfisicalCertificateApplication app in all)
|
||||||
{
|
{
|
||||||
WriteObject(app);
|
WriteObject(app);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("CertificateProfileId")]
|
[Alias("CertificateProfileId")]
|
||||||
public string ProfileId { get; set; }
|
public string ProfileId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
{
|
{
|
||||||
@@ -26,9 +26,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
InfisicalCertificateApplicationEnrollment enrollment = client.GetCertificateApplicationEnrollment(connection, ApplicationId, ProfileId, resolvedProjectId);
|
InfisicalCertificateApplicationEnrollment enrollment = client.GetCertificateApplicationEnrollment(connection, ApplicationId, ProfileId, ProjectId);
|
||||||
if (enrollment != null)
|
if (enrollment != null)
|
||||||
{
|
{
|
||||||
WriteObject(enrollment);
|
WriteObject(enrollment);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Id")]
|
[Alias("Id")]
|
||||||
public string CaId { get; set; }
|
public string CaId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
[Parameter(ParameterSetName = "List")]
|
[Parameter(ParameterSetName = "List")]
|
||||||
[ValidateSet("Internal", "Acme", "Any")]
|
[ValidateSet("Internal", "Acme", "Any")]
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
public string SerialNumber { get; set; }
|
public string SerialNumber { get; set; }
|
||||||
|
|
||||||
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
||||||
[Parameter(ParameterSetName = "List")] public string ProjectId { get; set; }
|
[Parameter(ParameterSetName = "List", Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter(ParameterSetName = "List")] public string CommonName { get; set; }
|
[Parameter(ParameterSetName = "List")] public string CommonName { get; set; }
|
||||||
[Parameter(ParameterSetName = "List")] public string FriendlyName { get; set; }
|
[Parameter(ParameterSetName = "List")] public string FriendlyName { get; set; }
|
||||||
[Parameter(ParameterSetName = "List")] public string Status { get; set; }
|
[Parameter(ParameterSetName = "List")] public string Status { get; set; }
|
||||||
@@ -42,11 +42,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
InfisicalCertificateSearchQuery query = new InfisicalCertificateSearchQuery
|
InfisicalCertificateSearchQuery query = new InfisicalCertificateSearchQuery
|
||||||
{
|
{
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = ProjectId,
|
||||||
CommonName = CommonName,
|
CommonName = CommonName,
|
||||||
FriendlyName = FriendlyName,
|
FriendlyName = FriendlyName,
|
||||||
Status = Status,
|
Status = Status,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Id", "CertificatePolicyId")]
|
[Alias("Id", "CertificatePolicyId")]
|
||||||
public string PolicyId { get; set; }
|
public string PolicyId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
[Parameter(ParameterSetName = "List")] public int? Limit { get; set; }
|
[Parameter(ParameterSetName = "List")] public int? Limit { get; set; }
|
||||||
|
|
||||||
@@ -26,11 +26,10 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "ById", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "ById", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
InfisicalCertificatePolicy policy = client.GetCertificatePolicy(connection, PolicyId, resolvedProjectId);
|
InfisicalCertificatePolicy policy = client.GetCertificatePolicy(connection, PolicyId, ProjectId);
|
||||||
if (policy != null)
|
if (policy != null)
|
||||||
{
|
{
|
||||||
WriteObject(policy);
|
WriteObject(policy);
|
||||||
@@ -39,7 +38,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalCertificatePolicy[] all = client.ListCertificatePolicies(connection, resolvedProjectId, Limit, Offset);
|
InfisicalCertificatePolicy[] all = client.ListCertificatePolicies(connection, ProjectId, Limit, Offset);
|
||||||
foreach (InfisicalCertificatePolicy policy in all)
|
foreach (InfisicalCertificatePolicy policy in all)
|
||||||
{
|
{
|
||||||
WriteObject(policy);
|
WriteObject(policy);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Id", "CertificateProfileId")]
|
[Alias("Id", "CertificateProfileId")]
|
||||||
public string ProfileId { get; set; }
|
public string ProfileId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
[Parameter(ParameterSetName = "List")] public int? Limit { get; set; }
|
[Parameter(ParameterSetName = "List")] public int? Limit { get; set; }
|
||||||
|
|
||||||
@@ -28,11 +28,10 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "ById", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "ById", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
InfisicalCertificateProfile profile = client.GetCertificateProfile(connection, ProfileId, resolvedProjectId);
|
InfisicalCertificateProfile profile = client.GetCertificateProfile(connection, ProfileId, ProjectId);
|
||||||
if (profile != null)
|
if (profile != null)
|
||||||
{
|
{
|
||||||
WriteObject(profile);
|
WriteObject(profile);
|
||||||
@@ -42,7 +41,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool? includeConfigs = MyInvocation.BoundParameters.ContainsKey("IncludeConfigs") ? (bool?)IncludeConfigs.IsPresent : null;
|
bool? includeConfigs = MyInvocation.BoundParameters.ContainsKey("IncludeConfigs") ? (bool?)IncludeConfigs.IsPresent : null;
|
||||||
InfisicalCertificateProfile[] all = client.ListCertificateProfiles(connection, resolvedProjectId, Limit, Offset, includeConfigs);
|
InfisicalCertificateProfile[] all = client.ListCertificateProfiles(connection, ProjectId, Limit, Offset, includeConfigs);
|
||||||
foreach (InfisicalCertificateProfile profile in all)
|
foreach (InfisicalCertificateProfile profile in all)
|
||||||
{
|
{
|
||||||
WriteObject(profile);
|
WriteObject(profile);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Slug", "Id", "Environment")]
|
[Alias("Slug", "Id", "Environment")]
|
||||||
public string EnvironmentSlugOrId { get; set; }
|
public string EnvironmentSlugOrId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
||||||
|
|
||||||
@@ -23,12 +23,11 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalEnvironmentClient client = new InfisicalEnvironmentClient(HttpClient, Logger);
|
InfisicalEnvironmentClient client = new InfisicalEnvironmentClient(HttpClient, Logger);
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "Single", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "Single", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
InfisicalEnvironment env = client.Retrieve(connection, resolvedProjectId, EnvironmentSlugOrId);
|
InfisicalEnvironment env = client.Retrieve(connection, ProjectId, EnvironmentSlugOrId);
|
||||||
if (env != null)
|
if (env != null)
|
||||||
{
|
{
|
||||||
WriteObject(env);
|
WriteObject(env);
|
||||||
@@ -37,7 +36,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalEnvironment[] envs = client.List(connection, resolvedProjectId);
|
InfisicalEnvironment[] envs = client.List(connection, ProjectId);
|
||||||
foreach (InfisicalEnvironment env in envs)
|
foreach (InfisicalEnvironment env in envs)
|
||||||
{
|
{
|
||||||
WriteObject(env);
|
WriteObject(env);
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Name", "Id")]
|
[Alias("Name", "Id")]
|
||||||
public string FolderNameOrId { get; set; }
|
public string FolderNameOrId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Environment { get; set; }
|
[Parameter(Mandatory = true)] public string Environment { get; set; }
|
||||||
[Parameter] public string Path { get; set; }
|
[Parameter] public string Path { get; set; }
|
||||||
|
|
||||||
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
||||||
@@ -25,14 +25,11 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
string resolvedEnvironment = ResolveEnvironment(connection, Environment);
|
|
||||||
string resolvedPath = ResolveSecretPath(connection, Path);
|
|
||||||
InfisicalFolderClient client = new InfisicalFolderClient(HttpClient, Logger);
|
InfisicalFolderClient client = new InfisicalFolderClient(HttpClient, Logger);
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "Single", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "Single", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
InfisicalFolder folder = client.Retrieve(connection, resolvedProjectId, resolvedEnvironment, resolvedPath, FolderNameOrId);
|
InfisicalFolder folder = client.Retrieve(connection, ProjectId, Environment, Path, FolderNameOrId);
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
WriteObject(folder);
|
WriteObject(folder);
|
||||||
@@ -41,7 +38,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalFolder[] folders = client.List(connection, resolvedProjectId, resolvedEnvironment, resolvedPath);
|
InfisicalFolder[] folders = client.List(connection, ProjectId, Environment, Path);
|
||||||
foreach (InfisicalFolder folder in folders)
|
foreach (InfisicalFolder folder in folders)
|
||||||
{
|
{
|
||||||
WriteObject(folder);
|
WriteObject(folder);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("SubscriberName", "Slug")]
|
[Alias("SubscriberName", "Slug")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
{
|
{
|
||||||
@@ -22,11 +22,10 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "ByName", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "ByName", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
InfisicalPkiSubscriber subscriber = client.GetPkiSubscriber(connection, Name, resolvedProjectId);
|
InfisicalPkiSubscriber subscriber = client.GetPkiSubscriber(connection, Name, ProjectId);
|
||||||
if (subscriber != null)
|
if (subscriber != null)
|
||||||
{
|
{
|
||||||
WriteObject(subscriber);
|
WriteObject(subscriber);
|
||||||
@@ -35,7 +34,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalPkiSubscriber[] all = client.ListPkiSubscribers(connection, resolvedProjectId);
|
InfisicalPkiSubscriber[] all = client.ListPkiSubscribers(connection, ProjectId);
|
||||||
foreach (InfisicalPkiSubscriber subscriber in all)
|
foreach (InfisicalPkiSubscriber subscriber in all)
|
||||||
{
|
{
|
||||||
WriteObject(subscriber);
|
WriteObject(subscriber);
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName = "List")]
|
||||||
|
[ValidateSet("secret-manager", "cert-manager", "kms", "ssh", "secret-scanning", "pam", "ai")]
|
||||||
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName = "List")] public SwitchParameter IncludeRoles { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -25,8 +31,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
if (string.Equals(ParameterSetName, "Single", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "Single", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
InfisicalProject project = client.Retrieve(connection, ProjectId);
|
||||||
InfisicalProject project = client.Retrieve(connection, resolvedProjectId);
|
|
||||||
if (project != null)
|
if (project != null)
|
||||||
{
|
{
|
||||||
WriteObject(project);
|
WriteObject(project);
|
||||||
@@ -35,7 +40,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalProject[] projects = client.List(connection);
|
InfisicalProject[] projects = client.List(connection, Type, IncludeRoles.IsPresent);
|
||||||
foreach (InfisicalProject project in projects)
|
foreach (InfisicalProject project in projects)
|
||||||
{
|
{
|
||||||
WriteObject(project);
|
WriteObject(project);
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Parameter(ParameterSetName = "Single", Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 0)]
|
[Parameter(ParameterSetName = "Single", Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 0)]
|
||||||
public string SecretName { get; set; }
|
public string SecretName { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Environment { get; set; }
|
[Parameter(Mandatory = true)] public string Environment { get; set; }
|
||||||
[Parameter] public string SecretPath { get; set; }
|
[Parameter] public string SecretPath { get; set; }
|
||||||
[Parameter] public string ApiVersion { get; set; }
|
[Parameter] public string ApiVersion { get; set; }
|
||||||
[Parameter] public SwitchParameter ViewSecretValue { get; set; } = SwitchParameter.Present;
|
[Parameter] public SwitchParameter ViewSecretValue { get; set; } = SwitchParameter.Present;
|
||||||
@@ -44,9 +44,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
InfisicalRetrieveSecretQuery query = new InfisicalRetrieveSecretQuery
|
InfisicalRetrieveSecretQuery query = new InfisicalRetrieveSecretQuery
|
||||||
{
|
{
|
||||||
SecretName = SecretName,
|
SecretName = SecretName,
|
||||||
ProjectId = ResolveProjectId(connection, ProjectId),
|
ProjectId = ProjectId,
|
||||||
Environment = ResolveEnvironment(connection, Environment),
|
Environment = Environment,
|
||||||
SecretPath = ResolveSecretPath(connection, SecretPath),
|
SecretPath = SecretPath,
|
||||||
ApiVersion = ResolveApiVersion(connection, ApiVersion),
|
ApiVersion = ResolveApiVersion(connection, ApiVersion),
|
||||||
Version = Version,
|
Version = Version,
|
||||||
Type = Type.ToString(),
|
Type = Type.ToString(),
|
||||||
@@ -66,9 +66,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
InfisicalListSecretsQuery listQuery = new InfisicalListSecretsQuery
|
InfisicalListSecretsQuery listQuery = new InfisicalListSecretsQuery
|
||||||
{
|
{
|
||||||
ProjectId = ResolveProjectId(connection, ProjectId),
|
ProjectId = ProjectId,
|
||||||
Environment = ResolveEnvironment(connection, Environment),
|
Environment = Environment,
|
||||||
SecretPath = ResolveSecretPath(connection, SecretPath),
|
SecretPath = SecretPath,
|
||||||
ApiVersion = ResolveApiVersion(connection, ApiVersion),
|
ApiVersion = ResolveApiVersion(connection, ApiVersion),
|
||||||
Recursive = Recursive.IsPresent,
|
Recursive = Recursive.IsPresent,
|
||||||
IncludeImports = IncludeImports.IsPresent,
|
IncludeImports = IncludeImports.IsPresent,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Slug", "Id")]
|
[Alias("Slug", "Id")]
|
||||||
public string TagSlugOrId { get; set; }
|
public string TagSlugOrId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
[Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; }
|
||||||
|
|
||||||
@@ -23,12 +23,11 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalTagClient client = new InfisicalTagClient(HttpClient, Logger);
|
InfisicalTagClient client = new InfisicalTagClient(HttpClient, Logger);
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "Single", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "Single", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
InfisicalTag tag = client.Retrieve(connection, resolvedProjectId, TagSlugOrId);
|
InfisicalTag tag = client.Retrieve(connection, ProjectId, TagSlugOrId);
|
||||||
if (tag != null)
|
if (tag != null)
|
||||||
{
|
{
|
||||||
WriteObject(tag);
|
WriteObject(tag);
|
||||||
@@ -37,7 +36,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalTag[] tags = client.List(connection, resolvedProjectId);
|
InfisicalTag[] tags = client.List(connection, ProjectId);
|
||||||
foreach (InfisicalTag tag in tags)
|
foreach (InfisicalTag tag in tags)
|
||||||
{
|
{
|
||||||
WriteObject(tag);
|
WriteObject(tag);
|
||||||
|
|||||||
@@ -46,21 +46,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
ThrowTerminatingError(record);
|
ThrowTerminatingError(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string ResolveProjectId(InfisicalConnection connection, string explicitValue)
|
|
||||||
{
|
|
||||||
return ResolveValue("ProjectId", explicitValue, connection != null ? connection.ProjectId : null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected string ResolveEnvironment(InfisicalConnection connection, string explicitValue)
|
|
||||||
{
|
|
||||||
return ResolveValue("Environment", explicitValue, connection != null ? connection.Environment : null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected string ResolveSecretPath(InfisicalConnection connection, string explicitValue)
|
|
||||||
{
|
|
||||||
return ResolveValue("SecretPath", explicitValue, connection != null ? connection.DefaultSecretPath : null, "/");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected string ResolveApiVersion(InfisicalConnection connection, string explicitValue)
|
protected string ResolveApiVersion(InfisicalConnection connection, string explicitValue)
|
||||||
{
|
{
|
||||||
string fromConnection = connection != null ? (!string.IsNullOrEmpty(connection.PinnedApiVersion) ? connection.PinnedApiVersion : connection.ApiVersion) : null;
|
string fromConnection = connection != null ? (!string.IsNullOrEmpty(connection.PinnedApiVersion) ? connection.PinnedApiVersion : connection.ApiVersion) : null;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
{
|
{
|
||||||
[Parameter(Mandatory = true, Position = 0)] public string Name { get; set; }
|
[Parameter(Mandatory = true, Position = 0)] public string Name { get; set; }
|
||||||
[Parameter(Mandatory = true, Position = 1)] public string Slug { get; set; }
|
[Parameter(Mandatory = true, Position = 1)] public string Slug { get; set; }
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public int? Position { get; set; }
|
[Parameter] public int? Position { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
@@ -25,9 +25,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalEnvironmentClient client = new InfisicalEnvironmentClient(HttpClient, Logger);
|
InfisicalEnvironmentClient client = new InfisicalEnvironmentClient(HttpClient, Logger);
|
||||||
InfisicalEnvironment env = client.Create(connection, resolvedProjectId, Name, Slug, Position);
|
InfisicalEnvironment env = client.Create(connection, ProjectId, Name, Slug, Position);
|
||||||
if (env != null)
|
if (env != null)
|
||||||
{
|
{
|
||||||
WriteObject(env);
|
WriteObject(env);
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
public sealed class NewInfisicalFolderCmdlet : InfisicalCmdletBase
|
public sealed class NewInfisicalFolderCmdlet : InfisicalCmdletBase
|
||||||
{
|
{
|
||||||
[Parameter(Mandatory = true, Position = 0)] public string Name { get; set; }
|
[Parameter(Mandatory = true, Position = 0)] public string Name { get; set; }
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Environment { get; set; }
|
[Parameter(Mandatory = true)] public string Environment { get; set; }
|
||||||
[Parameter] public string Path { get; set; }
|
[Parameter] public string Path { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
@@ -25,11 +25,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
string resolvedEnvironment = ResolveEnvironment(connection, Environment);
|
|
||||||
string resolvedPath = ResolveSecretPath(connection, Path);
|
|
||||||
InfisicalFolderClient client = new InfisicalFolderClient(HttpClient, Logger);
|
InfisicalFolderClient client = new InfisicalFolderClient(HttpClient, Logger);
|
||||||
InfisicalFolder folder = client.Create(connection, resolvedProjectId, resolvedEnvironment, Name, resolvedPath);
|
InfisicalFolder folder = client.Create(connection, ProjectId, Environment, Name, Path);
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
WriteObject(folder);
|
WriteObject(folder);
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
public IDictionary<string, string>[] Secrets { get; set; }
|
public IDictionary<string, string>[] Secrets { get; set; }
|
||||||
|
|
||||||
[Parameter] public string SecretComment { get; set; }
|
[Parameter] public string SecretComment { get; set; }
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Environment { get; set; }
|
[Parameter(Mandatory = true)] public string Environment { get; set; }
|
||||||
[Parameter] public string SecretPath { get; set; }
|
[Parameter] public string SecretPath { get; set; }
|
||||||
[Parameter] public string ApiVersion { get; set; }
|
[Parameter] public string ApiVersion { get; set; }
|
||||||
[Parameter] public InfisicalSecretType Type { get; set; } = InfisicalSecretType.Shared;
|
[Parameter] public InfisicalSecretType Type { get; set; } = InfisicalSecretType.Shared;
|
||||||
@@ -41,9 +41,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
string resolvedEnvironment = ResolveEnvironment(connection, Environment);
|
|
||||||
string resolvedSecretPath = ResolveSecretPath(connection, SecretPath);
|
|
||||||
string resolvedApiVersion = ResolveApiVersion(connection, ApiVersion);
|
string resolvedApiVersion = ResolveApiVersion(connection, ApiVersion);
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "Bulk", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "Bulk", StringComparison.Ordinal))
|
||||||
@@ -54,9 +51,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
InfisicalBulkCreateSecretsRequest bulk = new InfisicalBulkCreateSecretsRequest
|
InfisicalBulkCreateSecretsRequest bulk = new InfisicalBulkCreateSecretsRequest
|
||||||
{
|
{
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = Environment,
|
||||||
SecretPath = resolvedSecretPath,
|
SecretPath = SecretPath,
|
||||||
ApiVersion = resolvedApiVersion,
|
ApiVersion = resolvedApiVersion,
|
||||||
Secrets = InfisicalBulkSecretConverter.ToCreateItems(Secrets)
|
Secrets = InfisicalBulkSecretConverter.ToCreateItems(Secrets)
|
||||||
};
|
};
|
||||||
@@ -82,9 +79,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
SecretName = SecretName,
|
SecretName = SecretName,
|
||||||
SecretValue = plainValue,
|
SecretValue = plainValue,
|
||||||
SecretComment = SecretComment,
|
SecretComment = SecretComment,
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = Environment,
|
||||||
SecretPath = resolvedSecretPath,
|
SecretPath = SecretPath,
|
||||||
Type = Type.ToString(),
|
Type = Type.ToString(),
|
||||||
ApiVersion = resolvedApiVersion,
|
ApiVersion = resolvedApiVersion,
|
||||||
SkipMultilineEncoding = SkipMultilineEncoding.IsPresent ? (bool?)true : null,
|
SkipMultilineEncoding = SkipMultilineEncoding.IsPresent ? (bool?)true : null,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Parameter(Mandatory = true, Position = 0)] public string Slug { get; set; }
|
[Parameter(Mandatory = true, Position = 0)] public string Slug { get; set; }
|
||||||
[Parameter] public string Name { get; set; }
|
[Parameter] public string Name { get; set; }
|
||||||
[Parameter] public string Color { get; set; }
|
[Parameter] public string Color { get; set; }
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
{
|
{
|
||||||
@@ -25,9 +25,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalTagClient client = new InfisicalTagClient(HttpClient, Logger);
|
InfisicalTagClient client = new InfisicalTagClient(HttpClient, Logger);
|
||||||
InfisicalTag tag = client.Create(connection, resolvedProjectId, Slug, Name, Color);
|
InfisicalTag tag = client.Create(connection, ProjectId, Slug, Name, Color);
|
||||||
if (tag != null)
|
if (tag != null)
|
||||||
{
|
{
|
||||||
WriteObject(tag);
|
WriteObject(tag);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Id")]
|
[Alias("Id")]
|
||||||
public string EnvironmentId { get; set; }
|
public string EnvironmentId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public SwitchParameter PassThru { get; set; }
|
[Parameter] public SwitchParameter PassThru { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
@@ -25,9 +25,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalEnvironmentClient client = new InfisicalEnvironmentClient(HttpClient, Logger);
|
InfisicalEnvironmentClient client = new InfisicalEnvironmentClient(HttpClient, Logger);
|
||||||
client.Delete(connection, resolvedProjectId, EnvironmentId);
|
client.Delete(connection, ProjectId, EnvironmentId);
|
||||||
|
|
||||||
if (PassThru.IsPresent)
|
if (PassThru.IsPresent)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Id")]
|
[Alias("Id")]
|
||||||
public string FolderId { get; set; }
|
public string FolderId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Environment { get; set; }
|
[Parameter(Mandatory = true)] public string Environment { get; set; }
|
||||||
[Parameter] public string Path { get; set; }
|
[Parameter] public string Path { get; set; }
|
||||||
[Parameter] public SwitchParameter PassThru { get; set; }
|
[Parameter] public SwitchParameter PassThru { get; set; }
|
||||||
|
|
||||||
@@ -27,11 +27,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
string resolvedEnvironment = ResolveEnvironment(connection, Environment);
|
|
||||||
string resolvedPath = ResolveSecretPath(connection, Path);
|
|
||||||
InfisicalFolderClient client = new InfisicalFolderClient(HttpClient, Logger);
|
InfisicalFolderClient client = new InfisicalFolderClient(HttpClient, Logger);
|
||||||
client.Delete(connection, resolvedProjectId, resolvedEnvironment, FolderId, resolvedPath);
|
client.Delete(connection, ProjectId, Environment, FolderId, Path);
|
||||||
|
|
||||||
if (PassThru.IsPresent)
|
if (PassThru.IsPresent)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Cmdlet(VerbsCommon.Remove, "InfisicalProject", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)]
|
[Cmdlet(VerbsCommon.Remove, "InfisicalProject", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)]
|
||||||
public sealed class RemoveInfisicalProjectCmdlet : InfisicalCmdletBase
|
public sealed class RemoveInfisicalProjectCmdlet : InfisicalCmdletBase
|
||||||
{
|
{
|
||||||
[Parameter(ValueFromPipelineByPropertyName = true, Position = 0)]
|
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 0)]
|
||||||
[Alias("Id")]
|
[Alias("Id")]
|
||||||
public string ProjectId { get; set; }
|
public string ProjectId { get; set; }
|
||||||
|
|
||||||
@@ -19,19 +19,18 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
if (!ShouldProcess(resolvedProjectId, "Remove Infisical project"))
|
if (!ShouldProcess(ProjectId, "Remove Infisical project"))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalProjectClient client = new InfisicalProjectClient(HttpClient, Logger);
|
InfisicalProjectClient client = new InfisicalProjectClient(HttpClient, Logger);
|
||||||
client.Delete(connection, resolvedProjectId);
|
client.Delete(connection, ProjectId);
|
||||||
|
|
||||||
if (PassThru.IsPresent)
|
if (PassThru.IsPresent)
|
||||||
{
|
{
|
||||||
WriteObject(resolvedProjectId);
|
WriteObject(ProjectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Names", "SecretKeys")]
|
[Alias("Names", "SecretKeys")]
|
||||||
public string[] SecretNames { get; set; }
|
public string[] SecretNames { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Environment { get; set; }
|
[Parameter(Mandatory = true)] public string Environment { get; set; }
|
||||||
[Parameter] public string SecretPath { get; set; }
|
[Parameter] public string SecretPath { get; set; }
|
||||||
[Parameter] public string ApiVersion { get; set; }
|
[Parameter] public string ApiVersion { get; set; }
|
||||||
[Parameter] public InfisicalSecretType Type { get; set; } = InfisicalSecretType.Shared;
|
[Parameter] public InfisicalSecretType Type { get; set; } = InfisicalSecretType.Shared;
|
||||||
@@ -28,9 +28,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
string resolvedEnvironment = ResolveEnvironment(connection, Environment);
|
|
||||||
string resolvedSecretPath = ResolveSecretPath(connection, SecretPath);
|
|
||||||
string resolvedApiVersion = ResolveApiVersion(connection, ApiVersion);
|
string resolvedApiVersion = ResolveApiVersion(connection, ApiVersion);
|
||||||
|
|
||||||
InfisicalSecretsClient client = new InfisicalSecretsClient(HttpClient, Logger);
|
InfisicalSecretsClient client = new InfisicalSecretsClient(HttpClient, Logger);
|
||||||
@@ -43,9 +40,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
InfisicalBulkDeleteSecretsRequest bulk = new InfisicalBulkDeleteSecretsRequest
|
InfisicalBulkDeleteSecretsRequest bulk = new InfisicalBulkDeleteSecretsRequest
|
||||||
{
|
{
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = Environment,
|
||||||
SecretPath = resolvedSecretPath,
|
SecretPath = SecretPath,
|
||||||
ApiVersion = resolvedApiVersion,
|
ApiVersion = resolvedApiVersion,
|
||||||
SecretNames = SecretNames
|
SecretNames = SecretNames
|
||||||
};
|
};
|
||||||
@@ -65,9 +62,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
InfisicalDeleteSecretRequest request = new InfisicalDeleteSecretRequest
|
InfisicalDeleteSecretRequest request = new InfisicalDeleteSecretRequest
|
||||||
{
|
{
|
||||||
SecretName = SecretName,
|
SecretName = SecretName,
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = Environment,
|
||||||
SecretPath = resolvedSecretPath,
|
SecretPath = SecretPath,
|
||||||
Type = Type.ToString(),
|
Type = Type.ToString(),
|
||||||
ApiVersion = resolvedApiVersion
|
ApiVersion = resolvedApiVersion
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Id")]
|
[Alias("Id")]
|
||||||
public string TagId { get; set; }
|
public string TagId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public SwitchParameter PassThru { get; set; }
|
[Parameter] public SwitchParameter PassThru { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
@@ -25,9 +25,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalTagClient client = new InfisicalTagClient(HttpClient, Logger);
|
InfisicalTagClient client = new InfisicalTagClient(HttpClient, Logger);
|
||||||
client.Delete(connection, resolvedProjectId, TagId);
|
client.Delete(connection, ProjectId, TagId);
|
||||||
|
|
||||||
if (PassThru.IsPresent)
|
if (PassThru.IsPresent)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("ProfileId")]
|
[Alias("ProfileId")]
|
||||||
public string CertificateProfileId { get; set; }
|
public string CertificateProfileId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public IDictionary Subject { get; set; }
|
[Parameter] public IDictionary Subject { get; set; }
|
||||||
[Parameter] public string CommonName { get; set; }
|
[Parameter] public string CommonName { get; set; }
|
||||||
[Parameter] public string Country { get; set; }
|
[Parameter] public string Country { get; set; }
|
||||||
@@ -77,14 +77,13 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
InfisicalCsrSubject csrSubject = InfisicalCertificateRequestHelpers.MergeSubject(Subject, CommonName, Country, State, Locality, Organization, OrganizationalUnit, EmailAddress);
|
InfisicalCsrSubject csrSubject = InfisicalCertificateRequestHelpers.MergeSubject(Subject, CommonName, Country, State, Locality, Organization, OrganizationalUnit, EmailAddress);
|
||||||
List<string> dnsNames = BuildDnsNames(csrSubject);
|
List<string> dnsNames = BuildDnsNames(csrSubject);
|
||||||
if (string.IsNullOrEmpty(csrSubject.CommonName) && dnsNames.Count > 0) { csrSubject.CommonName = dnsNames[0]; }
|
if (string.IsNullOrEmpty(csrSubject.CommonName) && dnsNames.Count > 0) { csrSubject.CommonName = dnsNames[0]; }
|
||||||
if (string.IsNullOrEmpty(csrSubject.CommonName)) { throw new InvalidOperationException("Subject CommonName could not be determined and no DnsName was provided."); }
|
if (string.IsNullOrEmpty(csrSubject.CommonName)) { throw new InvalidOperationException("Subject CommonName could not be determined and no DnsName was provided."); }
|
||||||
|
|
||||||
X509Certificate2 existing = TryFindExisting(client, connection, resolvedProjectId, csrSubject.CommonName);
|
X509Certificate2 existing = TryFindExisting(client, connection, ProjectId, csrSubject.CommonName);
|
||||||
if (existing != null && !Force.IsPresent && !(AllowRenewal.IsPresent && InfisicalLocalCertificateLookup.IsRenewable(existing, RenewalThresholdDays)))
|
if (existing != null && !Force.IsPresent && !(AllowRenewal.IsPresent && InfisicalLocalCertificateLookup.IsRenewable(existing, RenewalThresholdDays)))
|
||||||
{
|
{
|
||||||
Logger.Information(Component, string.Concat("Reusing existing certificate (Thumbprint=", existing.Thumbprint, ", NotAfter=", existing.NotAfter.ToString("u"), ")."));
|
Logger.Information(Component, string.Concat("Reusing existing certificate (Thumbprint=", existing.Thumbprint, ", NotAfter=", existing.NotAfter.ToString("u"), ")."));
|
||||||
@@ -118,7 +117,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
InfisicalCsrOptions csrOptions = new InfisicalCsrOptions { KeyAlgorithm = KeyAlgorithm, RsaKeySize = KeySize, EcCurve = Curve };
|
InfisicalCsrOptions csrOptions = new InfisicalCsrOptions { KeyAlgorithm = KeyAlgorithm, RsaKeySize = KeySize, EcCurve = Curve };
|
||||||
InfisicalCsrResult csr = InfisicalCsrBuilder.Build(csrSubject, dnsNames, IpAddress, csrOptions);
|
InfisicalCsrResult csr = InfisicalCsrBuilder.Build(csrSubject, dnsNames, IpAddress, csrOptions);
|
||||||
InfisicalSignedCertificate signed = SignCertificate(client, connection, resolvedProjectId, csr.CsrPem);
|
InfisicalSignedCertificate signed = SignCertificate(client, connection, ProjectId, csr.CsrPem);
|
||||||
signed.PrivateKeyPem = csr.PrivateKeyPem;
|
signed.PrivateKeyPem = csr.PrivateKeyPem;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(signed.CertificatePem))
|
if (string.IsNullOrEmpty(signed.CertificatePem))
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[OutputType(typeof(InfisicalCertificate))]
|
[OutputType(typeof(InfisicalCertificate))]
|
||||||
public sealed class SearchInfisicalCertificateCmdlet : InfisicalCmdletBase
|
public sealed class SearchInfisicalCertificateCmdlet : InfisicalCmdletBase
|
||||||
{
|
{
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string FriendlyName { get; set; }
|
[Parameter] public string FriendlyName { get; set; }
|
||||||
[Parameter] public string CommonName { get; set; }
|
[Parameter] public string CommonName { get; set; }
|
||||||
[Parameter] public string Search { get; set; }
|
[Parameter] public string Search { get; set; }
|
||||||
@@ -39,10 +39,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
InfisicalPkiClient client = new InfisicalPkiClient(HttpClient, Logger);
|
||||||
|
|
||||||
InfisicalCertificateSearchQuery query = BuildQuery(resolvedProjectId);
|
InfisicalCertificateSearchQuery query = BuildQuery(ProjectId);
|
||||||
int requestedLimit = query.Limit ?? 100;
|
int requestedLimit = query.Limit ?? 100;
|
||||||
query.Limit = requestedLimit;
|
query.Limit = requestedLimit;
|
||||||
query.Offset = query.Offset ?? 0;
|
query.Offset = query.Offset ?? 0;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Alias("Id")]
|
[Alias("Id")]
|
||||||
public string EnvironmentId { get; set; }
|
public string EnvironmentId { get; set; }
|
||||||
|
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Name { get; set; }
|
[Parameter] public string Name { get; set; }
|
||||||
[Parameter] public string Slug { get; set; }
|
[Parameter] public string Slug { get; set; }
|
||||||
[Parameter] public int? Position { get; set; }
|
[Parameter] public int? Position { get; set; }
|
||||||
@@ -29,9 +29,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalEnvironmentClient client = new InfisicalEnvironmentClient(HttpClient, Logger);
|
InfisicalEnvironmentClient client = new InfisicalEnvironmentClient(HttpClient, Logger);
|
||||||
InfisicalEnvironment env = client.Update(connection, resolvedProjectId, EnvironmentId, Name, Slug, Position);
|
InfisicalEnvironment env = client.Update(connection, ProjectId, EnvironmentId, Name, Slug, Position);
|
||||||
if (env != null)
|
if (env != null)
|
||||||
{
|
{
|
||||||
WriteObject(env);
|
WriteObject(env);
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
public string FolderId { get; set; }
|
public string FolderId { get; set; }
|
||||||
|
|
||||||
[Parameter(Mandatory = true, Position = 1)] public string Name { get; set; }
|
[Parameter(Mandatory = true, Position = 1)] public string Name { get; set; }
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Environment { get; set; }
|
[Parameter(Mandatory = true)] public string Environment { get; set; }
|
||||||
[Parameter] public string Path { get; set; }
|
[Parameter] public string Path { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
@@ -29,11 +29,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
string resolvedEnvironment = ResolveEnvironment(connection, Environment);
|
|
||||||
string resolvedPath = ResolveSecretPath(connection, Path);
|
|
||||||
InfisicalFolderClient client = new InfisicalFolderClient(HttpClient, Logger);
|
InfisicalFolderClient client = new InfisicalFolderClient(HttpClient, Logger);
|
||||||
InfisicalFolder folder = client.Update(connection, resolvedProjectId, resolvedEnvironment, FolderId, Name, resolvedPath);
|
InfisicalFolder folder = client.Update(connection, ProjectId, Environment, FolderId, Name, Path);
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
WriteObject(folder);
|
WriteObject(folder);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[OutputType(typeof(InfisicalProject))]
|
[OutputType(typeof(InfisicalProject))]
|
||||||
public sealed class UpdateInfisicalProjectCmdlet : InfisicalCmdletBase
|
public sealed class UpdateInfisicalProjectCmdlet : InfisicalCmdletBase
|
||||||
{
|
{
|
||||||
[Parameter(ValueFromPipelineByPropertyName = true, Position = 0)]
|
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 0)]
|
||||||
[Alias("Id")]
|
[Alias("Id")]
|
||||||
public string ProjectId { get; set; }
|
public string ProjectId { get; set; }
|
||||||
|
|
||||||
@@ -23,15 +23,14 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
|
|
||||||
if (!ShouldProcess(resolvedProjectId, "Update Infisical project"))
|
if (!ShouldProcess(ProjectId, "Update Infisical project"))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfisicalProjectClient client = new InfisicalProjectClient(HttpClient, Logger);
|
InfisicalProjectClient client = new InfisicalProjectClient(HttpClient, Logger);
|
||||||
InfisicalProject project = client.Update(connection, resolvedProjectId, Name, Description, AutoCapitalization);
|
InfisicalProject project = client.Update(connection, ProjectId, Name, Description, AutoCapitalization);
|
||||||
if (project != null)
|
if (project != null)
|
||||||
{
|
{
|
||||||
WriteObject(project);
|
WriteObject(project);
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
[Parameter] public string NewSecretName { get; set; }
|
[Parameter] public string NewSecretName { get; set; }
|
||||||
[Parameter] public string SecretComment { get; set; }
|
[Parameter] public string SecretComment { get; set; }
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
[Parameter] public string Environment { get; set; }
|
[Parameter(Mandatory = true)] public string Environment { get; set; }
|
||||||
[Parameter] public string SecretPath { get; set; }
|
[Parameter] public string SecretPath { get; set; }
|
||||||
[Parameter] public string ApiVersion { get; set; }
|
[Parameter] public string ApiVersion { get; set; }
|
||||||
[Parameter] public InfisicalSecretType Type { get; set; } = InfisicalSecretType.Shared;
|
[Parameter] public InfisicalSecretType Type { get; set; } = InfisicalSecretType.Shared;
|
||||||
@@ -39,9 +39,6 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
string resolvedEnvironment = ResolveEnvironment(connection, Environment);
|
|
||||||
string resolvedSecretPath = ResolveSecretPath(connection, SecretPath);
|
|
||||||
string resolvedApiVersion = ResolveApiVersion(connection, ApiVersion);
|
string resolvedApiVersion = ResolveApiVersion(connection, ApiVersion);
|
||||||
|
|
||||||
if (string.Equals(ParameterSetName, "Bulk", StringComparison.Ordinal))
|
if (string.Equals(ParameterSetName, "Bulk", StringComparison.Ordinal))
|
||||||
@@ -52,9 +49,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
|
|
||||||
InfisicalBulkUpdateSecretsRequest bulk = new InfisicalBulkUpdateSecretsRequest
|
InfisicalBulkUpdateSecretsRequest bulk = new InfisicalBulkUpdateSecretsRequest
|
||||||
{
|
{
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = Environment,
|
||||||
SecretPath = resolvedSecretPath,
|
SecretPath = SecretPath,
|
||||||
ApiVersion = resolvedApiVersion,
|
ApiVersion = resolvedApiVersion,
|
||||||
Secrets = InfisicalBulkSecretConverter.ToUpdateItems(Secrets)
|
Secrets = InfisicalBulkSecretConverter.ToUpdateItems(Secrets)
|
||||||
};
|
};
|
||||||
@@ -81,9 +78,9 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
NewSecretName = NewSecretName,
|
NewSecretName = NewSecretName,
|
||||||
SecretValue = plainValue,
|
SecretValue = plainValue,
|
||||||
SecretComment = SecretComment,
|
SecretComment = SecretComment,
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = Environment,
|
||||||
SecretPath = resolvedSecretPath,
|
SecretPath = SecretPath,
|
||||||
Type = Type.ToString(),
|
Type = Type.ToString(),
|
||||||
ApiVersion = resolvedApiVersion,
|
ApiVersion = resolvedApiVersion,
|
||||||
SkipMultilineEncoding = SkipMultilineEncoding.IsPresent ? (bool?)true : null,
|
SkipMultilineEncoding = SkipMultilineEncoding.IsPresent ? (bool?)true : null,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
[Parameter] public string Slug { get; set; }
|
[Parameter] public string Slug { get; set; }
|
||||||
[Parameter] public string Name { get; set; }
|
[Parameter] public string Name { get; set; }
|
||||||
[Parameter] public string Color { get; set; }
|
[Parameter] public string Color { get; set; }
|
||||||
[Parameter] public string ProjectId { get; set; }
|
[Parameter(Mandatory = true)] public string ProjectId { get; set; }
|
||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
{
|
{
|
||||||
@@ -29,9 +29,8 @@ namespace PSInfisicalAPI.Cmdlets
|
|||||||
}
|
}
|
||||||
|
|
||||||
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
InfisicalConnection connection = InfisicalSessionManager.RequireCurrent();
|
||||||
string resolvedProjectId = ResolveProjectId(connection, ProjectId);
|
|
||||||
InfisicalTagClient client = new InfisicalTagClient(HttpClient, Logger);
|
InfisicalTagClient client = new InfisicalTagClient(HttpClient, Logger);
|
||||||
InfisicalTag tag = client.Update(connection, resolvedProjectId, TagId, Slug, Name, Color);
|
InfisicalTag tag = client.Update(connection, ProjectId, TagId, Slug, Name, Color);
|
||||||
if (tag != null)
|
if (tag != null)
|
||||||
{
|
{
|
||||||
WriteObject(tag);
|
WriteObject(tag);
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ namespace PSInfisicalAPI.Connections
|
|||||||
public string PinnedApiVersion { get; set; }
|
public string PinnedApiVersion { get; set; }
|
||||||
public InfisicalAuthType AuthType { get; set; }
|
public InfisicalAuthType AuthType { get; set; }
|
||||||
public string OrganizationId { get; set; }
|
public string OrganizationId { get; set; }
|
||||||
public string ProjectId { get; set; }
|
|
||||||
public string Environment { get; set; }
|
|
||||||
public string DefaultSecretPath { get; set; }
|
|
||||||
public DateTimeOffset ConnectedAtUtc { get; set; }
|
public DateTimeOffset ConnectedAtUtc { get; set; }
|
||||||
public DateTimeOffset? ExpiresAtUtc { get; set; }
|
public DateTimeOffset? ExpiresAtUtc { get; set; }
|
||||||
public bool IsConnected { get; set; }
|
public bool IsConnected { get; set; }
|
||||||
@@ -26,8 +23,8 @@ namespace PSInfisicalAPI.Connections
|
|||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return string.Concat(
|
return string.Concat(
|
||||||
"Project=", ProjectId ?? "",
|
"BaseUri=", BaseUri != null ? BaseUri.ToString() : "",
|
||||||
" Environment=", Environment ?? "",
|
" AuthType=", AuthType.ToString(),
|
||||||
" Connected=", IsConnected ? "true" : "false");
|
" Connected=", IsConnected ? "true" : "false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,10 +29,9 @@ namespace PSInfisicalAPI.Environments
|
|||||||
public InfisicalEnvironment[] List(InfisicalConnection connection, string projectId)
|
public InfisicalEnvironment[] List(InfisicalConnection connection, string projectId)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId } };
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -43,7 +42,7 @@ namespace PSInfisicalAPI.Environments
|
|||||||
|
|
||||||
InfisicalEnvironmentWorkspaceDto workspace = dto != null ? (dto.Workspace ?? dto.Project) : null;
|
InfisicalEnvironmentWorkspaceDto workspace = dto != null ? (dto.Workspace ?? dto.Project) : null;
|
||||||
List<InfisicalEnvironmentResponseDto> envs = workspace != null ? workspace.Environments : null;
|
List<InfisicalEnvironmentResponseDto> envs = workspace != null ? workspace.Environments : null;
|
||||||
InfisicalEnvironment[] mapped = InfisicalEnvironmentMapper.MapMany(envs, resolvedProjectId);
|
InfisicalEnvironment[] mapped = InfisicalEnvironmentMapper.MapMany(envs, projectId);
|
||||||
_logger.Information(Component, "Infisical environment list retrieval was successful.");
|
_logger.Information(Component, "Infisical environment list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -57,11 +56,10 @@ namespace PSInfisicalAPI.Environments
|
|||||||
public InfisicalEnvironment Retrieve(InfisicalConnection connection, string projectId, string environmentSlugOrId)
|
public InfisicalEnvironment Retrieve(InfisicalConnection connection, string projectId, string environmentSlugOrId)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(environmentSlugOrId)) { throw new InfisicalConfigurationException("Environment is required."); }
|
if (string.IsNullOrEmpty(environmentSlugOrId)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
|
|
||||||
InfisicalEnvironment[] all = List(connection, resolvedProjectId);
|
InfisicalEnvironment[] all = List(connection, projectId);
|
||||||
foreach (InfisicalEnvironment env in all)
|
foreach (InfisicalEnvironment env in all)
|
||||||
{
|
{
|
||||||
if (string.Equals(env.Id, environmentSlugOrId, StringComparison.OrdinalIgnoreCase) ||
|
if (string.Equals(env.Id, environmentSlugOrId, StringComparison.OrdinalIgnoreCase) ||
|
||||||
@@ -77,12 +75,11 @@ namespace PSInfisicalAPI.Environments
|
|||||||
public InfisicalEnvironment Create(InfisicalConnection connection, string projectId, string name, string slug, int? position)
|
public InfisicalEnvironment Create(InfisicalConnection connection, string projectId, string name, string slug, int? position)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(name)) { throw new InfisicalConfigurationException("Name is required."); }
|
if (string.IsNullOrEmpty(name)) { throw new InfisicalConfigurationException("Name is required."); }
|
||||||
if (string.IsNullOrEmpty(slug)) { throw new InfisicalConfigurationException("Slug is required."); }
|
if (string.IsNullOrEmpty(slug)) { throw new InfisicalConfigurationException("Slug is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId } };
|
||||||
InfisicalEnvironmentCreateRequestDto request = new InfisicalEnvironmentCreateRequestDto { Name = name, Slug = slug, Position = position };
|
InfisicalEnvironmentCreateRequestDto request = new InfisicalEnvironmentCreateRequestDto { Name = name, Slug = slug, Position = position };
|
||||||
string body = _serializer.Serialize(request);
|
string body = _serializer.Serialize(request);
|
||||||
|
|
||||||
@@ -93,7 +90,7 @@ namespace PSInfisicalAPI.Environments
|
|||||||
InfisicalEnvironmentSingleResponseDto dto = _serializer.Deserialize<InfisicalEnvironmentSingleResponseDto>(response.Body);
|
InfisicalEnvironmentSingleResponseDto dto = _serializer.Deserialize<InfisicalEnvironmentSingleResponseDto>(response.Body);
|
||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalEnvironment mapped = InfisicalEnvironmentMapper.Map(dto != null ? dto.Environment : null, resolvedProjectId);
|
InfisicalEnvironment mapped = InfisicalEnvironmentMapper.Map(dto != null ? dto.Environment : null, projectId);
|
||||||
_logger.Information(Component, "Infisical environment creation was successful.");
|
_logger.Information(Component, "Infisical environment creation was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -107,11 +104,10 @@ namespace PSInfisicalAPI.Environments
|
|||||||
public InfisicalEnvironment Update(InfisicalConnection connection, string projectId, string environmentId, string name, string slug, int? position)
|
public InfisicalEnvironment Update(InfisicalConnection connection, string projectId, string environmentId, string name, string slug, int? position)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(environmentId)) { throw new InfisicalConfigurationException("EnvironmentId is required."); }
|
if (string.IsNullOrEmpty(environmentId)) { throw new InfisicalConfigurationException("EnvironmentId is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId }, { "environmentId", environmentId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId }, { "environmentId", environmentId } };
|
||||||
InfisicalEnvironmentUpdateRequestDto request = new InfisicalEnvironmentUpdateRequestDto { Name = name, Slug = slug, Position = position };
|
InfisicalEnvironmentUpdateRequestDto request = new InfisicalEnvironmentUpdateRequestDto { Name = name, Slug = slug, Position = position };
|
||||||
string body = _serializer.Serialize(request);
|
string body = _serializer.Serialize(request);
|
||||||
|
|
||||||
@@ -122,7 +118,7 @@ namespace PSInfisicalAPI.Environments
|
|||||||
InfisicalEnvironmentSingleResponseDto dto = _serializer.Deserialize<InfisicalEnvironmentSingleResponseDto>(response.Body);
|
InfisicalEnvironmentSingleResponseDto dto = _serializer.Deserialize<InfisicalEnvironmentSingleResponseDto>(response.Body);
|
||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalEnvironment mapped = InfisicalEnvironmentMapper.Map(dto != null ? dto.Environment : null, resolvedProjectId);
|
InfisicalEnvironment mapped = InfisicalEnvironmentMapper.Map(dto != null ? dto.Environment : null, projectId);
|
||||||
_logger.Information(Component, "Infisical environment update was successful.");
|
_logger.Information(Component, "Infisical environment update was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -136,11 +132,10 @@ namespace PSInfisicalAPI.Environments
|
|||||||
public void Delete(InfisicalConnection connection, string projectId, string environmentId)
|
public void Delete(InfisicalConnection connection, string projectId, string environmentId)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(environmentId)) { throw new InfisicalConfigurationException("EnvironmentId is required."); }
|
if (string.IsNullOrEmpty(environmentId)) { throw new InfisicalConfigurationException("EnvironmentId is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId }, { "environmentId", environmentId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId }, { "environmentId", environmentId } };
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -156,11 +151,5 @@ namespace PSInfisicalAPI.Environments
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string FirstNonEmpty(params string[] values)
|
|
||||||
{
|
|
||||||
if (values == null) { return null; }
|
|
||||||
foreach (string value in values) { if (!string.IsNullOrEmpty(value)) { return value; } }
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,16 +29,14 @@ namespace PSInfisicalAPI.Folders
|
|||||||
public InfisicalFolder[] List(InfisicalConnection connection, string projectId, string environment, string path)
|
public InfisicalFolder[] List(InfisicalConnection connection, string projectId, string environment, string path)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(environment, connection.Environment);
|
if (string.IsNullOrEmpty(environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
string resolvedPath = FirstNonEmpty(path, connection.DefaultSecretPath, "/");
|
string resolvedPath = FirstNonEmpty(path, "/");
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
|
|
||||||
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>
|
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>
|
||||||
{
|
{
|
||||||
new KeyValuePair<string, string>("workspaceId", resolvedProjectId),
|
new KeyValuePair<string, string>("workspaceId", projectId),
|
||||||
new KeyValuePair<string, string>("environment", resolvedEnvironment),
|
new KeyValuePair<string, string>("environment", environment),
|
||||||
new KeyValuePair<string, string>("path", resolvedPath)
|
new KeyValuePair<string, string>("path", resolvedPath)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -49,7 +47,7 @@ namespace PSInfisicalAPI.Folders
|
|||||||
InfisicalFolderListResponseDto dto = _serializer.Deserialize<InfisicalFolderListResponseDto>(response.Body);
|
InfisicalFolderListResponseDto dto = _serializer.Deserialize<InfisicalFolderListResponseDto>(response.Body);
|
||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalFolder[] mapped = InfisicalFolderMapper.MapMany(dto != null ? dto.Folders : null, resolvedProjectId, resolvedEnvironment);
|
InfisicalFolder[] mapped = InfisicalFolderMapper.MapMany(dto != null ? dto.Folders : null, projectId, environment);
|
||||||
_logger.Information(Component, "Infisical folder list retrieval was successful.");
|
_logger.Information(Component, "Infisical folder list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -80,17 +78,15 @@ namespace PSInfisicalAPI.Folders
|
|||||||
public InfisicalFolder Create(InfisicalConnection connection, string projectId, string environment, string name, string path)
|
public InfisicalFolder Create(InfisicalConnection connection, string projectId, string environment, string name, string path)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(environment, connection.Environment);
|
if (string.IsNullOrEmpty(environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
string resolvedPath = FirstNonEmpty(path, connection.DefaultSecretPath, "/");
|
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
if (string.IsNullOrEmpty(name)) { throw new InfisicalConfigurationException("Name is required."); }
|
if (string.IsNullOrEmpty(name)) { throw new InfisicalConfigurationException("Name is required."); }
|
||||||
|
string resolvedPath = FirstNonEmpty(path, "/");
|
||||||
|
|
||||||
InfisicalFolderCreateRequestDto request = new InfisicalFolderCreateRequestDto
|
InfisicalFolderCreateRequestDto request = new InfisicalFolderCreateRequestDto
|
||||||
{
|
{
|
||||||
WorkspaceId = resolvedProjectId,
|
WorkspaceId = projectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = environment,
|
||||||
Name = name,
|
Name = name,
|
||||||
Path = resolvedPath
|
Path = resolvedPath
|
||||||
};
|
};
|
||||||
@@ -103,7 +99,7 @@ namespace PSInfisicalAPI.Folders
|
|||||||
InfisicalFolderSingleResponseDto dto = _serializer.Deserialize<InfisicalFolderSingleResponseDto>(response.Body);
|
InfisicalFolderSingleResponseDto dto = _serializer.Deserialize<InfisicalFolderSingleResponseDto>(response.Body);
|
||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalFolder mapped = InfisicalFolderMapper.Map(dto != null ? dto.Folder : null, resolvedProjectId, resolvedEnvironment);
|
InfisicalFolder mapped = InfisicalFolderMapper.Map(dto != null ? dto.Folder : null, projectId, environment);
|
||||||
_logger.Information(Component, "Infisical folder creation was successful.");
|
_logger.Information(Component, "Infisical folder creation was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -117,19 +113,17 @@ namespace PSInfisicalAPI.Folders
|
|||||||
public InfisicalFolder Update(InfisicalConnection connection, string projectId, string environment, string folderId, string name, string path)
|
public InfisicalFolder Update(InfisicalConnection connection, string projectId, string environment, string folderId, string name, string path)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(environment, connection.Environment);
|
if (string.IsNullOrEmpty(environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
string resolvedPath = FirstNonEmpty(path, connection.DefaultSecretPath, "/");
|
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
if (string.IsNullOrEmpty(folderId)) { throw new InfisicalConfigurationException("FolderId is required."); }
|
if (string.IsNullOrEmpty(folderId)) { throw new InfisicalConfigurationException("FolderId is required."); }
|
||||||
|
string resolvedPath = FirstNonEmpty(path, "/");
|
||||||
if (string.IsNullOrEmpty(name)) { throw new InfisicalConfigurationException("Name is required."); }
|
if (string.IsNullOrEmpty(name)) { throw new InfisicalConfigurationException("Name is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "folderId", folderId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "folderId", folderId } };
|
||||||
InfisicalFolderUpdateRequestDto request = new InfisicalFolderUpdateRequestDto
|
InfisicalFolderUpdateRequestDto request = new InfisicalFolderUpdateRequestDto
|
||||||
{
|
{
|
||||||
WorkspaceId = resolvedProjectId,
|
WorkspaceId = projectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = environment,
|
||||||
Name = name,
|
Name = name,
|
||||||
Path = resolvedPath
|
Path = resolvedPath
|
||||||
};
|
};
|
||||||
@@ -142,7 +136,7 @@ namespace PSInfisicalAPI.Folders
|
|||||||
InfisicalFolderSingleResponseDto dto = _serializer.Deserialize<InfisicalFolderSingleResponseDto>(response.Body);
|
InfisicalFolderSingleResponseDto dto = _serializer.Deserialize<InfisicalFolderSingleResponseDto>(response.Body);
|
||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalFolder mapped = InfisicalFolderMapper.Map(dto != null ? dto.Folder : null, resolvedProjectId, resolvedEnvironment);
|
InfisicalFolder mapped = InfisicalFolderMapper.Map(dto != null ? dto.Folder : null, projectId, environment);
|
||||||
_logger.Information(Component, "Infisical folder update was successful.");
|
_logger.Information(Component, "Infisical folder update was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -156,18 +150,16 @@ namespace PSInfisicalAPI.Folders
|
|||||||
public void Delete(InfisicalConnection connection, string projectId, string environment, string folderId, string path)
|
public void Delete(InfisicalConnection connection, string projectId, string environment, string folderId, string path)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(environment, connection.Environment);
|
if (string.IsNullOrEmpty(environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
string resolvedPath = FirstNonEmpty(path, connection.DefaultSecretPath, "/");
|
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
if (string.IsNullOrEmpty(folderId)) { throw new InfisicalConfigurationException("FolderId is required."); }
|
if (string.IsNullOrEmpty(folderId)) { throw new InfisicalConfigurationException("FolderId is required."); }
|
||||||
|
string resolvedPath = FirstNonEmpty(path, "/");
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "folderId", folderId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "folderId", folderId } };
|
||||||
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>
|
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>
|
||||||
{
|
{
|
||||||
new KeyValuePair<string, string>("workspaceId", resolvedProjectId),
|
new KeyValuePair<string, string>("workspaceId", projectId),
|
||||||
new KeyValuePair<string, string>("environment", resolvedEnvironment),
|
new KeyValuePair<string, string>("environment", environment),
|
||||||
new KeyValuePair<string, string>("path", resolvedPath)
|
new KeyValuePair<string, string>("path", resolvedPath)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
List<InfisicalInternalCaResponseDto> source = ParseCaListBody(body);
|
List<InfisicalInternalCaResponseDto> source = ParseCaListBody(body);
|
||||||
string fallbackProjectId = !string.IsNullOrEmpty(projectId) ? projectId : connection.ProjectId;
|
InfisicalCertificateAuthority[] mapped = InfisicalCaMapper.MapMany(source, projectId);
|
||||||
InfisicalCertificateAuthority[] mapped = InfisicalCaMapper.MapMany(source, fallbackProjectId);
|
|
||||||
_logger.Information(Component, "Infisical internal certificate authority list retrieval was successful.");
|
_logger.Information(Component, "Infisical internal certificate authority list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -79,8 +78,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalInternalCaResponseDto inner = ParseCaSingleBody(body);
|
InfisicalInternalCaResponseDto inner = ParseCaSingleBody(body);
|
||||||
string fallbackProjectId = !string.IsNullOrEmpty(projectId) ? projectId : connection.ProjectId;
|
InfisicalCertificateAuthority mapped = InfisicalCaMapper.Map(inner, projectId);
|
||||||
InfisicalCertificateAuthority mapped = InfisicalCaMapper.Map(inner, fallbackProjectId);
|
|
||||||
_logger.Information(Component, "Infisical internal certificate authority retrieval was successful.");
|
_logger.Information(Component, "Infisical internal certificate authority retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -94,12 +92,11 @@ namespace PSInfisicalAPI.Pki
|
|||||||
public InfisicalCertificateAuthority[] ListAllCertificateAuthorities(InfisicalConnection connection, string projectId)
|
public InfisicalCertificateAuthority[] ListAllCertificateAuthorities(InfisicalConnection connection, string projectId)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>
|
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>
|
||||||
{
|
{
|
||||||
new KeyValuePair<string, string>("projectId", resolvedProjectId)
|
new KeyValuePair<string, string>("projectId", projectId)
|
||||||
};
|
};
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -110,7 +107,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
List<InfisicalInternalCaResponseDto> source = ParseCaListBody(body);
|
List<InfisicalInternalCaResponseDto> source = ParseCaListBody(body);
|
||||||
InfisicalCertificateAuthority[] mapped = InfisicalCaMapper.MapMany(source, resolvedProjectId);
|
InfisicalCertificateAuthority[] mapped = InfisicalCaMapper.MapMany(source, projectId);
|
||||||
_logger.Information(Component, "Infisical certificate authority list retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate authority list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -136,7 +133,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalCertificateResponseDto inner = ParseCertificateSingleBody(body);
|
InfisicalCertificateResponseDto inner = ParseCertificateSingleBody(body);
|
||||||
InfisicalCertificate mapped = InfisicalCertificateMapper.Map(inner, connection.ProjectId);
|
InfisicalCertificate mapped = InfisicalCertificateMapper.Map(inner, null);
|
||||||
_logger.Information(Component, "Infisical certificate retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -187,10 +184,9 @@ namespace PSInfisicalAPI.Pki
|
|||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
if (query == null) { throw new ArgumentNullException(nameof(query)); }
|
if (query == null) { throw new ArgumentNullException(nameof(query)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(query.ProjectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(query.ProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", query.ProjectId } };
|
||||||
InfisicalCertificateSearchRequestDto request = BuildSearchRequest(query);
|
InfisicalCertificateSearchRequestDto request = BuildSearchRequest(query);
|
||||||
string body = _serializer.Serialize(request);
|
string body = _serializer.Serialize(request);
|
||||||
|
|
||||||
@@ -201,7 +197,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
InfisicalCertificateSearchResponseDto dto = _serializer.Deserialize<InfisicalCertificateSearchResponseDto>(response.Body);
|
InfisicalCertificateSearchResponseDto dto = _serializer.Deserialize<InfisicalCertificateSearchResponseDto>(response.Body);
|
||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalCertificate[] mapped = InfisicalCertificateMapper.MapMany(dto != null ? dto.Certificates : null, resolvedProjectId);
|
InfisicalCertificate[] mapped = InfisicalCertificateMapper.MapMany(dto != null ? dto.Certificates : null, query.ProjectId);
|
||||||
int total = dto != null ? dto.TotalCount : mapped.Length;
|
int total = dto != null ? dto.TotalCount : mapped.Length;
|
||||||
_logger.Information(Component, "Infisical certificate search was successful.");
|
_logger.Information(Component, "Infisical certificate search was successful.");
|
||||||
return new InfisicalCertificateSearchResult { Certificates = mapped, TotalCount = total };
|
return new InfisicalCertificateSearchResult { Certificates = mapped, TotalCount = total };
|
||||||
@@ -218,13 +214,12 @@ namespace PSInfisicalAPI.Pki
|
|||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
if (string.IsNullOrEmpty(subscriberName)) { throw new InfisicalConfigurationException("SubscriberName is required."); }
|
if (string.IsNullOrEmpty(subscriberName)) { throw new InfisicalConfigurationException("SubscriberName is required."); }
|
||||||
if (string.IsNullOrEmpty(csrPem)) { throw new InfisicalConfigurationException("CSR is required."); }
|
if (string.IsNullOrEmpty(csrPem)) { throw new InfisicalConfigurationException("CSR is required."); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "subscriberName", subscriberName } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "subscriberName", subscriberName } };
|
||||||
InfisicalSignCertificateBySubscriberRequestDto request = new InfisicalSignCertificateBySubscriberRequestDto
|
InfisicalSignCertificateBySubscriberRequestDto request = new InfisicalSignCertificateBySubscriberRequestDto
|
||||||
{
|
{
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = projectId,
|
||||||
Csr = csrPem
|
Csr = csrPem
|
||||||
};
|
};
|
||||||
string body = _serializer.Serialize(request);
|
string body = _serializer.Serialize(request);
|
||||||
@@ -373,10 +368,9 @@ namespace PSInfisicalAPI.Pki
|
|||||||
public InfisicalPkiSubscriber[] ListPkiSubscribers(InfisicalConnection connection, string projectId)
|
public InfisicalPkiSubscriber[] ListPkiSubscribers(InfisicalConnection connection, string projectId)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId } };
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -386,7 +380,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
List<InfisicalPkiSubscriberResponseDto> source = ParsePkiSubscriberListBody(body);
|
List<InfisicalPkiSubscriberResponseDto> source = ParsePkiSubscriberListBody(body);
|
||||||
InfisicalPkiSubscriber[] mapped = InfisicalPkiSubscriberMapper.MapMany(source, resolvedProjectId);
|
InfisicalPkiSubscriber[] mapped = InfisicalPkiSubscriberMapper.MapMany(source, projectId);
|
||||||
_logger.Information(Component, "Infisical PKI subscriber list retrieval was successful.");
|
_logger.Information(Component, "Infisical PKI subscriber list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -401,11 +395,10 @@ namespace PSInfisicalAPI.Pki
|
|||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
if (string.IsNullOrEmpty(subscriberName)) { throw new InfisicalConfigurationException("SubscriberName is required."); }
|
if (string.IsNullOrEmpty(subscriberName)) { throw new InfisicalConfigurationException("SubscriberName is required."); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "subscriberName", subscriberName } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "subscriberName", subscriberName } };
|
||||||
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("projectId", resolvedProjectId) };
|
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("projectId", projectId) };
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -414,7 +407,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
InfisicalPkiSubscriberResponseDto dto = _serializer.Deserialize<InfisicalPkiSubscriberResponseDto>(response.Body);
|
InfisicalPkiSubscriberResponseDto dto = _serializer.Deserialize<InfisicalPkiSubscriberResponseDto>(response.Body);
|
||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalPkiSubscriber mapped = InfisicalPkiSubscriberMapper.Map(dto, resolvedProjectId);
|
InfisicalPkiSubscriber mapped = InfisicalPkiSubscriberMapper.Map(dto, projectId);
|
||||||
_logger.Information(Component, "Infisical PKI subscriber retrieval was successful.");
|
_logger.Information(Component, "Infisical PKI subscriber retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -441,12 +434,11 @@ namespace PSInfisicalAPI.Pki
|
|||||||
public InfisicalCertificateProfile[] ListCertificateProfiles(InfisicalConnection connection, string projectId, int? limit, int? offset, bool? includeConfigs)
|
public InfisicalCertificateProfile[] ListCertificateProfiles(InfisicalConnection connection, string projectId, int? limit, int? offset, bool? includeConfigs)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>
|
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>
|
||||||
{
|
{
|
||||||
new KeyValuePair<string, string>("projectId", resolvedProjectId)
|
new KeyValuePair<string, string>("projectId", projectId)
|
||||||
};
|
};
|
||||||
if (limit.HasValue) { query.Add(new KeyValuePair<string, string>("limit", limit.Value.ToString(CultureInfo.InvariantCulture))); }
|
if (limit.HasValue) { query.Add(new KeyValuePair<string, string>("limit", limit.Value.ToString(CultureInfo.InvariantCulture))); }
|
||||||
if (offset.HasValue) { query.Add(new KeyValuePair<string, string>("offset", offset.Value.ToString(CultureInfo.InvariantCulture))); }
|
if (offset.HasValue) { query.Add(new KeyValuePair<string, string>("offset", offset.Value.ToString(CultureInfo.InvariantCulture))); }
|
||||||
@@ -460,7 +452,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
List<InfisicalCertificateProfileResponseDto> source = ParseCertificateProfileListBody(body);
|
List<InfisicalCertificateProfileResponseDto> source = ParseCertificateProfileListBody(body);
|
||||||
InfisicalCertificateProfile[] mapped = InfisicalCertificateProfileMapper.MapMany(source, resolvedProjectId);
|
InfisicalCertificateProfile[] mapped = InfisicalCertificateProfileMapper.MapMany(source, projectId);
|
||||||
_logger.Information(Component, "Infisical certificate profile list retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate profile list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -491,8 +483,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalCertificateProfileResponseDto inner = ParseCertificateProfileSingleBody(body);
|
InfisicalCertificateProfileResponseDto inner = ParseCertificateProfileSingleBody(body);
|
||||||
string fallbackProjectId = !string.IsNullOrEmpty(projectId) ? projectId : connection.ProjectId;
|
InfisicalCertificateProfile mapped = InfisicalCertificateProfileMapper.Map(inner, projectId);
|
||||||
InfisicalCertificateProfile mapped = InfisicalCertificateProfileMapper.Map(inner, fallbackProjectId);
|
|
||||||
_logger.Information(Component, "Infisical certificate profile retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate profile retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -530,12 +521,11 @@ namespace PSInfisicalAPI.Pki
|
|||||||
public InfisicalCertificatePolicy[] ListCertificatePolicies(InfisicalConnection connection, string projectId, int? limit, int? offset)
|
public InfisicalCertificatePolicy[] ListCertificatePolicies(InfisicalConnection connection, string projectId, int? limit, int? offset)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>
|
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>
|
||||||
{
|
{
|
||||||
new KeyValuePair<string, string>("projectId", resolvedProjectId)
|
new KeyValuePair<string, string>("projectId", projectId)
|
||||||
};
|
};
|
||||||
if (limit.HasValue) { query.Add(new KeyValuePair<string, string>("limit", limit.Value.ToString(CultureInfo.InvariantCulture))); }
|
if (limit.HasValue) { query.Add(new KeyValuePair<string, string>("limit", limit.Value.ToString(CultureInfo.InvariantCulture))); }
|
||||||
if (offset.HasValue) { query.Add(new KeyValuePair<string, string>("offset", offset.Value.ToString(CultureInfo.InvariantCulture))); }
|
if (offset.HasValue) { query.Add(new KeyValuePair<string, string>("offset", offset.Value.ToString(CultureInfo.InvariantCulture))); }
|
||||||
@@ -548,7 +538,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
List<InfisicalCertificatePolicyResponseDto> source = ParseCertificatePolicyListBody(body);
|
List<InfisicalCertificatePolicyResponseDto> source = ParseCertificatePolicyListBody(body);
|
||||||
InfisicalCertificatePolicy[] mapped = InfisicalCertificatePolicyMapper.MapMany(source, resolvedProjectId);
|
InfisicalCertificatePolicy[] mapped = InfisicalCertificatePolicyMapper.MapMany(source, projectId);
|
||||||
_logger.Information(Component, "Infisical certificate policy list retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate policy list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -579,8 +569,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalCertificatePolicyResponseDto inner = ParseCertificatePolicySingleBody(body);
|
InfisicalCertificatePolicyResponseDto inner = ParseCertificatePolicySingleBody(body);
|
||||||
string fallbackProjectId = !string.IsNullOrEmpty(projectId) ? projectId : connection.ProjectId;
|
InfisicalCertificatePolicy mapped = InfisicalCertificatePolicyMapper.Map(inner, projectId);
|
||||||
InfisicalCertificatePolicy mapped = InfisicalCertificatePolicyMapper.Map(inner, fallbackProjectId);
|
|
||||||
_logger.Information(Component, "Infisical certificate policy retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate policy retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -643,14 +632,13 @@ namespace PSInfisicalAPI.Pki
|
|||||||
public InfisicalCertificateApplication[] ListCertificateApplications(InfisicalConnection connection, string projectId, int? limit, int? offset)
|
public InfisicalCertificateApplication[] ListCertificateApplications(InfisicalConnection connection, string projectId, int? limit, int? offset)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>();
|
List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>();
|
||||||
if (limit.HasValue) { query.Add(new KeyValuePair<string, string>("limit", limit.Value.ToString(CultureInfo.InvariantCulture))); }
|
if (limit.HasValue) { query.Add(new KeyValuePair<string, string>("limit", limit.Value.ToString(CultureInfo.InvariantCulture))); }
|
||||||
if (offset.HasValue) { query.Add(new KeyValuePair<string, string>("offset", offset.Value.ToString(CultureInfo.InvariantCulture))); }
|
if (offset.HasValue) { query.Add(new KeyValuePair<string, string>("offset", offset.Value.ToString(CultureInfo.InvariantCulture))); }
|
||||||
|
|
||||||
Dictionary<string, string> headers = BuildProjectHeader(resolvedProjectId);
|
Dictionary<string, string> headers = BuildProjectHeader(projectId);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -660,7 +648,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
List<InfisicalCertificateApplicationResponseDto> source = ParseApplicationListBody(body);
|
List<InfisicalCertificateApplicationResponseDto> source = ParseApplicationListBody(body);
|
||||||
InfisicalCertificateApplication[] mapped = InfisicalCertificateApplicationMapper.MapMany(source, resolvedProjectId);
|
InfisicalCertificateApplication[] mapped = InfisicalCertificateApplicationMapper.MapMany(source, projectId);
|
||||||
_logger.Information(Component, "Infisical certificate application list retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate application list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -677,8 +665,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
if (string.IsNullOrEmpty(applicationId)) { throw new InfisicalConfigurationException("ApplicationId is required."); }
|
if (string.IsNullOrEmpty(applicationId)) { throw new InfisicalConfigurationException("ApplicationId is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "applicationId", applicationId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "applicationId", applicationId } };
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
Dictionary<string, string> headers = !string.IsNullOrEmpty(projectId) ? BuildProjectHeader(projectId) : null;
|
||||||
Dictionary<string, string> headers = !string.IsNullOrEmpty(resolvedProjectId) ? BuildProjectHeader(resolvedProjectId) : null;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -688,7 +675,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalCertificateApplicationResponseDto inner = ParseApplicationSingleBody(body);
|
InfisicalCertificateApplicationResponseDto inner = ParseApplicationSingleBody(body);
|
||||||
InfisicalCertificateApplication mapped = InfisicalCertificateApplicationMapper.Map(inner, resolvedProjectId);
|
InfisicalCertificateApplication mapped = InfisicalCertificateApplicationMapper.Map(inner, projectId);
|
||||||
_logger.Information(Component, "Infisical certificate application retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate application retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -703,11 +690,10 @@ namespace PSInfisicalAPI.Pki
|
|||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
if (string.IsNullOrEmpty(name)) { throw new InfisicalConfigurationException("ApplicationName is required."); }
|
if (string.IsNullOrEmpty(name)) { throw new InfisicalConfigurationException("ApplicationName is required."); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "name", name } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "name", name } };
|
||||||
Dictionary<string, string> headers = BuildProjectHeader(resolvedProjectId);
|
Dictionary<string, string> headers = BuildProjectHeader(projectId);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -717,7 +703,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalCertificateApplicationResponseDto inner = ParseApplicationSingleBody(body);
|
InfisicalCertificateApplicationResponseDto inner = ParseApplicationSingleBody(body);
|
||||||
InfisicalCertificateApplication mapped = InfisicalCertificateApplicationMapper.Map(inner, resolvedProjectId);
|
InfisicalCertificateApplication mapped = InfisicalCertificateApplicationMapper.Map(inner, projectId);
|
||||||
_logger.Information(Component, "Infisical certificate application (by name) retrieval was successful.");
|
_logger.Information(Component, "Infisical certificate application (by name) retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -734,8 +720,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
if (string.IsNullOrEmpty(applicationId)) { throw new InfisicalConfigurationException("ApplicationId is required."); }
|
if (string.IsNullOrEmpty(applicationId)) { throw new InfisicalConfigurationException("ApplicationId is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "applicationId", applicationId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "applicationId", applicationId } };
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
Dictionary<string, string> headers = !string.IsNullOrEmpty(projectId) ? BuildProjectHeader(projectId) : null;
|
||||||
Dictionary<string, string> headers = !string.IsNullOrEmpty(resolvedProjectId) ? BuildProjectHeader(resolvedProjectId) : null;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -767,8 +752,7 @@ namespace PSInfisicalAPI.Pki
|
|||||||
{ "applicationId", applicationId },
|
{ "applicationId", applicationId },
|
||||||
{ "profileId", profileId }
|
{ "profileId", profileId }
|
||||||
};
|
};
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
Dictionary<string, string> headers = !string.IsNullOrEmpty(projectId) ? BuildProjectHeader(projectId) : null;
|
||||||
Dictionary<string, string> headers = !string.IsNullOrEmpty(resolvedProjectId) ? BuildProjectHeader(resolvedProjectId) : null;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,13 +27,25 @@ namespace PSInfisicalAPI.Projects
|
|||||||
}
|
}
|
||||||
|
|
||||||
public InfisicalProject[] List(InfisicalConnection connection)
|
public InfisicalProject[] List(InfisicalConnection connection)
|
||||||
|
{
|
||||||
|
return List(connection, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public InfisicalProject[] List(InfisicalConnection connection, string type, bool includeRoles)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
|
|
||||||
|
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
|
||||||
|
queryParameters.Add(new KeyValuePair<string, string>("includeRoles", includeRoles ? "true" : "false"));
|
||||||
|
if (!string.IsNullOrEmpty(type))
|
||||||
|
{
|
||||||
|
queryParameters.Add(new KeyValuePair<string, string>("type", type));
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_logger.Information(Component, "Attempting to list Infisical projects. Please Wait...");
|
_logger.Information(Component, "Attempting to list Infisical projects. Please Wait...");
|
||||||
InfisicalHttpResponse response = _invoker.Invoke(connection, InfisicalEndpointNames.ListProjects, "ListProjects", null, null, null);
|
InfisicalHttpResponse response = _invoker.Invoke(connection, InfisicalEndpointNames.ListProjects, "ListProjects", null, queryParameters, null);
|
||||||
InfisicalProjectListResponseDto dto = _serializer.Deserialize<InfisicalProjectListResponseDto>(response.Body);
|
InfisicalProjectListResponseDto dto = _serializer.Deserialize<InfisicalProjectListResponseDto>(response.Body);
|
||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
|
|||||||
@@ -32,13 +32,11 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
if (query == null) { throw new ArgumentNullException(nameof(query)); }
|
if (query == null) { throw new ArgumentNullException(nameof(query)); }
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(query.ProjectId, connection.ProjectId);
|
|
||||||
|
|
||||||
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
|
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
|
||||||
AddIfNotNull(queryParameters, "workspaceId", resolvedProjectId);
|
AddIfNotNull(queryParameters, "workspaceId", query.ProjectId);
|
||||||
AddIfNotNull(queryParameters, "projectId", resolvedProjectId);
|
AddIfNotNull(queryParameters, "projectId", query.ProjectId);
|
||||||
AddIfNotNull(queryParameters, "environment", FirstNonEmpty(query.Environment, connection.Environment));
|
AddIfNotNull(queryParameters, "environment", query.Environment);
|
||||||
AddIfNotNull(queryParameters, "secretPath", FirstNonEmpty(query.SecretPath, connection.DefaultSecretPath, "/"));
|
AddIfNotNull(queryParameters, "secretPath", FirstNonEmpty(query.SecretPath, "/"));
|
||||||
queryParameters.Add(new KeyValuePair<string, string>("recursive", query.Recursive ? "true" : "false"));
|
queryParameters.Add(new KeyValuePair<string, string>("recursive", query.Recursive ? "true" : "false"));
|
||||||
if (query.IncludeImports.HasValue) { queryParameters.Add(new KeyValuePair<string, string>("includeImports", query.IncludeImports.Value ? "true" : "false")); }
|
if (query.IncludeImports.HasValue) { queryParameters.Add(new KeyValuePair<string, string>("includeImports", query.IncludeImports.Value ? "true" : "false")); }
|
||||||
if (query.IncludePersonalOverrides) { queryParameters.Add(new KeyValuePair<string, string>("includePersonalOverrides", "true")); }
|
if (query.IncludePersonalOverrides) { queryParameters.Add(new KeyValuePair<string, string>("includePersonalOverrides", "true")); }
|
||||||
@@ -96,13 +94,11 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "secretName", query.SecretName } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "secretName", query.SecretName } };
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(query.ProjectId, connection.ProjectId);
|
|
||||||
|
|
||||||
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
|
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
|
||||||
AddIfNotNull(queryParameters, "workspaceId", resolvedProjectId);
|
AddIfNotNull(queryParameters, "workspaceId", query.ProjectId);
|
||||||
AddIfNotNull(queryParameters, "projectId", resolvedProjectId);
|
AddIfNotNull(queryParameters, "projectId", query.ProjectId);
|
||||||
AddIfNotNull(queryParameters, "environment", FirstNonEmpty(query.Environment, connection.Environment));
|
AddIfNotNull(queryParameters, "environment", query.Environment);
|
||||||
AddIfNotNull(queryParameters, "secretPath", FirstNonEmpty(query.SecretPath, connection.DefaultSecretPath, "/"));
|
AddIfNotNull(queryParameters, "secretPath", FirstNonEmpty(query.SecretPath, "/"));
|
||||||
AddIfNotNull(queryParameters, "type", string.IsNullOrEmpty(query.Type) ? "shared" : query.Type.ToLowerInvariant());
|
AddIfNotNull(queryParameters, "type", string.IsNullOrEmpty(query.Type) ? "shared" : query.Type.ToLowerInvariant());
|
||||||
if (query.Version.HasValue) { queryParameters.Add(new KeyValuePair<string, string>("version", query.Version.Value.ToString(CultureInfo.InvariantCulture))); }
|
if (query.Version.HasValue) { queryParameters.Add(new KeyValuePair<string, string>("version", query.Version.Value.ToString(CultureInfo.InvariantCulture))); }
|
||||||
if (query.ViewSecretValue.HasValue) { queryParameters.Add(new KeyValuePair<string, string>("viewSecretValue", query.ViewSecretValue.Value ? "true" : "false")); }
|
if (query.ViewSecretValue.HasValue) { queryParameters.Add(new KeyValuePair<string, string>("viewSecretValue", query.ViewSecretValue.Value ? "true" : "false")); }
|
||||||
@@ -143,17 +139,15 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
if (string.IsNullOrEmpty(request.SecretName)) { throw new InfisicalConfigurationException("SecretName is required."); }
|
if (string.IsNullOrEmpty(request.SecretName)) { throw new InfisicalConfigurationException("SecretName is required."); }
|
||||||
if (request.SecretValue == null) { throw new InfisicalConfigurationException("SecretValue is required."); }
|
if (request.SecretValue == null) { throw new InfisicalConfigurationException("SecretValue is required."); }
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(request.ProjectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(request.ProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(request.Environment, connection.Environment);
|
if (string.IsNullOrEmpty(request.Environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "secretName", request.SecretName } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "secretName", request.SecretName } };
|
||||||
InfisicalSecretCreateRequestDto dtoRequest = new InfisicalSecretCreateRequestDto
|
InfisicalSecretCreateRequestDto dtoRequest = new InfisicalSecretCreateRequestDto
|
||||||
{
|
{
|
||||||
WorkspaceId = resolvedProjectId,
|
WorkspaceId = request.ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = request.Environment,
|
||||||
SecretPath = FirstNonEmpty(request.SecretPath, connection.DefaultSecretPath, "/"),
|
SecretPath = FirstNonEmpty(request.SecretPath, "/"),
|
||||||
Type = string.IsNullOrEmpty(request.Type) ? "shared" : request.Type.ToLowerInvariant(),
|
Type = string.IsNullOrEmpty(request.Type) ? "shared" : request.Type.ToLowerInvariant(),
|
||||||
SecretValue = request.SecretValue,
|
SecretValue = request.SecretValue,
|
||||||
SecretComment = request.SecretComment,
|
SecretComment = request.SecretComment,
|
||||||
@@ -186,17 +180,15 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
||||||
if (string.IsNullOrEmpty(request.SecretName)) { throw new InfisicalConfigurationException("SecretName is required."); }
|
if (string.IsNullOrEmpty(request.SecretName)) { throw new InfisicalConfigurationException("SecretName is required."); }
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(request.ProjectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(request.ProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(request.Environment, connection.Environment);
|
if (string.IsNullOrEmpty(request.Environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "secretName", request.SecretName } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "secretName", request.SecretName } };
|
||||||
InfisicalSecretUpdateRequestDto dtoRequest = new InfisicalSecretUpdateRequestDto
|
InfisicalSecretUpdateRequestDto dtoRequest = new InfisicalSecretUpdateRequestDto
|
||||||
{
|
{
|
||||||
WorkspaceId = resolvedProjectId,
|
WorkspaceId = request.ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = request.Environment,
|
||||||
SecretPath = FirstNonEmpty(request.SecretPath, connection.DefaultSecretPath, "/"),
|
SecretPath = FirstNonEmpty(request.SecretPath, "/"),
|
||||||
Type = string.IsNullOrEmpty(request.Type) ? "shared" : request.Type.ToLowerInvariant(),
|
Type = string.IsNullOrEmpty(request.Type) ? "shared" : request.Type.ToLowerInvariant(),
|
||||||
SecretValue = request.SecretValue,
|
SecretValue = request.SecretValue,
|
||||||
SecretComment = request.SecretComment,
|
SecretComment = request.SecretComment,
|
||||||
@@ -230,10 +222,8 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
||||||
if (request.Secrets == null || request.Secrets.Length == 0) { throw new InfisicalConfigurationException("At least one secret is required."); }
|
if (request.Secrets == null || request.Secrets.Length == 0) { throw new InfisicalConfigurationException("At least one secret is required."); }
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(request.ProjectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(request.ProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(request.Environment, connection.Environment);
|
if (string.IsNullOrEmpty(request.Environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
|
|
||||||
List<InfisicalSecretBatchCreateItemDto> items = new List<InfisicalSecretBatchCreateItemDto>(request.Secrets.Length);
|
List<InfisicalSecretBatchCreateItemDto> items = new List<InfisicalSecretBatchCreateItemDto>(request.Secrets.Length);
|
||||||
foreach (InfisicalBulkCreateSecretItem item in request.Secrets)
|
foreach (InfisicalBulkCreateSecretItem item in request.Secrets)
|
||||||
@@ -253,10 +243,10 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
|
|
||||||
InfisicalSecretBatchCreateRequestDto dtoRequest = new InfisicalSecretBatchCreateRequestDto
|
InfisicalSecretBatchCreateRequestDto dtoRequest = new InfisicalSecretBatchCreateRequestDto
|
||||||
{
|
{
|
||||||
WorkspaceId = resolvedProjectId,
|
WorkspaceId = request.ProjectId,
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = request.ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = request.Environment,
|
||||||
SecretPath = FirstNonEmpty(request.SecretPath, connection.DefaultSecretPath, "/"),
|
SecretPath = FirstNonEmpty(request.SecretPath, "/"),
|
||||||
Secrets = items
|
Secrets = items
|
||||||
};
|
};
|
||||||
string body = _serializer.Serialize(dtoRequest);
|
string body = _serializer.Serialize(dtoRequest);
|
||||||
@@ -285,10 +275,8 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
||||||
if (request.Secrets == null || request.Secrets.Length == 0) { throw new InfisicalConfigurationException("At least one secret is required."); }
|
if (request.Secrets == null || request.Secrets.Length == 0) { throw new InfisicalConfigurationException("At least one secret is required."); }
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(request.ProjectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(request.ProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(request.Environment, connection.Environment);
|
if (string.IsNullOrEmpty(request.Environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
|
|
||||||
List<InfisicalSecretBatchUpdateItemDto> items = new List<InfisicalSecretBatchUpdateItemDto>(request.Secrets.Length);
|
List<InfisicalSecretBatchUpdateItemDto> items = new List<InfisicalSecretBatchUpdateItemDto>(request.Secrets.Length);
|
||||||
foreach (InfisicalBulkUpdateSecretItem item in request.Secrets)
|
foreach (InfisicalBulkUpdateSecretItem item in request.Secrets)
|
||||||
@@ -309,10 +297,10 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
|
|
||||||
InfisicalSecretBatchUpdateRequestDto dtoRequest = new InfisicalSecretBatchUpdateRequestDto
|
InfisicalSecretBatchUpdateRequestDto dtoRequest = new InfisicalSecretBatchUpdateRequestDto
|
||||||
{
|
{
|
||||||
WorkspaceId = resolvedProjectId,
|
WorkspaceId = request.ProjectId,
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = request.ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = request.Environment,
|
||||||
SecretPath = FirstNonEmpty(request.SecretPath, connection.DefaultSecretPath, "/"),
|
SecretPath = FirstNonEmpty(request.SecretPath, "/"),
|
||||||
Mode = request.Mode,
|
Mode = request.Mode,
|
||||||
Secrets = items
|
Secrets = items
|
||||||
};
|
};
|
||||||
@@ -342,10 +330,8 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
||||||
if (request.SecretNames == null || request.SecretNames.Length == 0) { throw new InfisicalConfigurationException("At least one secret name is required."); }
|
if (request.SecretNames == null || request.SecretNames.Length == 0) { throw new InfisicalConfigurationException("At least one secret name is required."); }
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(request.ProjectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(request.ProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(request.Environment, connection.Environment);
|
if (string.IsNullOrEmpty(request.Environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
|
|
||||||
List<InfisicalSecretBatchDeleteItemDto> items = new List<InfisicalSecretBatchDeleteItemDto>(request.SecretNames.Length);
|
List<InfisicalSecretBatchDeleteItemDto> items = new List<InfisicalSecretBatchDeleteItemDto>(request.SecretNames.Length);
|
||||||
foreach (string name in request.SecretNames)
|
foreach (string name in request.SecretNames)
|
||||||
@@ -356,10 +342,10 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
|
|
||||||
InfisicalSecretBatchDeleteRequestDto dtoRequest = new InfisicalSecretBatchDeleteRequestDto
|
InfisicalSecretBatchDeleteRequestDto dtoRequest = new InfisicalSecretBatchDeleteRequestDto
|
||||||
{
|
{
|
||||||
WorkspaceId = resolvedProjectId,
|
WorkspaceId = request.ProjectId,
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = request.ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = request.Environment,
|
||||||
SecretPath = FirstNonEmpty(request.SecretPath, connection.DefaultSecretPath, "/"),
|
SecretPath = FirstNonEmpty(request.SecretPath, "/"),
|
||||||
Secrets = items
|
Secrets = items
|
||||||
};
|
};
|
||||||
string body = _serializer.Serialize(dtoRequest);
|
string body = _serializer.Serialize(dtoRequest);
|
||||||
@@ -384,13 +370,11 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
||||||
if (request.SecretIds == null || request.SecretIds.Length == 0) { throw new InfisicalConfigurationException("At least one SecretId is required."); }
|
if (request.SecretIds == null || request.SecretIds.Length == 0) { throw new InfisicalConfigurationException("At least one SecretId is required."); }
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(request.ProjectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(request.ProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedSourceEnv = FirstNonEmpty(request.SourceEnvironment, connection.Environment);
|
if (string.IsNullOrEmpty(request.SourceEnvironment)) { throw new InfisicalConfigurationException("SourceEnvironment is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedSourceEnv)) { throw new InfisicalConfigurationException("SourceEnvironment is required."); }
|
|
||||||
if (string.IsNullOrEmpty(request.DestinationEnvironment)) { throw new InfisicalConfigurationException("DestinationEnvironment is required."); }
|
if (string.IsNullOrEmpty(request.DestinationEnvironment)) { throw new InfisicalConfigurationException("DestinationEnvironment is required."); }
|
||||||
|
|
||||||
string resolvedSourcePath = FirstNonEmpty(request.SourceSecretPath, connection.DefaultSecretPath, "/");
|
string resolvedSourcePath = FirstNonEmpty(request.SourceSecretPath, "/");
|
||||||
string resolvedDestPath = FirstNonEmpty(request.DestinationSecretPath, resolvedSourcePath);
|
string resolvedDestPath = FirstNonEmpty(request.DestinationSecretPath, resolvedSourcePath);
|
||||||
|
|
||||||
InfisicalSecretDuplicateAttributesDto attributes = null;
|
InfisicalSecretDuplicateAttributesDto attributes = null;
|
||||||
@@ -407,8 +391,8 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
|
|
||||||
InfisicalSecretDuplicateRequestDto dtoRequest = new InfisicalSecretDuplicateRequestDto
|
InfisicalSecretDuplicateRequestDto dtoRequest = new InfisicalSecretDuplicateRequestDto
|
||||||
{
|
{
|
||||||
ProjectId = resolvedProjectId,
|
ProjectId = request.ProjectId,
|
||||||
SourceEnvironment = resolvedSourceEnv,
|
SourceEnvironment = request.SourceEnvironment,
|
||||||
DestinationEnvironment = request.DestinationEnvironment,
|
DestinationEnvironment = request.DestinationEnvironment,
|
||||||
SourceSecretPath = resolvedSourcePath,
|
SourceSecretPath = resolvedSourcePath,
|
||||||
DestinationSecretPath = resolvedDestPath,
|
DestinationSecretPath = resolvedDestPath,
|
||||||
@@ -454,17 +438,15 @@ namespace PSInfisicalAPI.Secrets
|
|||||||
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
if (request == null) { throw new ArgumentNullException(nameof(request)); }
|
||||||
if (string.IsNullOrEmpty(request.SecretName)) { throw new InfisicalConfigurationException("SecretName is required."); }
|
if (string.IsNullOrEmpty(request.SecretName)) { throw new InfisicalConfigurationException("SecretName is required."); }
|
||||||
|
|
||||||
string resolvedProjectId = FirstNonEmpty(request.ProjectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(request.ProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
string resolvedEnvironment = FirstNonEmpty(request.Environment, connection.Environment);
|
if (string.IsNullOrEmpty(request.Environment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(resolvedEnvironment)) { throw new InfisicalConfigurationException("Environment is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "secretName", request.SecretName } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "secretName", request.SecretName } };
|
||||||
InfisicalSecretDeleteRequestDto dtoRequest = new InfisicalSecretDeleteRequestDto
|
InfisicalSecretDeleteRequestDto dtoRequest = new InfisicalSecretDeleteRequestDto
|
||||||
{
|
{
|
||||||
WorkspaceId = resolvedProjectId,
|
WorkspaceId = request.ProjectId,
|
||||||
Environment = resolvedEnvironment,
|
Environment = request.Environment,
|
||||||
SecretPath = FirstNonEmpty(request.SecretPath, connection.DefaultSecretPath, "/"),
|
SecretPath = FirstNonEmpty(request.SecretPath, "/"),
|
||||||
Type = string.IsNullOrEmpty(request.Type) ? "shared" : request.Type.ToLowerInvariant()
|
Type = string.IsNullOrEmpty(request.Type) ? "shared" : request.Type.ToLowerInvariant()
|
||||||
};
|
};
|
||||||
string body = _serializer.Serialize(dtoRequest);
|
string body = _serializer.Serialize(dtoRequest);
|
||||||
|
|||||||
@@ -29,10 +29,9 @@ namespace PSInfisicalAPI.Tags
|
|||||||
public InfisicalTag[] List(InfisicalConnection connection, string projectId)
|
public InfisicalTag[] List(InfisicalConnection connection, string projectId)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId } };
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -42,7 +41,7 @@ namespace PSInfisicalAPI.Tags
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
List<InfisicalTagResponseDto> source = dto != null ? (dto.WorkspaceTags ?? dto.Tags) : null;
|
List<InfisicalTagResponseDto> source = dto != null ? (dto.WorkspaceTags ?? dto.Tags) : null;
|
||||||
InfisicalTag[] mapped = InfisicalTagMapper.MapMany(source, resolvedProjectId);
|
InfisicalTag[] mapped = InfisicalTagMapper.MapMany(source, projectId);
|
||||||
_logger.Information(Component, "Infisical tag list retrieval was successful.");
|
_logger.Information(Component, "Infisical tag list retrieval was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -56,11 +55,10 @@ namespace PSInfisicalAPI.Tags
|
|||||||
public InfisicalTag Retrieve(InfisicalConnection connection, string projectId, string tagSlugOrId)
|
public InfisicalTag Retrieve(InfisicalConnection connection, string projectId, string tagSlugOrId)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(tagSlugOrId)) { throw new InfisicalConfigurationException("Tag slug or id is required."); }
|
if (string.IsNullOrEmpty(tagSlugOrId)) { throw new InfisicalConfigurationException("Tag slug or id is required."); }
|
||||||
|
|
||||||
InfisicalTag[] all = List(connection, resolvedProjectId);
|
InfisicalTag[] all = List(connection, projectId);
|
||||||
foreach (InfisicalTag tag in all)
|
foreach (InfisicalTag tag in all)
|
||||||
{
|
{
|
||||||
if (string.Equals(tag.Id, tagSlugOrId, StringComparison.OrdinalIgnoreCase) ||
|
if (string.Equals(tag.Id, tagSlugOrId, StringComparison.OrdinalIgnoreCase) ||
|
||||||
@@ -76,11 +74,10 @@ namespace PSInfisicalAPI.Tags
|
|||||||
public InfisicalTag Create(InfisicalConnection connection, string projectId, string slug, string name, string color)
|
public InfisicalTag Create(InfisicalConnection connection, string projectId, string slug, string name, string color)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(slug)) { throw new InfisicalConfigurationException("Slug is required."); }
|
if (string.IsNullOrEmpty(slug)) { throw new InfisicalConfigurationException("Slug is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId } };
|
||||||
InfisicalTagCreateRequestDto request = new InfisicalTagCreateRequestDto { Slug = slug, Name = name, Color = color };
|
InfisicalTagCreateRequestDto request = new InfisicalTagCreateRequestDto { Slug = slug, Name = name, Color = color };
|
||||||
string body = _serializer.Serialize(request);
|
string body = _serializer.Serialize(request);
|
||||||
|
|
||||||
@@ -92,7 +89,7 @@ namespace PSInfisicalAPI.Tags
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalTagResponseDto inner = dto != null ? (dto.WorkspaceTag ?? dto.Tag) : null;
|
InfisicalTagResponseDto inner = dto != null ? (dto.WorkspaceTag ?? dto.Tag) : null;
|
||||||
InfisicalTag mapped = InfisicalTagMapper.Map(inner, resolvedProjectId);
|
InfisicalTag mapped = InfisicalTagMapper.Map(inner, projectId);
|
||||||
_logger.Information(Component, "Infisical tag creation was successful.");
|
_logger.Information(Component, "Infisical tag creation was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -106,11 +103,10 @@ namespace PSInfisicalAPI.Tags
|
|||||||
public InfisicalTag Update(InfisicalConnection connection, string projectId, string tagId, string slug, string name, string color)
|
public InfisicalTag Update(InfisicalConnection connection, string projectId, string tagId, string slug, string name, string color)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(tagId)) { throw new InfisicalConfigurationException("TagId is required."); }
|
if (string.IsNullOrEmpty(tagId)) { throw new InfisicalConfigurationException("TagId is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId }, { "tagId", tagId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId }, { "tagId", tagId } };
|
||||||
InfisicalTagUpdateRequestDto request = new InfisicalTagUpdateRequestDto { Slug = slug, Name = name, Color = color };
|
InfisicalTagUpdateRequestDto request = new InfisicalTagUpdateRequestDto { Slug = slug, Name = name, Color = color };
|
||||||
string body = _serializer.Serialize(request);
|
string body = _serializer.Serialize(request);
|
||||||
|
|
||||||
@@ -122,7 +118,7 @@ namespace PSInfisicalAPI.Tags
|
|||||||
response.Clear();
|
response.Clear();
|
||||||
|
|
||||||
InfisicalTagResponseDto inner = dto != null ? (dto.WorkspaceTag ?? dto.Tag) : null;
|
InfisicalTagResponseDto inner = dto != null ? (dto.WorkspaceTag ?? dto.Tag) : null;
|
||||||
InfisicalTag mapped = InfisicalTagMapper.Map(inner, resolvedProjectId);
|
InfisicalTag mapped = InfisicalTagMapper.Map(inner, projectId);
|
||||||
_logger.Information(Component, "Infisical tag update was successful.");
|
_logger.Information(Component, "Infisical tag update was successful.");
|
||||||
return mapped;
|
return mapped;
|
||||||
}
|
}
|
||||||
@@ -136,11 +132,10 @@ namespace PSInfisicalAPI.Tags
|
|||||||
public void Delete(InfisicalConnection connection, string projectId, string tagId)
|
public void Delete(InfisicalConnection connection, string projectId, string tagId)
|
||||||
{
|
{
|
||||||
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
if (connection == null) { throw new ArgumentNullException(nameof(connection)); }
|
||||||
string resolvedProjectId = FirstNonEmpty(projectId, connection.ProjectId);
|
if (string.IsNullOrEmpty(projectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
||||||
if (string.IsNullOrEmpty(resolvedProjectId)) { throw new InfisicalConfigurationException("ProjectId is required."); }
|
|
||||||
if (string.IsNullOrEmpty(tagId)) { throw new InfisicalConfigurationException("TagId is required."); }
|
if (string.IsNullOrEmpty(tagId)) { throw new InfisicalConfigurationException("TagId is required."); }
|
||||||
|
|
||||||
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", resolvedProjectId }, { "tagId", tagId } };
|
Dictionary<string, string> pathParameters = new Dictionary<string, string> { { "projectId", projectId }, { "tagId", tagId } };
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -156,11 +151,5 @@ namespace PSInfisicalAPI.Tags
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string FirstNonEmpty(params string[] values)
|
|
||||||
{
|
|
||||||
if (values == null) { return null; }
|
|
||||||
foreach (string value in values) { if (!string.IsNullOrEmpty(value)) { return value; } }
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user