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

Return the hash with the token #506

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

lucasvianna
Copy link
Contributor

Related to this issue #505

@lucasvianna lucasvianna requested a review from a team as a code owner December 17, 2024 18:31
Copy link

google-cla bot commented Dec 17, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Member

@dazuma dazuma left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@dazuma
Copy link
Member

dazuma commented Dec 17, 2024

@lucasvianna We do need to get a CLA signature from you in order to merge your pull request. Otherwise, I can reproduce your change in a separate pull request.

@lucasvianna
Copy link
Contributor Author

@dazuma, thank you for reviewing this PR. I already submitted my CLA signature but haven't received an update so far. Feel free to reproduce my change if it helps to get the fix released sooner.

@@ -37,6 +37,8 @@ def apply! a_hash, opts = {}
hash = Digest::SHA256.hexdigest token
Google::Logging::Message.from message: "Sending auth token. (sha256:#{hash})"
end

a_hash
Copy link
Member

Choose a reason for hiding this comment

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

@lucasvianna Actually, I should have looked at this more carefully. Prior to the change you referenced in #505, this method returned not the hash but the header value (i.e. the string "Bearer #{token}"). If you wanted to restore the original behavior, we'd need to do something different here. So just want to confirm whether you want the string or the full hash.

Also, on thinking about this, apply! isn't meant for you to use the return value. That's what apply is for. I'm happy to make a change here to restore the original behavior because it doesn't hurt anything, but I also recommend not depending on behavior that isn't actually documented in the method comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dazuma you're right. I changed it to reflect the old behavior. That's what I meant since the beginning. Thank you for pointing that out.

Also, I'll do what you recommend and use apply instead.

@dazuma dazuma merged commit b10cda4 into googleapis:main Dec 17, 2024
8 of 9 checks passed
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