-
Notifications
You must be signed in to change notification settings - Fork 5.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
Add hmac_compute #54164
Add hmac_compute #54164
Conversation
…o add-hmac-compute
…o add-hmac-compute
…o add-hmac-compute
Thanks for the PR! This looks good - and the lint issues aren't actually with your code, just existing code. Would you mind fixing those? It's not possible, apparently, to tell lint that we only care about changed lines on PRs 🙃 |
@waynew , I think the right way to go here is to mark |
Actually, the lint issue is due to the fact that in Python3 it's Since this is going into develop, and we're dropping Python2 support, and encodebytes was introduced in Python 3.1, I'd say that it's perfectly safe to change |
yeah, you could go that way. I'm just saying that "fixing" those lint issues would duplicate the functionality already found in base64_b64encode and base64_b64decode. you'd end up getting the same output. if you really want to keep the legacy functionality, you could use |
I don't understand what you mean. base64_b64* are wrappers around base64.b64(encode/decode) base64.encodebytes does not produce the same output:
What am I missing here? |
haha! my bad. I wasn't using a long enough test. |
@waynew I apologize for the delay, I haven't been able to get to this until now. I will be fixing that issue later tonight most likely. Correct me if I am wrong here, but Python2 only has support for encodestring/decodestring and not for encodebytes/decodebyes. While Python3 has support for both (with encodestring/decodestring being depreciated). Is Python2 support anticipated to be dropped by the next version of Salt? If it isn't then should I just use both encodebytes/decodebytes and encodestring/decodestring in the module and utils files and ensure that the correct function is being used based on the Python version Salt supports at that moment? If it is going to be dropped by the next version then I can just set it up with only encodebytes/decodebytes for when it gets added to the develop branch. Edit: Also I accidentally requested that review, sorry about that. |
No problem. Life gets busy for all of us :)
Right - with the Sodium release we are dropping Python2 support. That means that you can safely use
Heh, no problem - Sometimes it's not entirely clear what does what in GitHub 😂 Summary: Yes, use |
@waynew Finished fixing that all up. Sorry about the multiple commit mess-ups, this is my first time ever submitting a PR :P |
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.
No problems 😀 We've all been there, I'm sure 🙃
Only one little tweak I think, and this should be good to go!
@Ajnbro looks great, thanks! We're working through some internal changes to exactly how we merge, so the actual merge will be coming soon(ish). Just translate that |
@Ajnbro We are no longer accepting PRs to the |
Add hmac_compute (Repost of #54164)
What does this PR do?
Creates a util and a module called hmac_compute for computing a HMAC SHA256 hexdigest using a string and secret.
What issues does this PR fix or reference?
N/A
Tests written?
Yes
Commits signed with GPG?
Yes