[英]Credentials for reactivesearch in Elasticsearch 8.x
I want to use reactivesearch without any appbase.io , but with a self-hosted dockerized Elasticsearch.我想在没有任何appbase.io的情况下使用响应式搜索,但要使用自托管的 dockerized Elasticsearch。
Elasticsearch 8.x seems to have a new concept of authorization. Elasticsearch 8.x 似乎有了一个新的授权概念。 I've installed ES and Kibana via docker regarding this security measures .
关于这个安全措施,我已经通过 docker 安装了 ES 和 Kibana。 Then, I created an API Key .
然后,我创建了一个API Key 。 I'm having no problems calling ES API with curl or Postman now, great!
我现在用 curl 或 Postman 调用 ES API 没有问题,太好了!
But, regarding these reactivesearch docs , connecting my VueJS ReactiveSearch App directly with ES is done with these lines:但是,关于这些响应式搜索文档,将我的 VueJS ReactiveSearch 应用程序直接与 ES 连接是通过以下几行完成的:
<template>
<div id="app">
<reactive-base
url="https://localhost:9200"
app="data1"
credentials="Authorization:ApiKey <Hashed API Key>"
enableAppbase="false"
>
<h1>Hello from ReactiveBase 👋</h1>
</reactive-base>
</div>
</template>
url should be my ES Cluster URL url应该是我的 ES Cluster URL
app should be the index app应该是索引
credentials is unclear to me我不清楚凭据
As you see, I tried to put the API Authrorization in there.如您所见,我试图将 API 授权放在那里。 The documentation seems to suggest, that it should be "username:password".
文档似乎建议,它应该是“用户名:密码”。 The app itself renders nothing and returns a blank page.
该应用程序本身不呈现任何内容并返回一个空白页面。 So, no debugging possible.
因此,无法进行调试。
Any ideas how to authorize ReactiveBase against a self-hosted docker ElasticSearch?任何想法如何针对自托管的 docker ElasticSearch 授权 ReactiveBase?
I ran into the same problem.我遇到了同样的问题。 What I worked out was that the credentials prop in the
<ReactiveBase>
component is not needed, and to manually set the Authorization in the headers prop:我得出的结论是不需要
<ReactiveBase>
组件中的凭据道具,并在 headers 道具中手动设置授权:
headers={{
Authorization: "Bearer private-asdasdfadfasdf123123"
}}
Also, it looks like you may have <reactive-base>
incorrectly defined.此外,您的
<reactive-base>
似乎定义不正确。 What I have is <ReactiveBase>
.我所拥有的是
<ReactiveBase>
。
Ref: https://docs.appbase.io/docs/reactivesearch/v3/overview/reactivebase/参考: https ://docs.appbase.io/docs/reactivesearch/v3/overview/reactivebase/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.