Skip to content

Commit b0568dc

Browse files
committed
MLE-24829 Fixing cloud auth for 1.11.1 release
1 parent 92e91ce commit b0568dc

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

docs/configuring-the-connector.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ Regardless of the required authentication strategy, you must configure the follo
4747
- `ml.connection.port` = the port of the MarkLogic app server you wish to connect to
4848
- `ml.connection.securityContextType` = the authentication strategy required by the MarkLogic app server; defaults to DIGEST
4949

50-
The choices for `ml.connection.securityContextType` are DIGEST, BASIC, CERTIFICATE, KERBEROS, and NONE. The additional
51-
properties required for each are described in the following sections.
50+
The choices for `ml.connection.securityContextType` are `DIGEST`, `BASIC`, `CERTIFICATE`, `KERBEROS`, `CLOUD`, and
51+
`NONE`. The additional properties required for each are described in the following sections.
5252

5353
### Configuring digest and basic authentication
5454

@@ -61,6 +61,7 @@ Both digest and basic authentication require the following properties to be conf
6161

6262
Progress Data Cloud authentication requires the following properties to be configured:
6363

64+
- `ml.connection.securityContextType=CLOUD`
6465
- `ml.connection.basePath` = the base path in your Progress Data Cloud instance that points to the REST API server you
6566
wish to connect to
6667
- `ml.connection.cloudApiKey` = the API key for authenticating with your Progress Data Cloud instance
@@ -71,13 +72,15 @@ You should also set `ml.connection.port` to 443 for connecting to Progress Data
7172

7273
Certificate authentication requires the following properties to be configured:
7374

75+
- `ml.connection.securityContextType=CERTIFICATE`
7476
- `ml.connection.certFile` = path to a PKCS12 certificate file
7577
- `ml.connection.certPassword` = password for the PKCS12 certificate file
7678

7779
### Configuring Kerberos authentication
7880

7981
Kerberos authentication requires the following property to be configured:
8082

83+
- `ml.connection.securityContextType=KERBEROS`
8184
- `ml.connection.externalName` = the name of the principal to be used in Kerberos authentication
8285

8386
### Configuring no authentication

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.marklogic
2-
version=1.11.0
2+
version=1.11.1
33

44
# For the Confluent Connector Archive
55
componentOwner=marklogic

src/main/java/com/marklogic/kafka/connect/MarkLogicConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class MarkLogicConfig extends AbstractConfig {
3535
public static final String SSL_HOST_VERIFIER = "ml.connection.customSsl.hostNameVerifier";
3636
public static final String SSL_MUTUAL_AUTH = "ml.connection.customSsl.mutualAuth";
3737

38-
private static final CustomRecommenderAndValidator CONNECTION_SECURITY_CONTEXT_TYPE_RV = new CustomRecommenderAndValidator("DIGEST", "BASIC", "CERTIFICATE", "KERBEROS", "NONE");
38+
private static final CustomRecommenderAndValidator CONNECTION_SECURITY_CONTEXT_TYPE_RV = new CustomRecommenderAndValidator("DIGEST", "BASIC", "CERTIFICATE", "KERBEROS", "CLOUD", "NONE");
3939
private static final CustomRecommenderAndValidator CONNECTION_TYPE_RV = new CustomRecommenderAndValidator("DIRECT", "GATEWAY", "");
4040
private static final CustomRecommenderAndValidator SSL_HOST_VERIFIER_RV = new CustomRecommenderAndValidator("ANY", "COMMON", "STRICT");
4141

@@ -73,7 +73,7 @@ public static void addDefinitions(ConfigDef configDef) {
7373
"External name for 'KERBEROS' authentication",
7474
GROUP, -1, ConfigDef.Width.MEDIUM, "Kerberos External Name")
7575
.define(CONNECTION_CLOUD_API_KEY, Type.STRING, null, Importance.MEDIUM,
76-
"API key for connecting to MarkLogic Cloud. Should set port to 443 when connecting to MarkLogic Cloud.",
76+
"API key for connecting to Progress Data Cloud. Should set port to 443 when connecting to Progress Data Cloud.",
7777
GROUP, -1, ConfigDef.Width.MEDIUM, "Cloud API Key")
7878
.define(CONNECTION_TYPE, Type.STRING, "", CONNECTION_TYPE_RV, Importance.MEDIUM,
7979
"Set to 'GATEWAY' when the host identified by ml.connection.host is a load balancer. See https://docs.marklogic.com/guide/java/data-movement#id_26583 for more information.",

src/test/java/com/marklogic/kafka/connect/BuildDatabaseClientConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void testInvalidAuthentication() {
182182
securityContextConfig.put(MarkLogicSinkConfig.CONNECTION_SECURITY_CONTEXT_TYPE, "IncorrectValue");
183183
ConfigException ex = assertThrows(ConfigException.class, () -> MarkLogicSinkConfig.CONFIG_DEF.parse(securityContextConfig),
184184
"Should throw ConfigException when an invalid authentication type is provided.");
185-
assertEquals("Invalid value: IncorrectValue; must be one of: [DIGEST, BASIC, CERTIFICATE, KERBEROS, NONE]", ex.getMessage());
185+
assertEquals("Invalid value: IncorrectValue; must be one of: [DIGEST, BASIC, CERTIFICATE, KERBEROS, CLOUD, NONE]", ex.getMessage());
186186
}
187187

188188
@Test

src/test/java/com/marklogic/kafka/connect/source/ReadRowsViaOpticDslTest.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
import java.util.List;
1212
import java.util.Map;
1313

14-
import static org.junit.jupiter.api.Assertions.assertEquals;
15-
import static org.junit.jupiter.api.Assertions.assertNull;
16-
import static org.junit.jupiter.api.Assertions.assertTrue;
14+
import static org.junit.jupiter.api.Assertions.*;
1715

1816
class ReadRowsViaOpticDslTest extends AbstractIntegrationSourceTest {
1917

@@ -46,6 +44,23 @@ void readFifteenAuthorsAsJson() throws InterruptedException {
4644
verifyRecordKeysAreSetToIDColumn(records);
4745
}
4846

47+
@Test
48+
void cloudAuth() {
49+
RuntimeException ex = assertThrows(RuntimeException.class, () -> startSourceTask(
50+
MarkLogicSourceConfig.CONNECTION_SECURITY_CONTEXT_TYPE, "cloud",
51+
MarkLogicSourceConfig.CONNECTION_CLOUD_API_KEY, "abc123",
52+
MarkLogicSourceConfig.DSL_QUERY, AUTHORS_ORDERED_BY_ID_OPTIC_DSL,
53+
MarkLogicSourceConfig.TOPIC, AUTHORS_TOPIC,
54+
MarkLogicSourceConfig.KEY_COLUMN, "Medical.Authors.ID"
55+
));
56+
57+
String message = ex.getMessage();
58+
assertTrue(message.contains("Unable to call token endpoint"),
59+
"We expect this test to fail because it can't talk to PDC, and that's fine. What this verifies " +
60+
"is that the user can configure the connector to talk to PDC - i.e. 'cloud' is accepted as a " +
61+
"security context type. Actual error: " + message);
62+
}
63+
4964
@Test
5065
void includeColumnTypes() throws InterruptedException {
5166
loadFifteenAuthorsIntoMarkLogic();

0 commit comments

Comments
 (0)