-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Added HMAC authentication mode in Hash generators #555
Conversation
Todo: localized text and an icon for the HMAC mode toggle switch and secret key text box label
Hi, |
@veler I had initially implemented it that way but thought that the |
That is fair :-) Let's keep it the way it is then ! |
@@ -42,6 +42,17 @@ | |||
<ComboBoxItem Tag="Base64" Content="{x:Bind ViewModel.Strings.OutputBase64}"/> | |||
</ComboBox> | |||
</controls:ExpandableSettingControl> | |||
<controls:ExpandableSettingControl | |||
Title="HMAC Mode"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please globalize this string by adding a new entry in https://github.com/veler/DevToys/blob/main/src/dev/impl/DevToys/Strings/en-US/HashGenerator.resw . Then open https://github.com/veler/DevToys/blob/main/src/dev/impl/DevToys/LanguageManager.tt in Visual Studio, press Ctrl+S (even if there's no changes). This will re-regenerate https://github.com/veler/DevToys/blob/main/src/dev/impl/DevToys/LanguageManager.cs automatically and you will then be able to use the resource in the XAML.
@@ -50,6 +61,13 @@ | |||
AcceptsReturn="True" | |||
Text="{x:Bind ViewModel.Input, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> | |||
|
|||
<controls:CustomTextBox x:Name="SecretKeyInput" | |||
Header="Secret Key (HMAC only)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here. Also, perhaps we can remove (HMAC only)
since this field only appear when HMAC mode
is enabled.
string? hash = ""; | ||
IBuffer? buffer = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could add some unit tests to https://github.com/veler/DevToys/blob/main/src/tests/DevToys.Tests/Providers/Tools/HashGeneratorTests.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks all good ! :D Thank you so much for this contribution!!
No problem, I'm really happy to contribute :) |
* Added first prototype of hmac feature Todo: localized text and an icon for the HMAC mode toggle switch and secret key text box label * Added an icon for HMAC * Fixed compilation errors after merging from main * Added unit tests, globalized strings
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Currently, we do not have HMAC generation feature in the tool. Please refer: 516
Issue Number: 516
What is the new behavior?
I'm using
MacAlgorithmProvider
currently for this feature. I also noticed that SHA 384 hash output is missing, I could implement that as well but I'm not sure why it was not added on the Hash generator screen.Here's how it'll look like with the fix:
I'm currently using hardcoded strings for the toggle switch and the secret key textbox title. I just wanted to make sure that the current strings are good enough in this PR review, before I initiate a translation on Crowdin.
Other information
Quality check
Before creating this PR, have you: