Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Invoke-VenafiCertificateAction and policy attributes #45

Merged
merged 4 commits into from
Nov 27, 2021
Merged

Conversation

gdbarron
Copy link
Collaborator

  • Add -All option to Get-TppAttribute to get ALL effective attribute values for an object. This will provide the values as well as the path where the policy was applied
  • Add getting policies (policy attributes) with Get-TppAttribute
  • Add setting policies (policy attributes) with Set-TppAttribute
  • Add Invoke-VenafiCertificateAction. This is your one stop shop for certificate actions on TPP or VaaS. You can Retire, Reset, Renew, Push, Validate, or Revoke.
  • Cleanup output and verbose logging with Remove-TppCertificate
  • Fix parameter set issue in New-VenafiSession, ensure version and custom field info retrieval doesn't occur when creating a VaaS session

@github-actions
Copy link

PSScriptAnalyzer results:

Errors: [0], Warnings: [8], Information: [12]


RuleName   : PSReviewUnusedParameter
Severity   : Warning
ScriptName : Invoke-VenafiCertificateAction.ps1
Line       : 92
Message    : The parameter 'Retire' has been declared but not used. 

RuleName   : PSReviewUnusedParameter
Severity   : Warning
ScriptName : Invoke-VenafiCertificateAction.ps1
Line       : 95
Message    : The parameter 'Reset' has been declared but not used. 

RuleName   : PSReviewUnusedParameter
Severity   : Warning
ScriptName : Invoke-VenafiCertificateAction.ps1
Line       : 98
Message    : The parameter 'Renew' has been declared but not used. 

RuleName   : PSReviewUnusedParameter
Severity   : Warning
ScriptName : Invoke-VenafiCertificateAction.ps1
Line       : 101
Message    : The parameter 'Push' has been declared but not used. 

RuleName   : PSReviewUnusedParameter
Severity   : Warning
ScriptName : Invoke-VenafiCertificateAction.ps1
Line       : 104
Message    : The parameter 'Validate' has been declared but not used. 

RuleName   : PSReviewUnusedParameter
Severity   : Warning
ScriptName : Invoke-VenafiCertificateAction.ps1
Line       : 107
Message    : The parameter 'Revoke' has been declared but not used. 

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Invoke-VenafiCertificateAction.ps1
Line       : 226
Message    : The variable 'response' is assigned but never used.

RuleName   : PSShouldProcess
Severity   : Warning
ScriptName : New-VenafiSession.ps1
Line       : 154
Message    : 'New-VenafiSession' has the ShouldProcess attribute but does not 
             call ShouldProcess/ShouldContinue.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : New-TppObject.ps1
Line       : 159
Message    : The cmdlet 'New-TppObject' returns an object of type 'TppObject' 
             but this type is not declared in the OutputType attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : New-TppCertificate.ps1
Line       : 269
Message    : The cmdlet 'New-TppCertificate' returns an object of type 
             'TppObject' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : ConvertTo-TppGuid.ps1
Line       : 74
Message    : The cmdlet 'ConvertTo-TppGuid' returns an object of type 
             'System.Guid' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Find-TppCodeSignEnvironment.ps1
Line       : 67
Message    : The cmdlet 'Find-TppCodeSignEnvironment' returns an object of type 
             'TppObject' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Find-TppObject.ps1
Line       : 216
Message    : The cmdlet 'Find-TppObject' returns an object of type 'TppObject' 
             but this type is not declared in the OutputType attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppToken.ps1
Line       : 175
Message    : The cmdlet 'Test-TppToken' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppToken.ps1
Line       : 179
Message    : The cmdlet 'Test-TppToken' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-TppVersion.ps1
Line       : 50
Message    : The cmdlet 'Get-TppVersion' returns an object of type 
             'System.Version' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppIdentityFormat.ps1
Line       : 16
Message    : The cmdlet 'Test-TppIdentityFormat' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 14
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 17
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 19
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

@github-actions
Copy link

PSScriptAnalyzer results:

Errors: [0], Warnings: [1], Information: [12]


RuleName   : PSUseShouldProcessForStateChangingFunctions
Severity   : Warning
ScriptName : New-VenafiSession.ps1
Line       : 152
Message    : Function 'New-VenafiSession' has verb that could change system 
             state. Therefore, the function has to support 'ShouldProcess'.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : New-TppObject.ps1
Line       : 159
Message    : The cmdlet 'New-TppObject' returns an object of type 'TppObject' 
             but this type is not declared in the OutputType attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : New-TppCertificate.ps1
Line       : 269
Message    : The cmdlet 'New-TppCertificate' returns an object of type 
             'TppObject' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : ConvertTo-TppGuid.ps1
Line       : 74
Message    : The cmdlet 'ConvertTo-TppGuid' returns an object of type 
             'System.Guid' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Find-TppCodeSignEnvironment.ps1
Line       : 67
Message    : The cmdlet 'Find-TppCodeSignEnvironment' returns an object of type 
             'TppObject' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Find-TppObject.ps1
Line       : 216
Message    : The cmdlet 'Find-TppObject' returns an object of type 'TppObject' 
             but this type is not declared in the OutputType attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppToken.ps1
Line       : 175
Message    : The cmdlet 'Test-TppToken' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppToken.ps1
Line       : 179
Message    : The cmdlet 'Test-TppToken' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-TppVersion.ps1
Line       : 50
Message    : The cmdlet 'Get-TppVersion' returns an object of type 
             'System.Version' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppIdentityFormat.ps1
Line       : 16
Message    : The cmdlet 'Test-TppIdentityFormat' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 14
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 17
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 19
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

@github-actions
Copy link

PSScriptAnalyzer results:

Errors: [0], Warnings: [0], Information: [12]


RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : New-TppObject.ps1
Line       : 159
Message    : The cmdlet 'New-TppObject' returns an object of type 'TppObject' 
             but this type is not declared in the OutputType attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : New-TppCertificate.ps1
Line       : 269
Message    : The cmdlet 'New-TppCertificate' returns an object of type 
             'TppObject' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : ConvertTo-TppGuid.ps1
Line       : 74
Message    : The cmdlet 'ConvertTo-TppGuid' returns an object of type 
             'System.Guid' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Find-TppCodeSignEnvironment.ps1
Line       : 67
Message    : The cmdlet 'Find-TppCodeSignEnvironment' returns an object of type 
             'TppObject' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Find-TppObject.ps1
Line       : 216
Message    : The cmdlet 'Find-TppObject' returns an object of type 'TppObject' 
             but this type is not declared in the OutputType attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppToken.ps1
Line       : 175
Message    : The cmdlet 'Test-TppToken' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppToken.ps1
Line       : 179
Message    : The cmdlet 'Test-TppToken' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-TppVersion.ps1
Line       : 50
Message    : The cmdlet 'Get-TppVersion' returns an object of type 
             'System.Version' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Test-TppIdentityFormat.ps1
Line       : 16
Message    : The cmdlet 'Test-TppIdentityFormat' returns an object of type 
             'System.Boolean' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 14
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 17
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

RuleName   : PSUseOutputTypeCorrectly
Severity   : Information
ScriptName : Get-VenafiAuthType.ps1
Line       : 19
Message    : The cmdlet 'Get-VenafiAuthType' returns an object of type 
             'System.String' but this type is not declared in the OutputType 
             attribute.

@gdbarron gdbarron merged commit 7a97a22 into main Nov 27, 2021
@gdbarron gdbarron deleted the 20211118 branch November 27, 2021 13:54
@gdbarron gdbarron linked an issue Nov 27, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

return all values from Get-TppAttribute, including default policy
1 participant