app-search-reference-ui-react icon indicating copy to clipboard operation
app-search-reference-ui-react copied to clipboard

[Feature Request] Support SearchKey as an Environment Variable

Open christophercutajar opened this issue 3 years ago • 2 comments

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 😄

christophercutajar avatar Jul 21 '21 13:07 christophercutajar

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.

JasonStoltz avatar Jul 21 '21 14:07 JasonStoltz

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.

christophercutajar avatar Jul 21 '21 15:07 christophercutajar