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

Fixes serialization bug in github-actions OP (GithubOp) #112

Merged
merged 4 commits into from
Mar 8, 2024

Conversation

EthanHeilman
Copy link
Member

@EthanHeilman EthanHeilman commented Mar 7, 2024

When memguard was added to the GitubOP in PR #48, it introduce a bug that caused the GithupOP to throw an error when unmarshalling the response from github.

var jwt struct {
	Value *memguard.LockedBuffer
}
err = json.Unmarshal(rawBody, &jwt)
memguard.WipeBytes(rawBody)

The bug was that rawBody.value is of type string, not type byte[] so this throws json: cannot unmarshal string into Go struct field .Value of type memguard.LockedBuffer.

This PR fixes the bug and adds unittests to the GithubOP to prevent regressions.

@EthanHeilman EthanHeilman self-assigned this Mar 7, 2024
@EthanHeilman EthanHeilman added the bug Something isn't working label Mar 8, 2024
@EthanHeilman EthanHeilman marked this pull request as ready for review March 8, 2024 01:40
@EthanHeilman EthanHeilman merged commit f40a4cd into openpubkey:main Mar 8, 2024
3 checks passed
EthanHeilman added a commit to EthanHeilman/openpubkey that referenced this pull request Mar 8, 2024
* Fixes serialization bug in githubOp
* Githup OP unittest test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants