refact: handle Authorization as a header#24
Conversation
|
@NTBBloodbath indeed now the auth table is returned. However, with this request: POST https://reqres.in/api/users
Authorization: Bearer h3r3_is_sup3r10ng_t0ken!!!111
Content-Type: application/json
{
"name": "morpheus",
"job": "leader"
}preview is showing me this: so there is -u flag (user) that is assigned 1:Bearer value. This seems to me to be plenary issue - where they are after username:password pair. What we are after with the token, is the header passed to curl call: edits: typos and a link |
|
Alright, that's a plenary issue then or maybe I'm not understanding that auth field in the plenary cURL wrapper, thanks to trying it out. I think I can do a workaround myself to fix it by passing the authentication header as a header instead of passing it as auth, do you want to try in that way? |
|
Considering there is not so big movement on plenary side around my question - I think it's best approach. I am also a bit confused on the auth field. Maybe the whole reason is that auth is supposed to be used only for -u option in curl, and rest of to-be-headers should be passed to headers table? |
|
I think so, gimme a moment to modify the files and I'll let you know so you can try it |
|
Alright, lemme know if it's working now! |
get_auth was always returning nil|
@NTBBloodbath works like a charm:) |
|
@NTBBloodbath I will ask you for yet another improvement related to this one:). I will make a separate issue for it, though, so we can discuss properly. |
|
Thank you for testing it, I'm gonna merge it right now. Just remember to close the plenary issue because it was fixed by our side.
Sure, I'm gonna check it out right now, thank you! |
This PR fixes the
get_authfunction returning value so theAuthorizationheader value will be successfully passed.@mr-majkel can you please give it a try? I think that issue was by my side. Already passed an Authorization statement like
Authorization: Bearer random_charactersbut I don't have how to properly test it right now, although I think it should work as intended.Lemme know if the issue is fixed here and if that's the case then let's close the plenary issue regarding to Bearer tokens.
Regards