-
Notifications
You must be signed in to change notification settings - Fork 57
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
Export selector and DNS response via Verification #42
base: master
Are you sure you want to change the base?
Conversation
This makes debugging much easier. It can be difficult to debug issues as the verification struct does not contain all information used for the verification like the public key or the selector. If you change the DNS record and don't know if DNS is still cached further information can help.
dkim/verify.go
Outdated
@@ -79,6 +83,9 @@ type Verification struct { | |||
// The expiration time. If the signature doesn't expire, it's set to zero. | |||
Expiration time.Time | |||
|
|||
// The QueryResult holds the parsed DNS response | |||
QueryResult *queryResult |
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.
We can't add a public field with a private type like this.
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.
I don't understand what you mean. Why is it private and why can't we export it?
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's unexported, because it begins with a lowercase letter.
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.
But QueryResult
starts with a big letter? Can you explain what you mean? Thanks.
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.
The field QueryResult
is exported, the type *queryResult
isn't.
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.
ah I see. I'm still not sure about you're opinion. Should I make the type public or do you think that's a bad idea in general?
Can't we add more context to the error messages instead? |
I want to write a mail tester like mail-tester.com. If something fails, I want to show the used public keys, selector, etc. as debug infos. I think for this use case a more verbose error message is not sufficient. Having access to all fields makes it easier. |
Hey, |
This makes debugging much easier. It can be difficult to debug issues
as the verification struct does not contain all information used for
the verification like the public key or the selector. If you
change the DNS record and don't know if DNS is still cached further
information can help.
Thank you for writing this library!
kmille