forked from opensearch-project/sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Included Authenticators (opensearch-project#988)
Signed-off-by: vamsi-amazon <[email protected]>
- Loading branch information
Showing
31 changed files
with
708 additions
and
190 deletions.
There are no files selected for viewing
32 changes: 0 additions & 32 deletions
32
core/src/main/java/org/opensearch/sql/catalog/model/AbstractAuthenticationData.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
core/src/main/java/org/opensearch/sql/catalog/model/AuthenticationType.java
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
core/src/main/java/org/opensearch/sql/catalog/model/BasicAuthenticationData.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
core/src/main/java/org/opensearch/sql/catalog/model/auth/AuthenticationType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* | ||
* * Copyright OpenSearch Contributors | ||
* * SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package org.opensearch.sql.catalog.model.auth; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
public enum AuthenticationType { | ||
|
||
BASICAUTH("basicauth"), AWSSIGV4AUTH("awssigv4"); | ||
|
||
private String name; | ||
|
||
private static final Map<String, AuthenticationType> ENUM_MAP; | ||
|
||
AuthenticationType(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
static { | ||
Map<String, AuthenticationType> map = new HashMap<>(); | ||
for (AuthenticationType instance : AuthenticationType.values()) { | ||
map.put(instance.getName().toLowerCase(), instance); | ||
} | ||
ENUM_MAP = Collections.unmodifiableMap(map); | ||
} | ||
|
||
public static AuthenticationType get(String name) { | ||
return ENUM_MAP.get(name.toLowerCase()); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
core/src/main/java/org/opensearch/sql/storage/StorageEngineFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* | ||
* * Copyright OpenSearch Contributors | ||
* * SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package org.opensearch.sql.storage; | ||
|
||
import java.util.Map; | ||
import org.opensearch.sql.catalog.model.ConnectorType; | ||
|
||
public interface StorageEngineFactory { | ||
|
||
ConnectorType getConnectorType(); | ||
|
||
StorageEngine getStorageEngine(String catalogName, Map<String, String> requiredConfig); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.. highlight:: sh | ||
|
||
==================== | ||
Prometheus Connector | ||
==================== | ||
|
||
.. rubric:: Table of contents | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 1 | ||
|
||
|
||
Introduction | ||
============ | ||
|
||
This page covers prometheus connector properties for catalog configuration | ||
and the nuances associated with prometheus connector. | ||
|
||
|
||
Prometheus Connector Properties in Catalog Configuration | ||
======================================================== | ||
Prometheus Connector Properties. | ||
|
||
* ``prometheus.uri`` [Required]. | ||
* This parameters provides the URI information to connect to a prometheus instance. | ||
* ``prometheus.auth.type`` [Optional] | ||
* This parameters provides the authentication type information. | ||
* Prometheus connector currently supports ``basicauth`` and ``awssigv4`` authentication mechanisms. | ||
* If prometheus.auth.type is basicauth, following are required parameters. | ||
* ``prometheus.auth.username`` and ``prometheus.auth.password``. | ||
* If prometheus.auth.type is awssigv4, following are required parameters. | ||
* ``prometheus.auth.region``, ``prometheus.auth.access_key`` and ``prometheus.auth.secret_key`` | ||
|
||
Example prometheus catalog configuration with different authentications | ||
======================================================================= | ||
|
||
No Auth :: | ||
|
||
[{ | ||
"name" : "my_prometheus", | ||
"connector": "prometheus", | ||
"properties" : { | ||
"prometheus.uri" : "http://localhost:9090" | ||
} | ||
}] | ||
|
||
Basic Auth :: | ||
|
||
[{ | ||
"name" : "my_prometheus", | ||
"connector": "prometheus", | ||
"properties" : { | ||
"prometheus.uri" : "http://localhost:9090", | ||
"prometheus.auth.type" : "basicauth", | ||
"prometheus.auth.username" : "admin", | ||
"prometheus.auth.password" : "admin" | ||
} | ||
}] | ||
|
||
AWSSigV4 Auth:: | ||
|
||
[{ | ||
"name" : "my_prometheus", | ||
"connector": "prometheus", | ||
"properties" : { | ||
"prometheus.uri" : "http://localhost:8080", | ||
"prometheus.auth.type" : "awssigv4", | ||
"prometheus.auth.region" : "us-east-1", | ||
"prometheus.auth.access_key" : "{{accessKey}}" | ||
"prometheus.auth.secret_key" : "{{secretKey}}" | ||
} | ||
}] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.