-
Notifications
You must be signed in to change notification settings - Fork 352
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
Remove package globals #277
Comments
Might be difficult however:
Although this is actually really bad design because instead of giving the signing methods the already decoded signature, each signing method does it on its own. Basically, these lines are part of every signing method: // Decode the signature
var sig []byte
if sig, err = DecodeSegment(signature); err != nil {
return err
} Changing this, would mean changing the public interface of Moving the |
To include all previous discussions, there was some concern about moving |
Hahaha, I gotta run to work... but that's exactly what I was exploring:
I think it'd be quite powerful if the caller had the opportunity to bring their own implementation. I do however worry about the number of (breaking) changes we're making and whether this will deter user trust. |
I think the changes from an end-user perspective are not seeable. I see no good reason why anyone want to implement their own signing method. There are only a few accepted signing methods and as far as I know, we implement all of them. Plus, its definitely a better design choice to leave en/decoding to the parser and signing/verifying to the signing method. |
Came to open this issue but it's here already. It'd be great to remove global mutable state. Imagine a program that needs to use this library with different settings in different areas of the program (e.g. p.s. thanks a lot for taking care of this library! |
There are a bunch of global variables throughout the package, if there's ever a time to move these as explicit args (or functional options), this might be the time?
Here are some that come to mind, maybe some of them make sense to keep, but figured it's worth discussing:
The text was updated successfully, but these errors were encountered: