thorin-plugin-cluster-kube 2.0.8 → 2.0.9

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.
package/index.js CHANGED
@@ -15,6 +15,7 @@ module.exports = function init(thorin, opt, pluginName) {
15
15
  name: thorin.id
16
16
  }, // this is the service name
17
17
  token: process.env.CLUSTER_TOKEN || null, // A shared verification token used for auth
18
+ tokenHeader: 'x-cluster-token', // The HTTP header to place the auth token in
18
19
  namespace: 'svc.cluster.local', // The kube namespace name
19
20
  protocol: 'http', // The default protocol for all communication
20
21
  alias: { // aliases for services.
@@ -69,7 +69,7 @@ module.exports = function init(thorin, opt) {
69
69
  timeout: _opt.timeout || opt.timeout
70
70
  };
71
71
  if (this.#token) {
72
- fetchOpt.headers['x-cluster-token'] = this.sign(reqPayload, opt.service.id);
72
+ fetchOpt.headers[opt.tokenHeader || 'x-cluster-token'] = this.sign(reqPayload, opt.service.id);
73
73
  }
74
74
  if (_opt && _opt.headers) {
75
75
  Object.keys(_opt.headers || {}).forEach(k => fetchOpt.headers[k] = _opt.headers[k]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "thorin-plugin-cluster-kube",
3
3
  "author": "UNLOQ Systems",
4
- "version": "2.0.8",
4
+ "version": "2.0.9",
5
5
  "dependencies": {},
6
6
  "description": "Thorin.js cluster plugin for microservice communication within a kubernetes environment",
7
7
  "main": "index.js",