File tree 2 files changed +6
-1
lines changed
src/test/kotlin/org/opensearch/replication
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -450,6 +450,7 @@ int endJmxPort = startJmxPort
450
450
integTest {
451
451
useCluster testClusters. leaderCluster
452
452
useCluster testClusters. followCluster
453
+ systemProperty " password" , " admin" // setting it to `admin` explicitly since its a custom security setup
453
454
454
455
if (knnEnabled){
455
456
nonInputProperties. systemProperty(' tests.knn_plugin_enabled' , " true" )
Original file line number Diff line number Diff line change @@ -57,12 +57,14 @@ import org.junit.After
57
57
import org.junit.AfterClass
58
58
import org.junit.Before
59
59
import org.junit.BeforeClass
60
+ import java.nio.charset.StandardCharsets
60
61
import java.nio.file.Files
61
62
import java.security.KeyManagementException
62
63
import java.security.KeyStore
63
64
import java.security.KeyStoreException
64
65
import java.security.NoSuchAlgorithmException
65
66
import java.security.cert.CertificateException
67
+ import java.util.Base64
66
68
import java.util.concurrent.TimeUnit
67
69
import java.util.concurrent.atomic.AtomicReference
68
70
import java.util.Collections
@@ -233,8 +235,10 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() {
233
235
for ((key, value) in headers) {
234
236
defaultHeaders[i++ ] = BasicHeader (key, value)
235
237
}
238
+
239
+ val creds = System .getProperty(" user" , " admin" ) + " :" + System .getProperty(" password" , " myStrongPassword123!" )
236
240
if (securityEnabled) {
237
- defaultHeaders[i++ ] = BasicHeader (" Authorization" , " Basic YWRtaW46YWRtaW4= " )
241
+ defaultHeaders[i++ ] = BasicHeader (" Authorization" , " Basic " + Base64 .getEncoder().encodeToString(creds.toByteArray( StandardCharsets . UTF_8 )) )
238
242
}
239
243
240
244
builder.setDefaultHeaders(defaultHeaders)
You can’t perform that action at this time.
0 commit comments