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

Add replica indices to the secured api search key #316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JanMisker
Copy link

The api key generated via Algolia::searchKey is too restrictive, it only includes the primary index in its restrictIndices array. When using replicas for sorting with that key it fails, because the replicas are not included. This happens when sending the (secured) search key to a frontend javascript that only has one api key.

This change loads the replicas setting from the associated index config file and appends that to the restrictIndices.

There is probably a better way to load the config, I didn't dive that deep in the code. Perhaps it should be loaded from the remote index instead of via the local synced config file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant