infinispan 0.10.0 → 0.12.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.
@@ -46,7 +46,7 @@
46
46
  <security-realm name="default">
47
47
  <server-identities>
48
48
  <ssl>
49
- <keystore path="server.p12" keystore-password="secret" alias="server"/>
49
+ <keystore path="server.p12" password="secret" alias="server"/>
50
50
  </ssl>
51
51
  </server-identities>
52
52
  <properties-realm groups-attribute="Roles">
@@ -57,33 +57,33 @@
57
57
  <security-realm name="client-cert">
58
58
  <server-identities>
59
59
  <ssl>
60
- <keystore path="server.p12" keystore-password="secret" alias="server"/>
60
+ <keystore path="server.p12" password="secret" alias="server"/>
61
61
  </ssl>
62
62
  </server-identities>
63
63
  <properties-realm groups-attribute="Roles">
64
64
  <user-properties path="users.properties"/>
65
65
  <group-properties path="groups.properties"/>
66
66
  </properties-realm>
67
- <!--truststore-realm path="client.p12" keystore-password="secret"/-->
67
+ <!--truststore-realm path="client.p12" password="secret"/-->
68
68
  </security-realm>
69
69
  <security-realm name="Trust1Realm">
70
70
  <server-identities>
71
71
  <ssl>
72
- <keystore path="trust1.p12" keystore-password="secret"/>
72
+ <keystore path="trust1.p12" password="secret"/>
73
73
  </ssl>
74
74
  </server-identities>
75
75
  </security-realm>
76
76
  <security-realm name="Trust2Realm">
77
77
  <server-identities>
78
78
  <ssl>
79
- <keystore path="trust2.p12" keystore-password="secret"/>
79
+ <keystore path="trust2.p12" password="secret"/>
80
80
  </ssl>
81
81
  </server-identities>
82
82
  </security-realm>
83
83
  <security-realm name="UntrustRealm">
84
84
  <server-identities>
85
85
  <ssl>
86
- <keystore path="untrust.p12" keystore-password="secret"/>
86
+ <keystore path="untrust.p12" password="secret"/>
87
87
  </ssl>
88
88
  </server-identities>
89
89
  </security-realm>
@@ -19,9 +19,7 @@
19
19
  mcast_recv_buf_size="25m"
20
20
  ip_ttl="${jgroups.ip_ttl:2}"
21
21
  thread_naming_pattern="pl"
22
- enable_diagnostics="false"
23
22
  bundler_type="no-bundler"
24
- max_bundle_size="8500"
25
23
 
26
24
  thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
27
25
  thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
@@ -49,7 +47,7 @@
49
47
  xmit_table_msgs_per_row="1024"
50
48
  xmit_table_max_compaction_time="30000"
51
49
  />
52
- <pbcast.STABLE stability_delay="500"
50
+ <pbcast.STABLE
53
51
  desired_avg_gossip="5000"
54
52
  max_bytes="1M"
55
53
  />
@@ -74,9 +72,7 @@
74
72
  mcast_recv_buf_size="25m"
75
73
  ip_ttl="${jgroups.ip_ttl:2}"
76
74
  thread_naming_pattern="pl"
77
- enable_diagnostics="false"
78
75
  bundler_type="no-bundler"
79
- max_bundle_size="8500"
80
76
 
81
77
  thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
82
78
  thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
@@ -104,7 +100,7 @@
104
100
  xmit_table_msgs_per_row="1024"
105
101
  xmit_table_max_compaction_time="30000"
106
102
  />
107
- <pbcast.STABLE stability_delay="500"
103
+ <pbcast.STABLE
108
104
  desired_avg_gossip="5000"
109
105
  max_bytes="1M"
110
106
  />
@@ -161,7 +157,7 @@
161
157
  <!-- server-identities>
162
158
  <ssl>
163
159
  <keystore path="application.keystore" relative-to="infinispan.server.config.path"
164
- keystore-password="password" alias="server" key-password="password"
160
+ password="password" alias="server" key-password="password"
165
161
  generate-self-signed-certificate-host="localhost"/>
166
162
  </ssl>
167
163
  </server-identities-->
@@ -19,9 +19,7 @@
19
19
  mcast_recv_buf_size="25m"
20
20
  ip_ttl="${jgroups.ip_ttl:2}"
21
21
  thread_naming_pattern="pl"
22
- enable_diagnostics="false"
23
22
  bundler_type="no-bundler"
24
- max_bundle_size="8500"
25
23
 
26
24
  thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
27
25
  thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
@@ -49,7 +47,7 @@
49
47
  xmit_table_msgs_per_row="1024"
50
48
  xmit_table_max_compaction_time="30000"
51
49
  />
52
- <pbcast.STABLE stability_delay="500"
50
+ <pbcast.STABLE
53
51
  desired_avg_gossip="5000"
54
52
  max_bytes="1M"
55
53
  />
@@ -74,9 +72,7 @@
74
72
  mcast_recv_buf_size="25m"
75
73
  ip_ttl="${jgroups.ip_ttl:2}"
76
74
  thread_naming_pattern="pl"
77
- enable_diagnostics="false"
78
75
  bundler_type="no-bundler"
79
- max_bundle_size="8500"
80
76
 
81
77
  thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
82
78
  thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
@@ -104,7 +100,7 @@
104
100
  xmit_table_msgs_per_row="1024"
105
101
  xmit_table_max_compaction_time="30000"
106
102
  />
107
- <pbcast.STABLE stability_delay="500"
103
+ <pbcast.STABLE
108
104
  desired_avg_gossip="5000"
109
105
  max_bytes="1M"
110
106
  />
@@ -163,7 +159,7 @@
163
159
  <!-- server-identities>
164
160
  <ssl>
165
161
  <keystore path="application.keystore" relative-to="infinispan.server.config.path"
166
- keystore-password="password" alias="server" key-password="password"
162
+ password="password" alias="server" key-password="password"
167
163
  generate-self-signed-certificate-host="localhost"/>
168
164
  </ssl>
169
165
  </server-identities-->
@@ -50,7 +50,7 @@
50
50
  <!-- server-identities>
51
51
  <ssl>
52
52
  <keystore path="application.keystore" relative-to="infinispan.server.config.path"
53
- keystore-password="password" alias="server" key-password="password"
53
+ password="password" alias="server" key-password="password"
54
54
  generate-self-signed-certificate-host="localhost"/>
55
55
  </ssl>
56
56
  </server-identities-->
@@ -27,7 +27,7 @@ describe('Infinispan TLS/SSL client', function() {
27
27
  );
28
28
 
29
29
  it('fails to operate if default server name (SNI) does not match default server realm',
30
- testError(expectContainsError("self signed certificate in certificate chain"),
30
+ testError(expectContainsAnyErrors(["self signed certificate in certificate chain", "self-signed certificate in certificate chain"]),
31
31
  sslSniDefault())
32
32
  );
33
33
 
@@ -37,6 +37,7 @@ describe('Infinispan TLS/SSL client', function() {
37
37
  ['CERT_SIGNATURE_FAILURE'
38
38
  , 'certificate signature failure'
39
39
  , 'self signed certificate in certificate chain'
40
+ , 'self-signed certificate in certificate chain'
40
41
  ])
41
42
  , sslSniUntrusted()
42
43
  )
@@ -53,7 +54,7 @@ describe('Infinispan TLS/SSL client', function() {
53
54
  );
54
55
 
55
56
  it('fails to operate if no encrypted transport is provided',
56
- testError(expectAnyExactErrors(['self signed certificate in certificate chain']),
57
+ testError(expectAnyExactErrors(['self signed certificate in certificate chain', 'self-signed certificate in certificate chain']),
57
58
  sslStoreNoCryptoStore())
58
59
  );
59
60
 
@@ -78,7 +79,7 @@ describe('Infinispan TLS/SSL client', function() {
78
79
  // );
79
80
 
80
81
  it('fails to operate if trusted certificate is missing for authenticated encrypted transport',
81
- testError(expectAnyExactErrors(['self signed certificate in certificate chain']),
82
+ testError(expectAnyExactErrors(['self signed certificate in certificate chain', 'self-signed certificate in certificate chain']),
82
83
  sslAuthWithMissingTrustCertificate())
83
84
  );
84
85
 
@@ -253,10 +254,10 @@ describe('Infinispan TLS/SSL client', function() {
253
254
  }
254
255
  }
255
256
 
256
- function expectContainsError(msg) {
257
+ function expectContainsAnyErrors(msg) {
257
258
  return function(done) {
258
259
  return function(err) {
259
- toContainAnyOf([msg], err, done);
260
+ toContainAnyOf(msg, err, done);
260
261
  }
261
262
  }
262
263
  }
@@ -1,3 +1,4 @@
1
+ /* eslint-disable require-jsdoc */
1
2
  // Commons functions
2
3
 
3
4
  var _ = require('underscore');
@@ -5,7 +6,7 @@ var _ = require('underscore');
5
6
  var log4js = require('log4js');
6
7
 
7
8
  var readFile = require('fs').readFile;
8
- var httpRequest = require('request');
9
+ var httpRequest = require('urllib');
9
10
  var util = require('util');
10
11
 
11
12
  var f = require('../../lib/functional');
@@ -719,65 +720,36 @@ function getClusterMembers(port) {
719
720
 
720
721
  return invokeDmrHttpGet('GET', opUrl, port)
721
722
  .then(function(response) {
722
- logger.debugf("Server '%s' replied with cluster members: %s", port, response.cluster_size);
723
+ logger.debugf('Server %s replied with cluster members: %s', port, response.cluster_size);
723
724
  var members = response.cluster_size;
724
- logger.debugf("Members are: %s", members);
725
+ logger.debugf('Members are: %s', members);
725
726
  return members;
726
727
  });
727
- }
728
+ };
728
729
  }
729
730
 
730
731
  function invokeDmrHttp(op, port) {
731
- return new Promise(function(fulfil, reject) {
732
- httpRequest({
733
- method: 'POST',
734
- url: 'http://localhost:' + port + '/rest/v2',
735
- auth: {
736
- user: 'admin',
737
- pass: 'pass',
738
- sendImmediately: false
739
- },
740
- headers: {
741
- 'Content-Type' : 'application/json'
742
- },
743
- body: JSON.stringify(op)
744
- }, function(error, response, body) {
745
- if (!error && response.statusCode == 200) {
746
- fulfil(JSON.parse(body));
747
- } else {
748
- reject(util.format('Error (%s), body (%s), response(%s)',
749
- error, body, JSON.stringify(response)));
750
- }
751
- });
752
- });
732
+ return httpRequest.request(`http://localhost:${port}/rest/v2`,
733
+ {method:'POST',
734
+ digestAuth: 'admin:pass',
735
+ headers:{
736
+ 'Content-Type': 'application/json',
737
+ 'body': op
738
+ }}).then(res => res.statusCode==200 ? JSON.parse(res.data) : {},
739
+ error => (util.format('Error (%s)', error)));
753
740
  }
754
741
 
755
742
  function invokeDmrHttpGet(method, opUrl, port) {
756
- return new Promise(function(fulfil, reject) {
757
- httpRequest({
758
- method: method,
759
- url: 'http://localhost:' + port + '/rest/v2' + opUrl,
760
- auth: {
761
- user: 'admin',
762
- pass: 'pass',
763
- sendImmediately: false
764
- },
765
- headers: {
766
- 'Content-Type' : 'application/json'
767
- }
768
- }, function(error, response, body) {
769
- if (!error && response.statusCode >= 200 && response.statusCode <= 204) {
770
- var resp = "";
771
- if (body) {
772
- resp = JSON.parse(body);
773
- }
774
- fulfil(resp);
775
- } else {
776
- reject(util.format('Error (%s), body (%s), response(%s)',
777
- error, body, JSON.stringify(response)));
778
- }
779
- });
780
- });
743
+
744
+ logger.debugf(`URL http://localhost:${port}/rest/v2${opUrl}`);
745
+ return httpRequest.request(`http://localhost:${port}/rest/v2${opUrl}`, {
746
+ method: method,
747
+ digestAuth: 'admin:pass',
748
+ headers: {
749
+ 'Content-Type' : 'application/json'
750
+ }
751
+ }).then( res => res.statusCode==200 ? JSON.parse(res.data) : {},
752
+ error => (util.format('Error (%s)', error)));
781
753
  }
782
754
 
783
755
  function readFileAsync(path) {
@@ -0,0 +1,91 @@
1
+ This directory contains all the type definitions that are used in this libray.
2
+
3
+ The below code can be used for testing the type support.
4
+
5
+ ```
6
+ const protobuf = require("protobufjs");
7
+ const infinispan = require("./lib/infinispan.js");
8
+
9
+
10
+ var client = infinispan.client(
11
+ { port: 11222, host: "127.0.0.1" },
12
+ {
13
+ dataFormat: {
14
+ keyType: "application/x-protostream",
15
+ valueType: "application/x-protostream",
16
+ },
17
+ authentication: {
18
+ enabled: true,
19
+ saslMechanism: "DIGEST-MD5",
20
+ userName: "admin",
21
+ password: "pass",
22
+ serverName: "infinispan",
23
+ },
24
+ cacheName: "protoStreamCache",
25
+ }
26
+ );
27
+
28
+ var protoMetaClient = infinispan.client({ port: 11222, host: "127.0.0.1" }, {
29
+ authentication: {
30
+ enabled: true,
31
+ saslMechanism: "DIGEST-MD5",
32
+ userName: "admin",
33
+ password: "pass",
34
+ serverName: "infinispan",
35
+ },
36
+ cacheName: "___protobuf_metadata",
37
+ dataFormat: { keyType: "text/plain", valueType: "text/plain" },
38
+ });
39
+
40
+ protoMetaClient.then(async function (client) {
41
+ var myMsg2 = `package awesomepackage;
42
+ /**
43
+ * @TypeId(1000042)
44
+ */
45
+ message AwesomeMessages {
46
+ required string name = 1;
47
+ required int64 age = 2;
48
+
49
+ }`
50
+ await client.put("awesomepackage/AwesomeMessage.proto", myMsg2);
51
+ await client.disconnect();
52
+ })
53
+
54
+
55
+ client.then(async function (client) {
56
+ var myMsg2 = `package awesomepackage;
57
+ /**
58
+ * @TypeId(1000042)
59
+ */
60
+ message AwesomeMessages {
61
+ required string name = 1;
62
+ required int64 age = 2;
63
+
64
+ }`;
65
+
66
+
67
+ let root = protobuf.parse(myMsg2).root;
68
+ let user = root.lookupType('awesomepackage.AwesomeMessages');
69
+ client.registerProtostreamType('.awesomepackage.AwesomeMessages', 1000042);
70
+ client.registerProtostreamRoot(root);
71
+ try {
72
+ for (let i = 0; i < 10; i++) {
73
+ let payload = { name: "Neeraj" + i, age: 20 + i };
74
+ let buf = user.create(payload);
75
+ await client.put(i + 1, buf);
76
+ console.log(await client.getWithMetadata(1));
77
+ }
78
+ var decoded = await client.query({ queryString: `select u.name,u.age from awesomepackage.AwesomeMessages u where u.age>20` });
79
+ console.log(decoded);
80
+ await client.disconnect();
81
+ } catch (error) {
82
+ console.log(error);
83
+ }
84
+
85
+ });
86
+ ```
87
+
88
+ In the put method, if someone provides only one argument then the compiler will throw the error as below :
89
+ `index.ts:70:18 - error TS2554: Expected 2-3 arguments, but got 1.`
90
+
91
+ The same follows for all the operations. There is a validation on client config also.