wu-sheng commented on a change in pull request #65:
URL: https://github.com/apache/skywalking-nodejs/pull/65#discussion_r757286627
##########
File path: src/agent/protocol/grpc/AuthInterceptor.ts
##########
@@ -17,23 +17,32 @@
*
*/
-import * as grpc from 'grpc';
-import { InterceptingCall, Listener, Metadata, Requester } from 'grpc';
+import * as grpc from '@grpc/grpc-js';
+// import { InterceptingCall, Listener, Metadata, Requester } from
'@grpc/grpc-js';
+// import { type } from 'os';
import config from '../../../config/AgentConfig';
-type Options = { [key: string]: string | number };
+// type Options = { [key: string]: string | number };
-export default function AuthInterceptor(options: Options, nextCall: (options:
Options) => InterceptingCall) {
- return new grpc.InterceptingCall(
- nextCall(options),
- new (class implements Requester {
- // tslint:disable-next-line:ban-types
- start(metadata: Metadata, listener: Listener, next: Function) {
- if (config.authorization) {
- metadata.add('Authentication', config.authorization);
- }
- next(metadata, listener);
- }
- })(),
- );
+// function AuthInterceptor(options: Options, nextCall: (options: Options) =>
InterceptingCall) {
+// return new grpc.InterceptingCall(
+// nextCall(options),
+// new (class implements Requester {
+// // tslint:disable-next-line:ban-types
+// start(metadata: Metadata, listener: Listener, next: Function) {
+// if (config.authorization) {
+// metadata.add('Authentication', config.authorization);
+// }
+// next(metadata, listener);
+// }
+// })(),
+// );
+// }
Review comment:
Same question.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]