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

feat: add pscredential and securestring #283

Merged

Conversation

erikgraa
Copy link
Contributor

@erikgraa erikgraa commented Jul 9, 2024

Summary

Enhanced Request-VCFToken and Connect-CloudBuilder by adding a PSCredential parameter set and adding support for SecureString for the Password parameter.

I've tested the following:

SDDC Manager

  1. Use a clear-text string password.
Request-VCFToken -fqdn <fqdn> -username administrator@vsphere.local -password <plainTextPassword>
  1. Use a SecureString password.
$secureString = Read-Host -AsSecureString 'Password'
Request-VCFToken -fqdn <fqdn> -username administrator@vsphere.local -password $secureString
  1. Use a SecureString as password.
Request-VCFToken -fqdn <fqdn> -username administrator@vsphere.local
  1. Use a PSCredential object.
$credential = Get-Credential
Request-VCFToken -fqdn <fqdn> -credential $credential
  1. Provide a PSCredential object (username/password).
Request-VCFToken -fqdn <fqdn>

Cloud Builder

  1. Use a clear-text string password.
Connect-CloudBuilder -fqdn <fqdn> -username admin -password <plainTextPassword>
  1. Use a SecureString password.
$secureString = Read-Host -AsSecureString 'Password'
Connect-CloudBuilder -fqdn <fqdn> -username admin -password $secureString
  1. Use a SecureString as password.
Connect-CloudBuilder -fqdn <fqdn> -username admin
  1. Use a PSCredential object.
$credential = Get-Credential
Connect-CloudBuilder -fqdn <fqdn> -credential $credential
  1. Provide a PSCredential object (username/password).
Connect-CloudBuilder -fqdn <fqdn>

Will ask for a PSCredential (username/password).

Type

  • Bugfix
  • Enhancement or Feature
  • Code Style or Formatting
  • Documentation
  • Refactoring
  • Chore
  • Other
    Please describe:

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

Test and Documentation

  • Tests have been completed.
  • Documentation has been added or updated.

Issue References

A furthering of #116

Additional Information

N/A

@vmwclabot vmwclabot added the dco-required Developer Certificate of Origin Sign-off Required label Jul 9, 2024
@github-actions github-actions bot added documentation Documentation needs-review Needs Review labels Jul 9, 2024
@erikgraa erikgraa force-pushed the enhancement/pscredentialset-redux branch from 89cf38a to e8d6616 Compare July 9, 2024 13:13
@vmwclabot vmwclabot removed the dco-required Developer Certificate of Origin Sign-off Required label Jul 9, 2024
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please retain the use of camelCase parameters fqdn, username, and password?

PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes and comments provided.

@vmwclabot vmwclabot added the dco-required Developer Certificate of Origin Sign-off Required label Jul 9, 2024
@erikgraa erikgraa force-pushed the enhancement/pscredentialset-redux branch from 8f55fd3 to 79f7b82 Compare July 9, 2024 22:07
@vmwclabot vmwclabot added dco-required Developer Certificate of Origin Sign-off Required and removed dco-required Developer Certificate of Origin Sign-off Required labels Jul 9, 2024
@erikgraa erikgraa force-pushed the enhancement/pscredentialset-redux branch 3 times, most recently from 9dc5e8a to 99ee156 Compare July 11, 2024 17:58
@vmwclabot vmwclabot removed the dco-required Developer Certificate of Origin Sign-off Required label Jul 11, 2024
Copy link
Contributor Author

@erikgraa erikgraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed back to camelcase!

@erikgraa erikgraa requested a review from tenthirtyam July 12, 2024 01:23
@tenthirtyam tenthirtyam changed the title feat: Enhanced Request-VCFToken and Connect-CloudBuilder by adding a PSCredential parameter set and adding support for SecureString for the Password parameter feat: add pscredential and securestring Jul 12, 2024
@erikgraa
Copy link
Contributor Author

Some changes and comments provided.

Hi @tenthirtyam, let me know if something else needs refinement before this PR is ready to merge 👍🏻

@tenthirtyam tenthirtyam added this to the Backlog milestone Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
PowerVCF.psm1 Outdated Show resolved Hide resolved
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes.

Copy link
Contributor Author

@erikgraa erikgraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tenthirtyam tenthirtyam force-pushed the enhancement/pscredentialset-redux branch from cd82f5e to e64714f Compare September 25, 2024 02:14
@tenthirtyam tenthirtyam self-requested a review September 25, 2024 02:15
@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Sep 25, 2024

I've force-pushed a couple more changes to ensure each cmdlet uses the same structure and that the documenation is a match. e64714f

Thus far this looks good but I want to run some tests before next steps.

@tenthirtyam tenthirtyam modified the milestones: Backlog, v2.5.0 Sep 25, 2024
Enhanced `Request-VCFToken` and `Connect-CloudBuilder` by adding a `PSCredential `parameter set and adding support for `SecureString` or PSCredential object for the `password` parameter.

Signed-off-by: Erik Grina Raassum <erik.raassum@gmail.com>
Co-Authored-By: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam tenthirtyam force-pushed the enhancement/pscredentialset-redux branch from e64714f to c41652d Compare September 25, 2024 02:30
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've have successfully tested these changes in one of our development environments with the following:

SDDC Manager

Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io -username administrator@vsphere.local -password VMw@re1!

$secureString = Read-Host -AsSecureString 'Password'
Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io -username administrator@vsphere.local -password $secureString

$credential = Get-Credential
Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io -credential $credential

Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io -username administrator@vsphere.local

Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io

Cloud Builder

Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io -username admin -password VMw@re1!VMw@re1!

$secureString = Read-Host -AsSecureString 'Password'
Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io -username admin -password $secureString

$credential = Get-Credential
Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io -credential $credential

Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io -username admin

Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io

LGTM! 🚀

@tenthirtyam tenthirtyam removed the needs-review Needs Review label Sep 25, 2024
@tenthirtyam tenthirtyam merged commit 1b5f01b into vmware:develop Sep 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants