Skip to content

Commit f8436f5

Browse files
use google-service-account
1 parent 8e9033f commit f8436f5

23 files changed

Lines changed: 388 additions & 931 deletions

File tree

lib/bigquery/index.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ var extend = require('extend');
2424
var streamEvents = require('stream-events');
2525
var through = require('through2');
2626

27-
/**
28-
* @type module:common/connection
29-
* @private
30-
*/
31-
var conn = require('../common/connection.js');
32-
3327
/**
3428
* @type module:bigquery/dataset
3529
* @private
@@ -115,9 +109,9 @@ function BigQuery(options) {
115109

116110
options = options || {};
117111

118-
this.connection_ = new conn.Connection({
112+
this.makeAuthorizedRequest_ = util.makeAuthorizedRequest(this, {
119113
credentials: options.credentials,
120-
keyFilename: options.keyFilename,
114+
keyFile: options.keyFilename,
121115
scopes: SCOPES
122116
});
123117

@@ -565,9 +559,7 @@ BigQuery.prototype.makeReq_ = function(method, path, query, body, callback) {
565559
reqOpts.json = body;
566560
}
567561

568-
this.connection_.req(reqOpts, function(err, res, body) {
569-
util.handleResp(err, res, body, callback);
570-
});
562+
this.makeAuthorizedRequest_(reqOpts, callback);
571563
};
572564

573565
module.exports = BigQuery;

lib/bigquery/table.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Table.prototype.createWriteStream = function(metadata) {
306306

307307
dup.once('writing', function() {
308308
util.makeWritableStream(dup, {
309-
connection: that.bigQuery.connection_,
309+
makeAuthorizedRequest: that.bigQuery.makeAuthorizedRequest_,
310310
metadata: {
311311
configuration: {
312312
load: metadata

lib/common/connection.js

Lines changed: 0 additions & 353 deletions
This file was deleted.

0 commit comments

Comments
 (0)