Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tableau Connector to OpenSearch SQL #1

Merged
1 commit merged into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Created-By: 13 (Oracle Corporation)

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<connection-fields>
<field name="authentication" label="Authentication" category="authentication" value-type="selection" default-value="auth-user-pass">
<selection-group>
<option value="auth-none" label="No authentication"/>
<option value="auth-user-pass" label="Username and Password"/>
<option value="auth-integrated" label="AWS_SIGV4"/>
</selection-group>
</field>
<field name="server" label="Server" value-type="string" category="endpoint" default-value="localhost">
</field>
<field name="port" label="Port" value-type="string" category="endpoint" default-value="9200">
</field>
<field name="username" label="Username" category="authentication" value-type="string">
<conditions>
<condition field="authentication" value="auth-user-pass"/>
</conditions>
</field>
<field name="password" label="Password" category="authentication" value-type="string" secure="true">
<conditions>
<condition field="authentication" value="auth-user-pass"/>
</conditions>
</field>
<field name="v-region" label="Region" category="authentication" value-type="string" optional="true">
<conditions>
<condition field="authentication" value="auth-integrated"/>
</conditions>
</field>
<field name="sslmode" label="Use SSL" value-type="boolean" category="general" default-value="require">
<boolean-options>
<false-value value=""/>
<true-value value="require"/>
</boolean-options>
</field>
<field name="v-trustSelfSigned" label="Trust Self-Signed Certificate" value-type="boolean" category="general" default-value="false">
<conditions>
<condition field="authentication" value="auth-user-pass"/>
<condition field="authentication" value="auth-none"/>
</conditions>
<boolean-options>
<false-value value="false"/>
<true-value value="true"/>
</boolean-options>
</field>
</connection-fields>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<connection-metadata>
<database enabled='false' />
<schema enabled='false' />
<table enabled='true' label="Table" />
</connection-metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(function dsbuilder(attr){
var connStr = "jdbc:opensearch://";
// Set SSL value in connection string
if (attr[connectionHelper.attributeSSLMode] == "require"){
connStr += "https://";
} else {
connStr += "http://";
}

// Set host information in connection string
connStr += attr[connectionHelper.attributeServer] + ":" + attr[connectionHelper.attributePort] + "?";

// Set authentication values in connection string
var authAttrValue = attr[connectionHelper.attributeAuthentication];
if (authAttrValue == "auth-none"){
connStr += "auth=NONE&trustSelfSigned=" + attr["v-trustSelfSigned"];
} else if (authAttrValue == "auth-integrated"){
connStr += "auth=AWS_SIGV4";
var region = attr["v-region"];
if (region){
connStr += "&Region=" + region;
}
} else { //if (authAttrValue == "auth-user-pass"){
connStr += "auth=BASIC&user=" + attr[connectionHelper.attributeUsername] + "&password=" + attr[connectionHelper.attributePassword] + "&trustSelfSigned=" + attr["v-trustSelfSigned"];
}

return [connStr];
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version='1.0' encoding='utf-8' ?>
<tdr class='opensearch_jdbc'>
<connection-resolver>
<connection-builder>
<script file='connectionBuilder.js'/>
</connection-builder>
<connection-normalizer>
<required-attributes>
<default-attributes>
<default-attribute name='server'>localhost</default-attribute>
<default-attribute name='port'>9200</default-attribute>
</default-attributes>
<attribute-list>
<attr>server</attr>
<attr>port</attr>
<attr>authentication</attr>
<attr>username</attr>
<attr>password</attr>
<attr>sslmode</attr>
<attr>v-region</attr>
<attr>v-trustSelfSigned</attr>
</attribute-list>
</required-attributes>
</connection-normalizer>
</connection-resolver>
</tdr>
Loading