From 7191e26a031daad552c160bf126e2ae45e559391 Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 13 Aug 2024 14:44:13 -0400 Subject: [PATCH] DOCSP-42514: kotlin user/pass placeholders --- examples/src/test/kotlin/AuthTest.kt | 12 ++++----- .../src/test/kotlin/EnterpriseAuthTest.kt | 25 ++++++++++--------- .../test/kotlin/MongoClientSettingsTest.kt | 2 +- source/connection-troubleshooting.txt | 2 +- .../AuthTest.snippet.default-cred-string.kt | 2 +- .../AuthTest.snippet.default-mongo-cred.kt | 2 +- .../AuthTest.snippet.scram-sha-1-cred.kt | 2 +- .../AuthTest.snippet.scram-sha-1-string.kt | 2 +- .../AuthTest.snippet.scram-sha-256-cred.kt | 2 +- .../AuthTest.snippet.scram-sha-256-string.kt | 2 +- .../AuthTest.snippet.x-509-string.kt | 2 +- ...priseAuthTest.snippet.auth-creds-gssapi.kt | 2 +- ...thTest.snippet.gssapi-connection-string.kt | 2 +- ...pet.gssapi-properties-connection-string.kt | 2 +- ...rpriseAuthTest.snippet.java-subject-key.kt | 2 +- ...hTest.snippet.kerberos-subject-provider.kt | 2 +- ...AuthTest.snippet.ldap-connection-string.kt | 2 +- ...eAuthTest.snippet.ldap-mongo-credential.kt | 2 +- ...st.snippet.oidc-azure-connection-string.kt | 2 +- ...eAuthTest.snippet.oidc-azure-credential.kt | 2 +- ...Test.snippet.oidc-gcp-connection-string.kt | 2 +- ...iseAuthTest.snippet.oidc-gcp-credential.kt | 2 +- ...rpriseAuthTest.snippet.service-name-key.kt | 2 +- ...t.snippet.chain-order-connection-string.kt | 2 +- source/fundamentals/auth.txt | 12 ++++----- source/fundamentals/connection/connect.txt | 2 +- source/fundamentals/enterprise-auth.txt | 6 ++--- 27 files changed, 51 insertions(+), 50 deletions(-) diff --git a/examples/src/test/kotlin/AuthTest.kt b/examples/src/test/kotlin/AuthTest.kt index 70272c94..47e70ab5 100644 --- a/examples/src/test/kotlin/AuthTest.kt +++ b/examples/src/test/kotlin/AuthTest.kt @@ -47,7 +47,7 @@ internal class AuthTest { fun defaultConnectionStringTest() = runBlocking { // :replace-start: { // "terms": { - // "CONNECTION_URI_PLACEHOLDER": "\"mongodb://:@:/?authSource=\"" + // "CONNECTION_URI_PLACEHOLDER": "\"mongodb://:@:/?authSource=\"" // } // } // :snippet-start: default-cred-string @@ -70,7 +70,7 @@ internal class AuthTest { fun scramSha256ConnectionStringTest() = runBlocking { // :replace-start: { // "terms": { - // "CONNECTION_URI_PLACEHOLDER": "\"mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-256\"" + // "CONNECTION_URI_PLACEHOLDER": "\"mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-256\"" // } // } // :snippet-start: scram-sha-256-string @@ -93,7 +93,7 @@ internal class AuthTest { fun scramSha1ConnectionStringTest() = runBlocking { // :replace-start: { // "terms": { - // "CONNECTION_URI_PLACEHOLDER": "\"mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-1\"" + // "CONNECTION_URI_PLACEHOLDER": "\"mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-1\"" // } // } // :snippet-start: scram-sha-1-string @@ -116,7 +116,7 @@ internal class AuthTest { fun x509ConnectionStringTest() = runBlocking { // :replace-start: { // "terms": { - // "CONNECTION_URI_PLACEHOLDER": "\"mongodb://:@:/?authSource=&authMechanism=MONGODB-X509&tls=true\"" + // "CONNECTION_URI_PLACEHOLDER": "\"mongodb://:@:/?authSource=&authMechanism=MONGODB-X509&tls=true\"" // } // } // :snippet-start: x-509-string @@ -137,8 +137,8 @@ internal class AuthTest { // :replace-start: { // "terms": { - // "USERNAME": "\"\"", - // "PASSWORD": "\"\"", + // "USERNAME": "\"\"", + // "PASSWORD": "\"\"", // "AUTH_DB": "\"\"", // "HOSTNAME": "\"\"", // "PORT": "\"\"" diff --git a/examples/src/test/kotlin/EnterpriseAuthTest.kt b/examples/src/test/kotlin/EnterpriseAuthTest.kt index c30ee505..3a955484 100644 --- a/examples/src/test/kotlin/EnterpriseAuthTest.kt +++ b/examples/src/test/kotlin/EnterpriseAuthTest.kt @@ -13,6 +13,7 @@ import javax.naming.Context import javax.security.auth.Subject import javax.security.auth.login.LoginContext import kotlin.test.Ignore + // :replace-start: { // "terms": { // "PORT": "", @@ -36,7 +37,7 @@ internal class EnterpriseAuthTest { fun createGSSAPICred() = runBlocking { // :snippet-start: auth-creds-gssapi - val credential = MongoCredential.createGSSAPICredential("") + val credential = MongoCredential.createGSSAPICredential("") val settings = MongoClientSettings.builder() .applyToClusterSettings { builder -> @@ -51,7 +52,7 @@ internal class EnterpriseAuthTest { fun serviceNameKey() = runBlocking { // :snippet-start: service-name-key - val credential = MongoCredential.createGSSAPICredential("") + val credential = MongoCredential.createGSSAPICredential("") .withMechanismProperty(MongoCredential.SERVICE_NAME_KEY, "myService") // :snippet-end: } @@ -62,7 +63,7 @@ internal class EnterpriseAuthTest { loginContext.login() val subject: Subject = loginContext.subject - val credential = MongoCredential.createGSSAPICredential("") + val credential = MongoCredential.createGSSAPICredential("") .withMechanismProperty(MongoCredential.JAVA_SUBJECT_KEY, subject) // :snippet-end: } @@ -74,7 +75,7 @@ internal class EnterpriseAuthTest { val myLoginContext = "myContext" /* Login context defaults to "com.sun.security.jgss.krb5.initiate" if unspecified in KerberosSubjectProvider */ - val credential = MongoCredential.createGSSAPICredential("") + val credential = MongoCredential.createGSSAPICredential("") .withMechanismProperty( MongoCredential.JAVA_SUBJECT_PROVIDER_KEY, KerberosSubjectProvider(myLoginContext) @@ -84,7 +85,7 @@ internal class EnterpriseAuthTest { fun ldapCredential() = runBlocking { // :snippet-start: ldap-mongo-credential - val credential = MongoCredential.createPlainCredential("", "$external", "".toCharArray()) + val credential = MongoCredential.createPlainCredential("", "$external", "".toCharArray()) val settings = MongoClientSettings.builder() .applyToClusterSettings { builder -> @@ -99,21 +100,21 @@ internal class EnterpriseAuthTest { fun gssapiConnectionString() = runBlocking { // :snippet-start: gssapi-connection-string - val connectionString = ConnectionString("@:/?authSource=$external&authMechanism=GSSAPI") + val connectionString = ConnectionString("@:/?authSource=$external&authMechanism=GSSAPI") val mongoClient = MongoClient.create(connectionString) // :snippet-end: } fun gssapiPropertiesConnectionString() = runBlocking { // :snippet-start: gssapi-properties-connection-string - val connectionString = ConnectionString("@:/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService") + val connectionString = ConnectionString("@:/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService") val mongoClient = MongoClient.create(connectionString) // :snippet-end: } fun ldapConnectionString() = runBlocking { // :snippet-start: ldap-connection-string - val connectionString = ConnectionString(":@:/?authSource=$external&authMechanism=PLAIN") + val connectionString = ConnectionString(":@:/?authSource=$external&authMechanism=PLAIN") val mongoClient = MongoClient.create(connectionString) // :snippet-end: } @@ -121,7 +122,7 @@ internal class EnterpriseAuthTest { fun oidcAzureConnectionString() = runBlocking { // :snippet-start: oidc-azure-connection-string val connectionString = ConnectionString( - "mongodb://@:/?" + + "mongodb://@:/?" + "?authMechanism=MONGODB-OIDC" + "&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:") val mongoClient = MongoClient.create(connectionString) @@ -130,7 +131,7 @@ internal class EnterpriseAuthTest { fun oidcAzureCredential() = runBlocking { // :snippet-start: oidc-azure-credential - val credential = MongoCredential.createOidcCredential("") + val credential = MongoCredential.createOidcCredential("") .withMechanismProperty("ENVIRONMENT", "azure") .withMechanismProperty("TOKEN_RESOURCE", "") @@ -147,7 +148,7 @@ internal class EnterpriseAuthTest { fun oidcGCPConnectionString() = runBlocking { // :snippet-start: oidc-gcp-connection-string val connectionString = ConnectionString( - "mongodb://:/?" + + "mongodb://@:/?" + "authMechanism=MONGODB-OIDC" + "&authMechanismProperties=ENVIRONMENT:gcp,TOKEN_RESOURCE:") val mongoClient = MongoClient.create(connectionString) @@ -156,7 +157,7 @@ internal class EnterpriseAuthTest { fun oidcGCPCredential() = runBlocking { // :snippet-start: oidc-gcp-credential - val credential = MongoCredential.createOidcCredential("") + val credential = MongoCredential.createOidcCredential("") .withMechanismProperty("ENVIRONMENT", "gcp") .withMechanismProperty("TOKEN_RESOURCE", "") diff --git a/examples/src/test/kotlin/MongoClientSettingsTest.kt b/examples/src/test/kotlin/MongoClientSettingsTest.kt index ceff28d8..b8d8de9d 100644 --- a/examples/src/test/kotlin/MongoClientSettingsTest.kt +++ b/examples/src/test/kotlin/MongoClientSettingsTest.kt @@ -16,7 +16,7 @@ import kotlin.test.Ignore // :replace-start: { // "terms": { // "uri": "\"\"", -// "uriString": "\"mongodb+srv:/:@:?connectTimeoutMS(2000)\"", +// "uriString": "\"mongodb+srv:/:@:?connectTimeoutMS(2000)\"", // "uriAcmeString": "\"mongodb+srv://host1.acme.com\"" // } // } diff --git a/source/connection-troubleshooting.txt b/source/connection-troubleshooting.txt index a6098d4a..1d2d7e2b 100644 --- a/source/connection-troubleshooting.txt +++ b/source/connection-troubleshooting.txt @@ -127,7 +127,7 @@ database: :copyable: false val mongoClient = - MongoClient.create("mongodb://:@:/?authSource=users") + MongoClient.create("mongodb://:@:/?authSource=users") .. _kotlin-error-sending-message: diff --git a/source/examples/generated/AuthTest.snippet.default-cred-string.kt b/source/examples/generated/AuthTest.snippet.default-cred-string.kt index f766df60..248c6bdc 100644 --- a/source/examples/generated/AuthTest.snippet.default-cred-string.kt +++ b/source/examples/generated/AuthTest.snippet.default-cred-string.kt @@ -1,2 +1,2 @@ val mongoClient = - MongoClient.create("mongodb://:@:/?authSource=") + MongoClient.create("mongodb://:@:/?authSource=") diff --git a/source/examples/generated/AuthTest.snippet.default-mongo-cred.kt b/source/examples/generated/AuthTest.snippet.default-mongo-cred.kt index 49f6fe47..19cfdc69 100644 --- a/source/examples/generated/AuthTest.snippet.default-mongo-cred.kt +++ b/source/examples/generated/AuthTest.snippet.default-mongo-cred.kt @@ -1,5 +1,5 @@ val credential = MongoCredential.createCredential( - "", "", "".toCharArray() + "", "", "".toCharArray() ) val settings = MongoClientSettings.builder() .applyToClusterSettings { builder: ClusterSettings.Builder -> diff --git a/source/examples/generated/AuthTest.snippet.scram-sha-1-cred.kt b/source/examples/generated/AuthTest.snippet.scram-sha-1-cred.kt index 774c5d8e..9db847d6 100644 --- a/source/examples/generated/AuthTest.snippet.scram-sha-1-cred.kt +++ b/source/examples/generated/AuthTest.snippet.scram-sha-1-cred.kt @@ -1,5 +1,5 @@ val credential = MongoCredential.createScramSha1Credential( - "", "", "".toCharArray() + "", "", "".toCharArray() ) val settings = MongoClientSettings.builder() .applyToClusterSettings { builder: ClusterSettings.Builder -> diff --git a/source/examples/generated/AuthTest.snippet.scram-sha-1-string.kt b/source/examples/generated/AuthTest.snippet.scram-sha-1-string.kt index 5eebaa06..e2e0ff14 100644 --- a/source/examples/generated/AuthTest.snippet.scram-sha-1-string.kt +++ b/source/examples/generated/AuthTest.snippet.scram-sha-1-string.kt @@ -1,2 +1,2 @@ val mongoClient = - MongoClient.create("mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-1") + MongoClient.create("mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-1") diff --git a/source/examples/generated/AuthTest.snippet.scram-sha-256-cred.kt b/source/examples/generated/AuthTest.snippet.scram-sha-256-cred.kt index b7f49371..ad480671 100644 --- a/source/examples/generated/AuthTest.snippet.scram-sha-256-cred.kt +++ b/source/examples/generated/AuthTest.snippet.scram-sha-256-cred.kt @@ -1,5 +1,5 @@ val credential = MongoCredential.createScramSha256Credential( - "", "", "".toCharArray() + "", "", "".toCharArray() ) val settings = MongoClientSettings.builder() .applyToClusterSettings { builder: ClusterSettings.Builder -> diff --git a/source/examples/generated/AuthTest.snippet.scram-sha-256-string.kt b/source/examples/generated/AuthTest.snippet.scram-sha-256-string.kt index 43ae188c..36d38fcd 100644 --- a/source/examples/generated/AuthTest.snippet.scram-sha-256-string.kt +++ b/source/examples/generated/AuthTest.snippet.scram-sha-256-string.kt @@ -1,2 +1,2 @@ val mongoClient = - MongoClient.create("mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-256") + MongoClient.create("mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-256") diff --git a/source/examples/generated/AuthTest.snippet.x-509-string.kt b/source/examples/generated/AuthTest.snippet.x-509-string.kt index fcdfb9b5..04fffb88 100644 --- a/source/examples/generated/AuthTest.snippet.x-509-string.kt +++ b/source/examples/generated/AuthTest.snippet.x-509-string.kt @@ -1,2 +1,2 @@ val mongoClient = - MongoClient.create("mongodb://:@:/?authSource=&authMechanism=MONGODB-X509&tls=true") + MongoClient.create("mongodb://:@:/?authSource=&authMechanism=MONGODB-X509&tls=true") diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.auth-creds-gssapi.kt b/source/examples/generated/EnterpriseAuthTest.snippet.auth-creds-gssapi.kt index ec8405b3..d665ddd7 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.auth-creds-gssapi.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.auth-creds-gssapi.kt @@ -1,4 +1,4 @@ -val credential = MongoCredential.createGSSAPICredential("") +val credential = MongoCredential.createGSSAPICredential("") val settings = MongoClientSettings.builder() .applyToClusterSettings { builder -> diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.gssapi-connection-string.kt b/source/examples/generated/EnterpriseAuthTest.snippet.gssapi-connection-string.kt index 0616d580..a39f8c41 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.gssapi-connection-string.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.gssapi-connection-string.kt @@ -1,2 +1,2 @@ -val connectionString = ConnectionString("@:/?authSource=$external&authMechanism=GSSAPI") +val connectionString = ConnectionString("@:/?authSource=$external&authMechanism=GSSAPI") val mongoClient = MongoClient.create(connectionString) diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.gssapi-properties-connection-string.kt b/source/examples/generated/EnterpriseAuthTest.snippet.gssapi-properties-connection-string.kt index c0974bd0..13c58ed7 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.gssapi-properties-connection-string.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.gssapi-properties-connection-string.kt @@ -1,2 +1,2 @@ -val connectionString = ConnectionString("@:/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService") +val connectionString = ConnectionString("@:/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService") val mongoClient = MongoClient.create(connectionString) diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.java-subject-key.kt b/source/examples/generated/EnterpriseAuthTest.snippet.java-subject-key.kt index f2847181..659970c0 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.java-subject-key.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.java-subject-key.kt @@ -2,5 +2,5 @@ val loginContext = LoginContext("") loginContext.login() val subject: Subject = loginContext.subject -val credential = MongoCredential.createGSSAPICredential("") +val credential = MongoCredential.createGSSAPICredential("") .withMechanismProperty(MongoCredential.JAVA_SUBJECT_KEY, subject) diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.kerberos-subject-provider.kt b/source/examples/generated/EnterpriseAuthTest.snippet.kerberos-subject-provider.kt index 2687d2e0..018dd14f 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.kerberos-subject-provider.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.kerberos-subject-provider.kt @@ -3,7 +3,7 @@ will share a Kerberos ticket cache */ val myLoginContext = "myContext" /* Login context defaults to "com.sun.security.jgss.krb5.initiate" if unspecified in KerberosSubjectProvider */ -val credential = MongoCredential.createGSSAPICredential("") +val credential = MongoCredential.createGSSAPICredential("") .withMechanismProperty( MongoCredential.JAVA_SUBJECT_PROVIDER_KEY, KerberosSubjectProvider(myLoginContext) diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.ldap-connection-string.kt b/source/examples/generated/EnterpriseAuthTest.snippet.ldap-connection-string.kt index c9b40c3f..0d344579 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.ldap-connection-string.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.ldap-connection-string.kt @@ -1,2 +1,2 @@ -val connectionString = ConnectionString(":@:/?authSource=$external&authMechanism=PLAIN") +val connectionString = ConnectionString(":@:/?authSource=$external&authMechanism=PLAIN") val mongoClient = MongoClient.create(connectionString) diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.ldap-mongo-credential.kt b/source/examples/generated/EnterpriseAuthTest.snippet.ldap-mongo-credential.kt index 7e769935..9e736a4b 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.ldap-mongo-credential.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.ldap-mongo-credential.kt @@ -1,4 +1,4 @@ -val credential = MongoCredential.createPlainCredential("", "$external", "".toCharArray()) +val credential = MongoCredential.createPlainCredential("", "$external", "".toCharArray()) val settings = MongoClientSettings.builder() .applyToClusterSettings { builder -> diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.oidc-azure-connection-string.kt b/source/examples/generated/EnterpriseAuthTest.snippet.oidc-azure-connection-string.kt index d73b0f59..44c940c5 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.oidc-azure-connection-string.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.oidc-azure-connection-string.kt @@ -1,5 +1,5 @@ val connectionString = ConnectionString( - "mongodb://@:/?" + + "mongodb://@:/?" + "?authMechanism=MONGODB-OIDC" + "&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:") val mongoClient = MongoClient.create(connectionString) diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.oidc-azure-credential.kt b/source/examples/generated/EnterpriseAuthTest.snippet.oidc-azure-credential.kt index cad36ee2..c9ea75b9 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.oidc-azure-credential.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.oidc-azure-credential.kt @@ -1,4 +1,4 @@ -val credential = MongoCredential.createOidcCredential("") +val credential = MongoCredential.createOidcCredential("") .withMechanismProperty("ENVIRONMENT", "azure") .withMechanismProperty("TOKEN_RESOURCE", "") diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.oidc-gcp-connection-string.kt b/source/examples/generated/EnterpriseAuthTest.snippet.oidc-gcp-connection-string.kt index 874c7bfe..fc02caf1 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.oidc-gcp-connection-string.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.oidc-gcp-connection-string.kt @@ -1,5 +1,5 @@ val connectionString = ConnectionString( - "mongodb://:/?" + + "mongodb://@:/?" + "authMechanism=MONGODB-OIDC" + "&authMechanismProperties=ENVIRONMENT:gcp,TOKEN_RESOURCE:") val mongoClient = MongoClient.create(connectionString) diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.oidc-gcp-credential.kt b/source/examples/generated/EnterpriseAuthTest.snippet.oidc-gcp-credential.kt index 3a2d0782..ba27712b 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.oidc-gcp-credential.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.oidc-gcp-credential.kt @@ -1,4 +1,4 @@ -val credential = MongoCredential.createOidcCredential("") +val credential = MongoCredential.createOidcCredential("") .withMechanismProperty("ENVIRONMENT", "gcp") .withMechanismProperty("TOKEN_RESOURCE", "") diff --git a/source/examples/generated/EnterpriseAuthTest.snippet.service-name-key.kt b/source/examples/generated/EnterpriseAuthTest.snippet.service-name-key.kt index fa1991c3..6ecedb92 100644 --- a/source/examples/generated/EnterpriseAuthTest.snippet.service-name-key.kt +++ b/source/examples/generated/EnterpriseAuthTest.snippet.service-name-key.kt @@ -1,2 +1,2 @@ -val credential = MongoCredential.createGSSAPICredential("") +val credential = MongoCredential.createGSSAPICredential("") .withMechanismProperty(MongoCredential.SERVICE_NAME_KEY, "myService") diff --git a/source/examples/generated/MongoClientSettingsTest.snippet.chain-order-connection-string.kt b/source/examples/generated/MongoClientSettingsTest.snippet.chain-order-connection-string.kt index 042fa21b..b3f89a4b 100644 --- a/source/examples/generated/MongoClientSettingsTest.snippet.chain-order-connection-string.kt +++ b/source/examples/generated/MongoClientSettingsTest.snippet.chain-order-connection-string.kt @@ -1,6 +1,6 @@ val mongoClient = MongoClient.create( MongoClientSettings.builder() - .applyConnectionString(ConnectionString("mongodb+srv:/:@:?connectTimeoutMS(2000)")) + .applyConnectionString(ConnectionString("mongodb+srv:/:@:?connectTimeoutMS(2000)")) .applyToSocketSettings{ builder -> builder.connectTimeout(5, TimeUnit.SECONDS) } diff --git a/source/fundamentals/auth.txt b/source/fundamentals/auth.txt index 2404ecdc..a2372f76 100644 --- a/source/fundamentals/auth.txt +++ b/source/fundamentals/auth.txt @@ -63,8 +63,8 @@ which they advertise support. The following code snippets show how to specify the authentication mechanism, using the following placeholders: -* ``username`` - your MongoDB username -* ``password`` - your MongoDB user's password +* ``db_username`` - your MongoDB database username +* ``db_password`` - your MongoDB database user's password * ``hostname`` - network address of your MongoDB server, accessible by your client * ``port`` - port number of your MongoDB server * ``authenticationDb`` - MongoDB database that contains your user's @@ -120,8 +120,8 @@ algorithm, to authenticate your user. The following code snippets show how to specify the authentication mechanism, using the following placeholders: -* ``username`` - your MongoDB username. -* ``password`` - your MongoDB user's password. +* ``db_username`` - your MongoDB database username. +* ``db_password`` - your MongoDB database user's password. * ``hostname`` - network address of your MongoDB server, accessible by your client. * ``port`` - port number of your MongoDB server. * ``authenticationDb`` - MongoDB database that contains your user's @@ -172,8 +172,8 @@ your user. The following code snippets show how to specify the authentication mechanism, using the following placeholders: -* ``username`` - your MongoDB username. -* ``password`` - your MongoDB user's password. +* ``db_username`` - your MongoDB database username. +* ``db_password`` - your MongoDB database user's password. * ``hostname`` - network address of your MongoDB server, accessible by your client. * ``port`` - port number of your MongoDB server. * ``authenticationDb`` - MongoDB database that contains your user's diff --git a/source/fundamentals/connection/connect.txt b/source/fundamentals/connection/connect.txt index 18e0eabc..78754640 100644 --- a/source/fundamentals/connection/connect.txt +++ b/source/fundamentals/connection/connect.txt @@ -68,7 +68,7 @@ to change the servers in rotation without reconfiguring clients. The next part of the connection URI contains your credentials if you are using a password-based authentication mechanism. Replace the value of ``user`` -with your username and ``pass`` with your password. If your +with your database username and ``pass`` with your database user's password. If your authentication mechanism does not require credentials, omit this part of the connection URI. diff --git a/source/fundamentals/enterprise-auth.txt b/source/fundamentals/enterprise-auth.txt index 1daa1997..defe7000 100644 --- a/source/fundamentals/enterprise-auth.txt +++ b/source/fundamentals/enterprise-auth.txt @@ -66,7 +66,7 @@ principal name. The following code snippets show how to specify the authentication mechanism, using the following placeholders: -* ``username`` - your URL-encoded principal name, e.g. "username%40REALM.ME" +* ``Kerberos principal`` - your URL-encoded principal name, e.g. "username%40REALM.ME" * ``hostname`` - network address of your MongoDB server, accessible by your client * ``port`` - port number of your MongoDB server @@ -248,7 +248,7 @@ parameter to ``PLAIN`` and including your LDAP username and password in the The following code snippets show how to specify the authentication mechanism, using the following placeholders: -* ``username`` - your LDAP username +* ``LDAP username`` - your LDAP username * ``password`` - your LDAP user's password * ``hostname`` - network address of your MongoDB server, accessible by your client * ``port`` - port number of your MongoDB server @@ -344,7 +344,7 @@ see the corresponding syntax. .. tab:: MongoCredential :tabid: mongodb-azure-mongo-credential - Replace the ```` placeholder with the client ID or application ID of the + Replace the ```` placeholder with the client ID or application ID of the Azure managed identity or enterprise application. Replace the ```` placeholder with the value of the ``audience`` server parameter configured on your MongoDB deployment.