Skip to content

Commit

Permalink
use google-service-account
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Nov 6, 2014
1 parent fa5a471 commit 81aba40
Show file tree
Hide file tree
Showing 23 changed files with 521 additions and 929 deletions.
14 changes: 3 additions & 11 deletions lib/bigquery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ var extend = require('extend');
var streamEvents = require('stream-events');
var through = require('through2');

/**
* @type module:common/connection
* @private
*/
var conn = require('../common/connection.js');

/**
* @type module:bigquery/dataset
* @private
Expand Down Expand Up @@ -115,9 +109,9 @@ function BigQuery(options) {

options = options || {};

this.connection_ = new conn.Connection({
this.makeAuthorizedRequest_ = util.makeAuthorizedRequest({
credentials: options.credentials,
keyFilename: options.keyFilename,
keyFile: options.keyFilename,
scopes: SCOPES
});

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

this.connection_.req(reqOpts, function(err, res, body) {
util.handleResp(err, res, body, callback);
});
this.makeAuthorizedRequest_(reqOpts, callback);
};

module.exports = BigQuery;
2 changes: 1 addition & 1 deletion lib/bigquery/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Table.prototype.createWriteStream = function(metadata) {

dup.once('writing', function() {
util.makeWritableStream(dup, {
connection: that.bigQuery.connection_,
makeAuthorizedRequest: that.bigQuery.makeAuthorizedRequest_,
metadata: {
configuration: {
load: metadata
Expand Down
353 changes: 0 additions & 353 deletions lib/common/connection.js

This file was deleted.

Loading

0 comments on commit 81aba40

Please sign in to comment.