@testcontainers/opensearch 11.9.0 → 11.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,9 +24,12 @@ export declare class StartedOpenSearchContainer extends AbstractStartedContainer
|
|
|
24
24
|
readonly startedTestContainer: StartedTestContainer;
|
|
25
25
|
private readonly username;
|
|
26
26
|
private readonly password;
|
|
27
|
-
|
|
27
|
+
private readonly securityEnabled;
|
|
28
|
+
constructor(startedTestContainer: StartedTestContainer, username: string, password: string, securityEnabled: boolean);
|
|
28
29
|
/** Mapped HTTP(S) port */
|
|
29
30
|
getPort(): number;
|
|
31
|
+
/** Get the URL schema needed for connecting to this container */
|
|
32
|
+
getSchema(): string;
|
|
30
33
|
/** HTTPS endpoint URL */
|
|
31
34
|
getHttpUrl(): string;
|
|
32
35
|
/** Admin username (always 'admin' by default) */
|
|
@@ -15,10 +15,7 @@ class OpenSearchContainer extends testcontainers_1.GenericContainer {
|
|
|
15
15
|
password = "yourStrong(!)P@ssw0rd";
|
|
16
16
|
username = "admin";
|
|
17
17
|
// HTTPS + Basic Auth wait strategy
|
|
18
|
-
defaultWaitStrategy = testcontainers_1.Wait.forHttp("/", OPENSEARCH_HTTP_PORT)
|
|
19
|
-
.usingTls()
|
|
20
|
-
.allowInsecure()
|
|
21
|
-
.withBasicCredentials(this.username, this.password);
|
|
18
|
+
defaultWaitStrategy = testcontainers_1.Wait.forHttp("/", OPENSEARCH_HTTP_PORT).withBasicCredentials(this.username, this.password);
|
|
22
19
|
constructor(image) {
|
|
23
20
|
super(image);
|
|
24
21
|
this.withExposedPorts(OPENSEARCH_HTTP_PORT, OPENSEARCH_TRANSPORT_PORT, OPENSEARCH_PERFORMANCE_ANALYZER_PORT)
|
|
@@ -61,8 +58,11 @@ class OpenSearchContainer extends testcontainers_1.GenericContainer {
|
|
|
61
58
|
this.withEnvironment({
|
|
62
59
|
OPENSEARCH_INITIAL_ADMIN_PASSWORD: this.password,
|
|
63
60
|
});
|
|
61
|
+
if (this.securityEnabled) {
|
|
62
|
+
this.defaultWaitStrategy.usingTls().allowInsecure();
|
|
63
|
+
}
|
|
64
64
|
const started = await super.start();
|
|
65
|
-
return new StartedOpenSearchContainer(started, this.username, this.password);
|
|
65
|
+
return new StartedOpenSearchContainer(started, this.username, this.password, this.securityEnabled);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
exports.OpenSearchContainer = OpenSearchContainer;
|
|
@@ -70,19 +70,25 @@ class StartedOpenSearchContainer extends testcontainers_1.AbstractStartedContain
|
|
|
70
70
|
startedTestContainer;
|
|
71
71
|
username;
|
|
72
72
|
password;
|
|
73
|
-
|
|
73
|
+
securityEnabled;
|
|
74
|
+
constructor(startedTestContainer, username, password, securityEnabled) {
|
|
74
75
|
super(startedTestContainer);
|
|
75
76
|
this.startedTestContainer = startedTestContainer;
|
|
76
77
|
this.username = username;
|
|
77
78
|
this.password = password;
|
|
79
|
+
this.securityEnabled = securityEnabled;
|
|
78
80
|
}
|
|
79
81
|
/** Mapped HTTP(S) port */
|
|
80
82
|
getPort() {
|
|
81
83
|
return this.getMappedPort(OPENSEARCH_HTTP_PORT);
|
|
82
84
|
}
|
|
85
|
+
/** Get the URL schema needed for connecting to this container */
|
|
86
|
+
getSchema() {
|
|
87
|
+
return this.securityEnabled ? "https" : "http";
|
|
88
|
+
}
|
|
83
89
|
/** HTTPS endpoint URL */
|
|
84
90
|
getHttpUrl() {
|
|
85
|
-
return
|
|
91
|
+
return `${this.getSchema()}://${this.getHost()}:${this.getPort()}`;
|
|
86
92
|
}
|
|
87
93
|
/** Admin username (always 'admin' by default) */
|
|
88
94
|
getUsername() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opensearch-container.js","sourceRoot":"","sources":["../src/opensearch-container.ts"],"names":[],"mappings":";;;;;;AAAA,mDAAwG;AACxG,oDAA4B;AAE5B,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,yBAAy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BAAoB,CAAC,CAAC;QALV,yBAAoB,GAApB,oBAAoB,CAAsB;QAC3C,aAAQ,GAAR,QAAQ,CAAQ;QAChB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,oBAAe,GAAf,eAAe,CAAS;IAG3C,CAAC;IAED,0BAA0B;IACnB,OAAO;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAClD,CAAC;IAED,iEAAiE;IAC1D,SAAS;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IACjD,CAAC;IAED,yBAAyB;IAClB,UAAU;QACf,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACrE,CAAC;IAED,iDAAiD;IAC1C,WAAW;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,qBAAqB;IACd,WAAW;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAlCD,gEAkCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testcontainers/opensearch",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.10.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"opensearch",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/zxcvbn": "^4.4.5"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"testcontainers": "^11.
|
|
36
|
+
"testcontainers": "^11.10.0",
|
|
37
37
|
"zxcvbn": "^4.4.2"
|
|
38
38
|
}
|
|
39
39
|
}
|