Skip to content

Commit 6eb69fd

Browse files
authored
[MATRIX-1216] added basic auth support for mcp connections (#3220)
1 parent 98a1f8f commit 6eb69fd

12 files changed

+24
-23
lines changed

pkg/flink/utils.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var (
1717
"couchbase": {"username", "password"},
1818
"confluent_jdbc": {"username", "password"},
1919
"rest": {"username", "password", "token", "token-endpoint", "client-id", "client-secret", "scope"},
20-
"mcp_server": {"api-key", "token", "token-endpoint", "client-id", "client-secret", "scope", "sse-endpoint", "transport-type"},
20+
"mcp_server": {"username", "password", "api-key", "token", "token-endpoint", "client-id", "client-secret", "scope", "sse-endpoint", "transport-type"},
2121
}
2222

2323
ConnectionSecretTypeMapping = map[string][]string{
@@ -26,8 +26,8 @@ var (
2626
"aws-secret-key": {"bedrock", "sagemaker"},
2727
"aws-session-token": {"bedrock", "sagemaker"},
2828
"service-key": {"vertexai"},
29-
"username": {"mongodb", "couchbase", "confluent_jdbc", "a2a", "rest"},
30-
"password": {"mongodb", "couchbase", "confluent_jdbc", "a2a", "rest"},
29+
"username": {"mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", "mcp_server"},
30+
"password": {"mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", "mcp_server"},
3131
"token": {"a2a", "rest", "mcp_server"},
3232
"token-endpoint": {"a2a", "rest", "mcp_server"},
3333
"client-id": {"a2a", "rest", "mcp_server"},
@@ -58,7 +58,7 @@ var (
5858
ConnectionOneOfRequiredSecretsMapping = map[string][][]string{
5959
"a2a": {{"api-key"}, {"username", "password"}, {"token"}, {"token-endpoint", "client-id", "client-secret", "scope"}},
6060
"rest": {{"username", "password"}, {"token"}, {"token-endpoint", "client-id", "client-secret", "scope"}},
61-
"mcp_server": {{"api-key"}, {"token"}, {"token-endpoint", "client-id", "client-secret", "scope"}},
61+
"mcp_server": {{"api-key"}, {"username", "password"}, {"token"}, {"token-endpoint", "client-id", "client-secret", "scope"}},
6262
}
6363

6464
ConnectionSecretAllowedValues = map[string][]string{

test/fixtures/output/flink/connection/create-help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Flags:
1818
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
1919
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
2020
--service-key string Specify service key for the type: "vertexai".
21-
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
22-
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
21+
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
22+
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
2323
--token string Specify bearer token for the type: "a2a", "rest", or "mcp_server".
2424
--token-endpoint string Specify OAuth2 token endpoint for the type: "a2a", "rest", or "mcp_server".
2525
--client-id string Specify OAuth2 client ID for the type: "a2a", "rest", or "mcp_server".

test/fixtures/output/flink/connection/create/create-a2a-missing-required-secret.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Flags:
1717
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
1818
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
1919
--service-key string Specify service key for the type: "vertexai".
20-
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
21-
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
20+
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
21+
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
2222
--token string Specify bearer token for the type: "a2a", "rest", or "mcp_server".
2323
--token-endpoint string Specify OAuth2 token endpoint for the type: "a2a", "rest", or "mcp_server".
2424
--client-id string Specify OAuth2 client ID for the type: "a2a", "rest", or "mcp_server".

test/fixtures/output/flink/connection/create/create-a2a-mutually-exclusive-secret.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Flags:
1717
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
1818
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
1919
--service-key string Specify service key for the type: "vertexai".
20-
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
21-
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
20+
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
21+
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
2222
--token string Specify bearer token for the type: "a2a", "rest", or "mcp_server".
2323
--token-endpoint string Specify OAuth2 token endpoint for the type: "a2a", "rest", or "mcp_server".
2424
--client-id string Specify OAuth2 client ID for the type: "a2a", "rest", or "mcp_server".

test/fixtures/output/flink/connection/create/create-mcp_server-missing-required-secret.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Flags:
1717
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
1818
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
1919
--service-key string Specify service key for the type: "vertexai".
20-
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
21-
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
20+
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
21+
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
2222
--token string Specify bearer token for the type: "a2a", "rest", or "mcp_server".
2323
--token-endpoint string Specify OAuth2 token endpoint for the type: "a2a", "rest", or "mcp_server".
2424
--client-id string Specify OAuth2 client ID for the type: "a2a", "rest", or "mcp_server".

test/fixtures/output/flink/connection/create/create-mcp_server-mutually-exclusive-secret.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Flags:
1717
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
1818
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
1919
--service-key string Specify service key for the type: "vertexai".
20-
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
21-
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
20+
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
21+
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
2222
--token string Specify bearer token for the type: "a2a", "rest", or "mcp_server".
2323
--token-endpoint string Specify OAuth2 token endpoint for the type: "a2a", "rest", or "mcp_server".
2424
--client-id string Specify OAuth2 client ID for the type: "a2a", "rest", or "mcp_server".
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Error: no secrets provided for type mcp_server, one of the required secrets "[api-key]", "[token]", or "[token-endpoint client-id client-secret scope]" must be provided
1+
Error: no secrets provided for type mcp_server, one of the required secrets "[api-key]", "[username password]", "[token]", or "[token-endpoint client-id client-secret scope]" must be provided

test/fixtures/output/flink/connection/create/create-missing-required-secret.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Flags:
1717
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
1818
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
1919
--service-key string Specify service key for the type: "vertexai".
20-
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
21-
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
20+
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
21+
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
2222
--token string Specify bearer token for the type: "a2a", "rest", or "mcp_server".
2323
--token-endpoint string Specify OAuth2 token endpoint for the type: "a2a", "rest", or "mcp_server".
2424
--client-id string Specify OAuth2 client ID for the type: "a2a", "rest", or "mcp_server".

test/fixtures/output/flink/connection/create/create-rest-missing-required-secret.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Flags:
1717
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
1818
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
1919
--service-key string Specify service key for the type: "vertexai".
20-
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
21-
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
20+
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
21+
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
2222
--token string Specify bearer token for the type: "a2a", "rest", or "mcp_server".
2323
--token-endpoint string Specify OAuth2 token endpoint for the type: "a2a", "rest", or "mcp_server".
2424
--client-id string Specify OAuth2 client ID for the type: "a2a", "rest", or "mcp_server".

test/fixtures/output/flink/connection/create/create-rest-mutually-exclusive-secret.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Flags:
1717
--aws-secret-key string Specify secret key for the type: "bedrock" or "sagemaker".
1818
--aws-session-token string Specify session token for the type: "bedrock" or "sagemaker".
1919
--service-key string Specify service key for the type: "vertexai".
20-
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
21-
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", or "rest".
20+
--username string Specify username for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
21+
--password string Specify password for the type: "mongodb", "couchbase", "confluent_jdbc", "a2a", "rest", or "mcp_server".
2222
--token string Specify bearer token for the type: "a2a", "rest", or "mcp_server".
2323
--token-endpoint string Specify OAuth2 token endpoint for the type: "a2a", "rest", or "mcp_server".
2424
--client-id string Specify OAuth2 client ID for the type: "a2a", "rest", or "mcp_server".

0 commit comments

Comments
 (0)