Skip to content

Convert PasswordString to String#9

Open
rewrlution wants to merge 2 commits intojohnmaeda:mainfrom
rewrlution:convert-passwordstring-to-string
Open

Convert PasswordString to String#9
rewrlution wants to merge 2 commits intojohnmaeda:mainfrom
rewrlution:convert-passwordstring-to-string

Conversation

@rewrlution
Copy link
Copy Markdown

This PR is for fixing the issue mentioned here: #8

The root cause I believe is that the Settings.cs cannot be compiled because of this error:

Cannot implicitly convert type 'Microsoft.DotNet.Interactive.PasswordString' to 'string'

And since PasswordString has a ToString() method, we can simply invoke it and so that the compiler is happy and hence the notebote will be happy.

@rewrlution
Copy link
Copy Markdown
Author

Using ToString() method is a dumb idea, since the ToString() method is to return a hidden secret ************. I will need to study more about the PasswordString method to fix the bug properly.

@rewrlution
Copy link
Copy Markdown
Author

I should use the GetClearTextPassword() function instead of ToString() function.

I believe the ToString() function is used in the VSCode Editor where the editor just displays ****************** after users pasting their secrets, but when we save the secret to the local file, we should use GetClearTextPassword().

Tested and worked in my local box.

@rewrlution rewrlution reopened this Oct 11, 2023
@dbatay
Copy link
Copy Markdown

dbatay commented Nov 15, 2023

thanks mate, it resolves the issue. Hope this gets approved soon.

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.

2 participants