Skip to content
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
2 changes: 0 additions & 2 deletions cmd/lint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ var vocabWords = []string{
"codec",
"config",
"configs",
"confluent-jdbc",
"consumer.config",
"couchbase",
"cpp",
Expand Down Expand Up @@ -250,7 +249,6 @@ var vocabWords = []string{
"io",
"ip",
"ips",
"jdbc",
"json",
"jit",
"jsonschema",
Expand Down
52 changes: 25 additions & 27 deletions pkg/flink/utils.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package flink

var (
ConnectionTypes = []string{"openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", "couchbase", "confluent-jdbc"}
ConnectionTypes = []string{"openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", "couchbase"}
ConnectionTypeSecretMapping = map[string][]string{
"openai": {"api-key"},
"azureml": {"api-key"},
"azureopenai": {"api-key"},
"bedrock": {"aws-access-key", "aws-secret-key", "aws-session-token"},
"sagemaker": {"aws-access-key", "aws-secret-key", "aws-session-token"},
"googleai": {"api-key"},
"vertexai": {"service-key"},
"mongodb": {"username", "password"},
"elastic": {"api-key"},
"pinecone": {"api-key"},
"couchbase": {"username", "password"},
"confluent-jdbc": {"username", "password"},
"openai": {"api-key"},
"azureml": {"api-key"},
"azureopenai": {"api-key"},
"bedrock": {"aws-access-key", "aws-secret-key", "aws-session-token"},
"sagemaker": {"aws-access-key", "aws-secret-key", "aws-session-token"},
"googleai": {"api-key"},
"vertexai": {"service-key"},
"mongodb": {"username", "password"},
"elastic": {"api-key"},
"pinecone": {"api-key"},
"couchbase": {"username", "password"},
}

ConnectionSecretTypeMapping = map[string][]string{
Expand All @@ -23,23 +22,22 @@ var (
"aws-secret-key": {"bedrock", "sagemaker"},
"aws-session-token": {"bedrock", "sagemaker"},
"service-key": {"vertexai"},
"username": {"mongodb", "couchbase", "confluent-jdbc"},
"password": {"mongodb", "couchbase", "confluent-jdbc"},
"username": {"mongodb", "couchbase"},
"password": {"mongodb", "couchbase"},
}

ConnectionRequiredSecretMapping = map[string][]string{
"openai": {"api-key"},
"azureml": {"api-key"},
"azureopenai": {"api-key"},
"bedrock": {"aws-access-key", "aws-secret-key"},
"sagemaker": {"aws-access-key", "aws-secret-key"},
"googleai": {"api-key"},
"vertexai": {"service-key"},
"mongodb": {"username", "password"},
"elastic": {"api-key"},
"pinecone": {"api-key"},
"couchbase": {"username", "password"},
"confluent-jdbc": {"username", "password"},
"openai": {"api-key"},
"azureml": {"api-key"},
"azureopenai": {"api-key"},
"bedrock": {"aws-access-key", "aws-secret-key"},
"sagemaker": {"aws-access-key", "aws-secret-key"},
"googleai": {"api-key"},
"vertexai": {"service-key"},
"mongodb": {"username", "password"},
"elastic": {"api-key"},
"pinecone": {"api-key"},
"couchbase": {"username", "password"},
}
ConnectionSecretBackendKeyMapping = map[string]string{
"api-key": "API_KEY",
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/output/flink/connection/create-help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Create Flink connection "my-connection" in AWS us-west-2 for OpenAPI with endpoi
Flags:
--cloud string REQUIRED: Specify the cloud provider as "aws", "azure", or "gcp".
--region string REQUIRED: Cloud region for Flink (use "confluent flink region list" to see all).
--type string REQUIRED: Specify the connection type as "openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", "couchbase", or "confluent-jdbc".
--type string REQUIRED: Specify the connection type as "openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", or "couchbase".
--endpoint string REQUIRED: Specify endpoint for the connection.
--api-key string Specify API key for the type: "openai", "azureml", "azureopenai", "googleai", "elastic", or "pinecone".
--aws-access-key string Specify access key for the type: "bedrock" or "sagemaker".
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
--service-key string Specify service key for the type: "vertexai".
--username string Specify username for the type: "mongodb", "couchbase", or "confluent-jdbc".
--password string Specify password for the type: "mongodb", "couchbase", or "confluent-jdbc".
--username string Specify username for the type: "mongodb" or "couchbase".
--password string Specify password for the type: "mongodb" or "couchbase".
--environment string Environment ID.
-o, --output string Specify the output format as "human", "json", or "yaml". (default "human")

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Error: invalid connection type OPENAI

Suggestions:
Specify the connection type as "openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", "couchbase", or "confluent-jdbc".
Specify the connection type as "openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", or "couchbase".
2 changes: 1 addition & 1 deletion test/fixtures/output/flink/connection/list-help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Flags:
--cloud string REQUIRED: Specify the cloud provider as "aws", "azure", or "gcp".
--region string REQUIRED: Cloud region for Flink (use "confluent flink region list" to see all).
--environment string Environment ID.
--type string Specify the connection type as "openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", "couchbase", or "confluent-jdbc".
--type string Specify the connection type as "openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", or "couchbase".
-o, --output string Specify the output format as "human", "json", or "yaml". (default "human")

Global Flags:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Error: invalid connection type invalid

Suggestions:
Specify the connection type as "openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", "couchbase", or "confluent-jdbc".
Specify the connection type as "openai", "azureml", "azureopenai", "bedrock", "sagemaker", "googleai", "vertexai", "mongodb", "elastic", "pinecone", or "couchbase".
4 changes: 2 additions & 2 deletions test/fixtures/output/flink/connection/update-help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Flags:
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
--service-key string Specify service key for the type: "vertexai".
--username string Specify username for the type: "mongodb", "couchbase", or "confluent-jdbc".
--password string Specify password for the type: "mongodb", "couchbase", or "confluent-jdbc".
--username string Specify username for the type: "mongodb" or "couchbase".
--password string Specify password for the type: "mongodb" or "couchbase".
--environment string Environment ID.
-o, --output string Specify the output format as "human", "json", or "yaml". (default "human")

Expand Down
1 change: 0 additions & 1 deletion test/flink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ func (s *CLITestSuite) TestFlinkConnectionCreateSuccess() {
{args: "flink connection create my-connection --cloud aws --region eu-west-1 --type elastic --endpoint https://api.openai.com/v1/chat/completions --api-key 0000000000000000", fixture: "flink/connection/create/create-elastic.golden"},
{args: "flink connection create my-connection --cloud aws --region eu-west-1 --type pinecone --endpoint https://api.openai.com/v1/chat/completions --api-key 0000000000000000", fixture: "flink/connection/create/create-pinecone.golden"},
{args: "flink connection create my-connection --cloud aws --region eu-west-1 --type couchbase --endpoint https://api.openai.com/v1/chat/completions --username name --password pass", fixture: "flink/connection/create/create-couchbase.golden"},
{args: "flink connection create my-connection --cloud aws --region eu-west-1 --type confluent-jdbc --endpoint jdbc:mysql://custom.com:3306/customerdb --username name --password pass", fixture: "flink/connection/create/create-confluent_jdbc.golden"},
}

for _, test := range tests {
Expand Down