Merge pull request #1262 from tirongi/feature/elasticCustomURLBasicAuth

Enable inserting custom URL  using basic auth
feature/VectorStoreRevamp
Henry Heng 2023-11-21 23:37:19 +00:00 committed by GitHub
commit 88060791b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 9 deletions

View File

@ -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',

View File

@ -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
}
}
}
}