Implement resource owner credentials#7424
Conversation
There is nothing wrong with that. OAuth is an HTTP-based protocol, so in order to test it, you'll need an HTTP server. |
|
It would be nice not having to spin up an HTTP::Server for testing what request should be generated. We need some kind of thing that we can mock that receives a request and returns a response. Maybe that concept is called a Transport in Go, I'm not sure. In any case, for now I guess the only way is spinning up an HTTP::Server... |
|
👍 I can maybe look into doing that in another PR. I used https://github.com/manastech/webmock.cr in the past. Was pretty slick. |
|
@straight-shoota @asterite I added some specs for the getting an access token. Not sure what else could be done to make it better, but i'm open to ideas. |
|
I'm sorry, I thought #7197 was already merged into master, but it isn't. Please take a look at the changes in this PR to avoid leaking fibers and sockets from the spec. |
|
@straight-shoota Done. I created the Shouldn't conflict assuming no further changes are made to it. |
* Implement resource owner credentials * Fix link name * get_access_token_using_* * remove headers from response * Address comments * Display timeout value in exception
* fixes: Foreign exceptions: basic support Added support for `.so' libraries, fixed segfault, small bugs OptionParser: optional options and arguments shifting XML: workaround for bug in libxml2 2.9.9 (crystal-lang#7477) Implement resource owner credentials (crystal-lang#7424) Implement #annotations (crystal-lang#7326) Handle signals in a separate fiber Compiler: reactively compute a union's type, and check for missing types Compiler: fix as? casting when target doesn't have a type yet Compiler: fix as casting when target doesn't have a type yet Compiler: give pare error when assigning a constant inside a multiassign Format: fix indent of nested array elements (crystal-lang#7450) Disable double write buffering in OpenSSL sockets (crystal-lang#7460)
Resolves #7086
get_access_token_using_resource_owner_credentials"Content-Type" => "application/x-www-form-urlencoded"to better adhere to the RFC.I think it would be nice to test the
get_access_token_using_*methods create the proper request. However not sure how to best handle that without setting up a mock HTTP server...