app-search-reference-ui-react
app-search-reference-ui-react copied to clipboard
[Feature Request] Support SearchKey as an Environment Variable
Having the searchKey
in the clear in engine.json
is not the best approaches from a security point of view.
It would be great if the searchKey
can be read at runtime from an environment variable.
As an example the AppSearchAPIConnector
connector would be something like the following:
const connector = new AppSearchAPIConnector({
searchKey: process.env.REACT_APP_APPSEARCH_SEARCHKEY,
engineName,
hostIdentifier,
endpointBase
});
Would like to get your opinion on this before performing any work. Ready to submit a PR for this feature 😄
That's a good idea. We'd need to update the README to change the start command to include the environment variable. We'll also need to make the corresponding change in App Search, which could target 7.15.
Raised https://github.com/elastic/app-search-reference-ui-react/pull/83 for ReferenceUI. I'm not sure what changes are required in AppSearch to the download ZIP package feature.