Adding command line tools support for user api keys

Thanks @fitz! I can confirm that I can get a token with the helpme client I’m developing - should it be a string on multiple lines that we join by newline or just empty space (to generate one long string)?

Currently, I’m sending the api_username and api_token as part of the body (in data) and the requests that I made previously (using my Dockerized discourse with an admin key) are returning 403, Forbidden. Is your instance expecting a different post type (perhaps in headers or something different?) Or am I not parsing the key from the web interface correctly?

I’m overall wondering how the public key helps in this interaction. I’m guessing that since I’m logged into the discourse instance in my browser, an association is made between my login and the token that is generated? Didn’t we want to do some kind of token generation and/or using a key to sign, encrypt, and send, and then the server decodes?

Ok,
We put together a PR here
https://github.com/discourse/discourse/pull/6840

Hope this helps.

3 Likes

pusheen-typing Programmer Pusheen, +1!

Thanks everyone for the enormous effort here! We’ve merged the discourse PR, along with the helpme client (helpme · PyPI) and I’m really excited to get a deployment underway!

3 Likes