oauth1
oauth1 copied to clipboard
Adding of RSA-SHA256 signature and oauth_body_hash parameter
Hi,
First at all, thanks for your work on this package.
The purpose of this pull request is to add the following features:
- Add the management of the signature method RSA-SHA256.
- Add the management of the
oauth_body_hash
parameter in OAuth header. In order to not break the method's signature, a new one is created to manage it: SetAuthorizationHeaderWithBody. 1- Fixes some golint errors. - Using of constants instead of plain text for header and parameters.
- Using of context package instead of golang.org/x/net/context to remove external dependency. Go version required >1.7.
Thanks,
Strip the PR back to the features listed in the title and golang.org/x/net/context > context go1.7 conversion. Because my time is limited, I don't want to review or even discuss the cosmetic changes.
Given that the caller must keep a copy of the body on hand for the request, does it make sense to specify the body with a []byte instead of an io.Reader? If an io.Reader is used because the body might be a large file on disk, then SignatureMethod.hash should io.Copy the body to the hash.
Sorry for the late return, I also have limited time. As you want, I just wanted to help by decreasing the number of lint errors. Regarding the io.Reader, I will not argue but, rather than taking in strings or []byte slices, in this kind of usage, I use an io.Reader for data sources (work with every type).
Hi Gary, gentle reminder :)