Add APDU debugging using a trace api similar to httptrace#138
Open
areese wants to merge 1 commit intogo-piv:masterfrom
Open
Add APDU debugging using a trace api similar to httptrace#138areese wants to merge 1 commit intogo-piv:masterfrom
areese wants to merge 1 commit intogo-piv:masterfrom
Conversation
ericchiang
reviewed
Feb 20, 2024
Collaborator
ericchiang
left a comment
There was a problem hiding this comment.
Rather than using contexts, I would recommend the exported API look something:
type ClientTrace struct {
Transmit func(req []byte)
TransmitResult func(...)
}
type Client struct {
Trace *ClientTrace
}
func (c *Client) Open(*Yubikey, error) { ... }Dropping the WithClientTrace methods and use of contexts
Contributor
Author
I think that's way better. I didn't think of that path, and just added context. |
A ClientTrace struct can be set on a YubiKey object, or a piv.Client struct can be created and Open called against that.
f044341 to
d480045
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@ericchiang Please let me know what you think of this way of tracing.
I need to sign the commits, I don't have the keys right now, and I need to try this out, I don't have the harness.