mirror of https://github.com/FlowiseAI/Flowise.git
Merge pull request #1262 from tirongi/feature/elasticCustomURLBasicAuth
Enable inserting custom URL using basic authfeature/VectorStoreRevamp
commit
88060791b0
|
|
@ -11,8 +11,8 @@ class ElasticSearchUserPassword implements INodeCredential {
|
|||
this.label = 'ElasticSearch User Password'
|
||||
this.name = 'elasticSearchUserPassword'
|
||||
this.version = 1.0
|
||||
this.description =
|
||||
'Refer to <a target="_blank" href="https://www.elastic.co/guide/en/kibana/current/tutorial-secure-access-to-kibana.html">official guide</a> on how to get User Password from ElasticSearch'
|
||||
this.description = `Use Cloud ID field to enter your Elastic Cloud ID or the URL of the Elastic server instance.
|
||||
Refer to <a target="_blank" href="https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-up-authentication.html">official guide</a> on how to get User Password from ElasticSearch.`
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'Cloud ID',
|
||||
|
|
|
|||
|
|
@ -144,13 +144,26 @@ export abstract class ElasticSearchBase {
|
|||
} else if (cloudId) {
|
||||
let username = getCredentialParam('username', credentialData, nodeData)
|
||||
let password = getCredentialParam('password', credentialData, nodeData)
|
||||
elasticSearchClientOptions = {
|
||||
cloud: {
|
||||
id: cloudId
|
||||
},
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
if (cloudId.startsWith('http')) {
|
||||
elasticSearchClientOptions = {
|
||||
node: cloudId,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
tls: {
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
elasticSearchClientOptions = {
|
||||
cloud: {
|
||||
id: cloudId
|
||||
},
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue