-
Notifications
You must be signed in to change notification settings - Fork 96
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
Pst/custom token #33
Pst/custom token #33
Conversation
Since |
Hi @fxgamundi, thoughts on us closing this pull request for the aforementioned reason? Or is there a good rationale for this change to be added? |
Hi @Vervious ! I think it's a good thing for the native SDK to support
different token headers other than the built in X-Algo-API-Token. It would
make a much easier work to anyone that, like us, has a wrapper on the node
so that the calls don't go directly to it, but still have 100%
compatibility for the algod REST APIs.
Cultivating an environment conducive to the desired proliferation of Algo
tokens constitutes the call for integration with external libraries. The
allowance of secondary tokens then seems tantamount to the direction of
Algorand.
|
Worth noting that the JS SDK supports both X-Api-Key and X-Algo-API-Token, so it would be ideal if the Go SDK did as well. |
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.
For better type safety and to not change interfaces, I rather avoid using the empty interface. Please consider simply adding MakeClientWithHeaders(address string, apiToken string, headers []Header)
instead of the combined version. Besides that, looks good.
We added the new factory function to create an algod client with headers. |
Add support for multiple different headers - backwards compatible for existing code