Include GetOAuth* methods in Client's method set
Fixes #744 .
This PR moves the previously static GetOAuth* methods into Client's method set. This permits to use the configurable API endpoint instead of the global constant, and the existing HTTP client that is set on the Client.
This PR currently doesn't include unit tests, as no such tests existed before either. Please advise if you want me to add tests.
Note: this PR breaks backwards compatibility.
Verification please.
Thank you for your PR.
I agree that the testability is low due to the dependency on APIURL constant value, but this function itself does not seem to be a feature that slack.Client should have 🤔 So, it would be nice to have some other ideas to solve this problem...
@kanata2 thanks for your feedback
does not seem to be a feature that slack.Client should have
why not?
Even if this is the OAuth flow, it still belongs to the Slack API with the same base path, as usage of APIURL constant shows.
An alternative approach is to declare a different client, let's say slack.OAuthClient, and add these funcs to its method set, but that would require duplicating a bunch of code...
As a matter of fact, I'm not sure why you designed these OAuth funcs as static.