meilisearch-rust icon indicating copy to clipboard operation
meilisearch-rust copied to clipboard

Allow the creation of a `Client` without any API Key

Open irevoire opened this issue 3 years ago • 3 comments

Currently, we can’t create a Client without any API Key. But when you’re using meilisearch in development you can totally launch your instance without any API Key. There is no reason to not support that.

irevoire avatar Feb 14 '22 13:02 irevoire

What would the default behavior be for instantiating the client in regards to the api_key field on the Client struct be? I might be able to take this issue.

ghost avatar May 03 '22 17:05 ghost

I think we should change the Client struct to take an Option<String> for the API key. And then, for every request, when we send a request, we check if an API key is defined, and if there is none, we don't send the Authorization field at all.

irevoire avatar May 03 '22 18:05 irevoire

alright, I'll take this.

ghost avatar May 03 '22 18:05 ghost