From bcf193ec9ef64840c5882b86a6d0a6285ed54b78 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 4 Dec 2015 15:15:41 -0800 Subject: [PATCH] Generalize metadata plugin arguments to future-proof it --- src/node/src/credentials.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node/src/credentials.js b/src/node/src/credentials.js index ff10a22e6a9..dcbfac18f46 100644 --- a/src/node/src/credentials.js +++ b/src/node/src/credentials.js @@ -91,7 +91,7 @@ exports.createSsl = ChannelCredentials.createSsl; */ exports.createFromMetadataGenerator = function(metadata_generator) { return CallCredentials.createFromPlugin(function(service_url, callback) { - metadata_generator(service_url, function(error, metadata) { + metadata_generator({service_url: service_url}, function(error, metadata) { var code = grpc.status.OK; var message = ''; if (error) { @@ -114,7 +114,8 @@ exports.createFromMetadataGenerator = function(metadata_generator) { * @return {CallCredentials} The resulting credentials object */ exports.createFromGoogleCredential = function(google_credential) { - return exports.createFromMetadataGenerator(function(service_url, callback) { + return exports.createFromMetadataGenerator(function(auth_context, callback) { + var service_url = auth_context.service_url; google_credential.getRequestMetadata(service_url, function(err, header) { if (err) { callback(err);