Authentication Layer #87
Replies: 19 comments
-
Excellent! Little idea/suggestion, would it be possible to implement It would mean "It requires a key, but it can be any of the existing keys" as in opposition to "no key required / public". I am not sure if this can have a logic implementation |
Beta Was this translation helpful? Give feedback.
-
@eskombro what would |
Beta Was this translation helpful? Give feedback.
-
@MarinPostma, something like:
|
Beta Was this translation helpful? Give feedback.
-
Meilisearch Authentication Layer with kongAfter several investigations on the possibility to use kong as meilisearch authentication layer, I write here some Pro&Con about it and what should we implement to use kong in production. Meilisearch needsAs an meilisearch admin I want to be able to create access-keys with custom rights/accesses on meilisearch (843) The authentication layer needs to support:
The authentication layer may support:
the authentication layer should be transparent for user and shouldn't make meilisearch installation difficult. Does kong fit the needs?
BUT:
About assuming to have a more complex architecture for authenticationFirst of all, here we will assume that user will install by himself kong. We can provide:
this permit to user to choose there authentication layer and have 1 authentication layer for all services, and in an other way it's easy to setup for meilisearch we don't have to provide and maintain an authentication layer which would be Pro&ConPro
Con
|
Beta Was this translation helpful? Give feedback.
-
Thank you for this review :) I have a three questions 1- What can we do if Kong have a state (postgres) and what can't we do? 2 - How the query params change might impact the developer using MeiliSearch? 3 - How much longer is the request when adding the Kong layer between the browser and the MeiliSearch server? |
Beta Was this translation helpful? Give feedback.
-
Hello @tpayet thanks for your questions 👍 1- What can we do if Kong have a state (postgres) and what can't we do?
2- How the query params change might impact the developer using MeiliSearch?
3 - How much longer is the request when adding the Kong layer between the browser and the MeiliSearch server?
|
Beta Was this translation helpful? Give feedback.
-
It has to be postgres or could it be sqlite ? |
Beta Was this translation helpful? Give feedback.
-
MeiliSearch + Kong + probably Postgres -> I think this really introduces a lot of complexity installing and configuring MeiliSearch. It would clearly fit all the needs we have, but it is maybe too hard on the simplicity we seek for MS install and launch :( |
Beta Was this translation helpful? Give feedback.
-
@bidoubiwa, sqlite is not compatible with kong, probably because sqlite make multithreding impossible. @eskombro I don't really know, it depends of which use case need to have a complete authentication layer and is it correlated to big architectures or not. |
Beta Was this translation helpful? Give feedback.
-
@eskombro It's perhaps something we can handle in a new repo |
Beta Was this translation helpful? Give feedback.
-
We use Ory stack in our applications for auth. https://www.ory.sh/ |
Beta Was this translation helpful? Give feedback.
-
It would also be awesome if Meilisearch could use an existing SSO setup (e.g. Keycloak). This would make it easier to integrate in enterprise environments. |
Beta Was this translation helpful? Give feedback.
-
+1 on Keycloak SSO. We've been using it on a couple projects, and that would be practical. I don't know if this is the best issue to flag this in, but since it's on the topic of authentication and keys, and since Meilisearch is inspired by Algolia... we would be very interested in a feature similar to Algolia's Secured API Keys. Right now the architecture we're considering involves proxying calls to Meilisearch through a server to filter based on a user ID, but Algolia's system which basically adds a filtering parameter to a specific key strikes me as a really elegant way to restrict access to certain data. |
Beta Was this translation helpful? Give feedback.
-
I like this issue and suggested solutions, I am working on a feature that would have private search functionality, each index would have a few thousand documents and I was hoping to be able to restrict index search to only people that should have access to search that index. Example:
|
Beta Was this translation helpful? Give feedback.
-
Hi @cabello, that would be great. In your example you mention 2 livestreams, any idea how this would perform if there where e.g. 1000 livestreams, with 500-5000 attendees each, and many attendees being scattered over multiple livestreams simultaneously? In other words, how would this perform if the key array gets bigger, with e.g. > 1000 keys per record? |
Beta Was this translation helpful? Give feedback.
-
I am using Algolia right now, this is how I structured the solution:
That has been working reasonably well for me. I know this might not answer your question, it really depends on the data model of the search provider in order to come up with a solution. What was important for me was:
|
Beta Was this translation helpful? Give feedback.
-
Hello @cabello! Thanks for your feedback! It helps a lot! FYI @gmourier |
Beta Was this translation helpful? Give feedback.
-
Hi everyone 👋! We're dusting off this conversation to share with you the proto-solutions we've come up with, we'd love to hear your feedback on it. |
Beta Was this translation helpful? Give feedback.
-
Hey everyone 👋 I'm locking that discussion since an auth layer was released a while ago. 📚https://docs.meilisearch.com/learn/security/master_api_keys.html#master-key-and-api-keys Please open a new discussion if needed so we can start fresh on a specific need. Thank you 🙇♂️ |
Beta Was this translation helpful? Give feedback.
-
Summary
Right now, Meilisearch only support very basic authentication with 3 authentication layers (public, private and admin) and 3 associated keys. Restriction are hard-coded for each route, statically defining what each user is allowed to see based on his privileges.
This tracking issue proposes extensions to what already exists to allow for more flexibility in the API authentication Layer of Meilisearch.
Motivations
This feature has been asked multiple times, and should address business requirements that our users may have.
Explanation
Only the master key will remain by default, and has R/W rights on everything.
It will be possible to generate other API keys and link them to permission on the engine.
routes already protected with
private
, will remain so by default on will only be accessible with the master key.The authentication layer will support:
Documentation
Protected Indexes
A new field is added to the index creation/update payload called
authorizedKeys
. It is an array of strings that defaults to[]
. An empty array means that no specific restriction are applied to the index. If the array is not empty, only keys in the array are authorized to perform actions on it.A call to
indexes
orindexes/:index_uid
returns the list of authorized keys for each index in the fieldauthorizedKeys
Trying to access an index with insufficient rights results in a
protected_index
error code andauthentication_error
error typeBeta Was this translation helpful? Give feedback.
All reactions