From 22ac3ef19c3dec3c760c791e96fc4b2ba2f11741 Mon Sep 17 00:00:00 2001 From: Jun Tsai Date: Sat, 3 Oct 2020 21:09:12 +0800 Subject: [PATCH 1/6] Add grpc.default_authority option for authorization --- src/client/puppet-hostie.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/puppet-hostie.ts b/src/client/puppet-hostie.ts index 156b3dbd..f323d62a 100644 --- a/src/client/puppet-hostie.ts +++ b/src/client/puppet-hostie.ts @@ -222,10 +222,11 @@ export class PuppetHostie extends Puppet { endpoint = hostieIpResult.ip + ':' + hostieIpResult.port } + const clientOptions = Object.assign({},GRPC_LIMITATION,{'grpc.default_authority':this.options.token}) this.grpcClient = new PuppetClient( endpoint, // 'localhost:50051', grpc.credentials.createInsecure(), - GRPC_LIMITATION, + clientOptions ) } From 2a47ac8853545feb2c7ff4c4beb977142a498540 Mon Sep 17 00:00:00 2001 From: Jun Tsai Date: Sat, 3 Oct 2020 21:11:31 +0800 Subject: [PATCH 2/6] Fix eslint error --- src/client/puppet-hostie.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/puppet-hostie.ts b/src/client/puppet-hostie.ts index f323d62a..3372773a 100644 --- a/src/client/puppet-hostie.ts +++ b/src/client/puppet-hostie.ts @@ -222,7 +222,7 @@ export class PuppetHostie extends Puppet { endpoint = hostieIpResult.ip + ':' + hostieIpResult.port } - const clientOptions = Object.assign({},GRPC_LIMITATION,{'grpc.default_authority':this.options.token}) + const clientOptions = Object.assign({}, GRPC_LIMITATION, { 'grpc.default_authority':this.options.token }) this.grpcClient = new PuppetClient( endpoint, // 'localhost:50051', grpc.credentials.createInsecure(), From 3b5e36d99ab2bd04f06f07db95ec75206e812709 Mon Sep 17 00:00:00 2001 From: Jun Tsai Date: Sat, 3 Oct 2020 21:38:02 +0800 Subject: [PATCH 3/6] 0.10.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93a3a32c..5e17ea68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wechaty-puppet-hostie", - "version": "0.10.3", + "version": "0.10.4", "description": "Puppet Hostie for Wechaty", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", From 2012eb2698bd657e676a0ac87fc2a5caa48560e8 Mon Sep 17 00:00:00 2001 From: Jun Tsai Date: Sun, 4 Oct 2020 20:18:33 +0800 Subject: [PATCH 4/6] Use es6 style --- src/client/puppet-hostie.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/puppet-hostie.ts b/src/client/puppet-hostie.ts index 3372773a..b3ee0e15 100644 --- a/src/client/puppet-hostie.ts +++ b/src/client/puppet-hostie.ts @@ -222,7 +222,10 @@ export class PuppetHostie extends Puppet { endpoint = hostieIpResult.ip + ':' + hostieIpResult.port } - const clientOptions = Object.assign({}, GRPC_LIMITATION, { 'grpc.default_authority':this.options.token }) + const clientOptions = { + ...GRPC_LIMITATION, + 'grpc.default_authority': this.options.token, + } this.grpcClient = new PuppetClient( endpoint, // 'localhost:50051', grpc.credentials.createInsecure(), From cbf2d56a661507ce690f9dc2e3be0e9b19a154f8 Mon Sep 17 00:00:00 2001 From: Jun Tsai Date: Mon, 5 Oct 2020 20:59:45 +0800 Subject: [PATCH 5/6] add some document --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 91c6c021..8594cfb7 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,10 @@ WECHATY_PUPPET_HOSTIE_TOKEN=hostie_token node bot.js ### master +### v0.10.4 (Oct 2020) + +1. Add 'grpc.default_authority' to gRPC client option.gRPC server can use the authority to identify current user. + ### v0.6 (Apr 2020) Beta Version From 649905e0ffbf8578ff1dbb5538ef483b6f0e0167 Mon Sep 17 00:00:00 2001 From: Jun Tsai Date: Mon, 5 Oct 2020 21:09:26 +0800 Subject: [PATCH 6/6] fix lint error --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8594cfb7..74aaf9bc 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,8 @@ WECHATY_PUPPET_HOSTIE_TOKEN=hostie_token node bot.js ### v0.10.4 (Oct 2020) -1. Add 'grpc.default_authority' to gRPC client option.gRPC server can use the authority to identify current user. +1. Add 'grpc.default_authority' to gRPC client option. + gRPC server can use the authority to identify current user. ### v0.6 (Apr 2020)