Skip to content
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

Bearer token authentication #69

Open
burk opened this issue Feb 17, 2021 · 2 comments
Open

Bearer token authentication #69

burk opened this issue Feb 17, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@burk
Copy link

burk commented Feb 17, 2021

Nice library!

Have you considered adding support for bearer token authentication and/or other authentication methods? In my use-case I need to call /login with some known values, which returns a token that I need to send as a header for all the following requests.

@aviaviavi
Copy link
Owner

aviaviavi commented Feb 17, 2021

Thanks @burk!

Bearer auth can definitely be added. I haven't needed it myself which is the only reason it's not there yet. :) We have support for basic auth now, as can be seen in https://github.com/aviaviavi/curl-runnings/blob/master/examples/auth.yaml now. Bearer auth would have a similar interface.

Until this gets implemented, you should still be able to use curl-runnings for your use-case, by setting the header manually. Something like:

headers:  "Authorization: Bearer $<RESPONSES[some_index].path.to.token>"

will work, though definitely less ergonomic. The pretty printer is also smart enough to redact your actual auth headers when it logs the request, so you won't be writing anything sensitive to logs.

I myself am a bit swamped with my own work for the next few weeks but will look into getting something implemented when I can. If anyone reading would like to contribute the change, I am happy to help!

@aviaviavi aviaviavi added enhancement New feature or request good first issue Good for newcomers labels Feb 18, 2021
@burk
Copy link
Author

burk commented Feb 18, 2021

Oh, I didn't explore the docs enough to find that option! That should work perfectly for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants