Repository navigation
Add Support for Null Usernames in Web Cmdlet Basic Auth - #9536
Aditya Patwardhan (adityapatwardhan) merged 2 commits into
Conversation
…Cmdlet/Common/WebRequestPSCmdlet.Common.cs Style fix Co-Authored-By: markekraus <github@markekraus.com>
|
Steve Lee (@SteveL-MSFT) CodeFactor helped us with such formatting issues. Is it possible to bring it back? |
|
Ilya (@iSazonov) seems odd that Codacy wouldn't also catch such an issue |
|
Mark Kraus (@markekraus) Thank you for your contribution. |
|
Steve Lee (@SteveL-MSFT) > seems odd that Codacy wouldn't also catch such an issue Sorry, I don't understand that you mean. |
|
Without CodeFactor, we will begin again to collect formatting errors and fall into discussions of this. |
PR Summary
It is possible to construct PSCredential objects with null or empty usernames. However, doing so makes it impossible to retrieve the plain-text password from the PSCredential.GetNetworkCredential() API. There are some Web APIs which may require a null or empty username. This PR changes the way the password is parsed from the Credential parameter such that a null or empty username will not impact conversion to plain-text.
PR Context
Closes #9017
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.