File tree 5 files changed +14
-22
lines changed
5 files changed +14
-22
lines changed Original file line number Diff line number Diff line change @@ -110,18 +110,13 @@ function Compute(options) {
110
110
return new Compute ( options ) ;
111
111
}
112
112
113
- var authConfig = {
113
+ this . makeAuthenticatedRequest_ = util . makeAuthenticatedRequestFactory ( {
114
114
credentials : options . credentials ,
115
115
keyFile : options . keyFilename ,
116
116
scopes : SCOPES ,
117
117
email : options . email
118
- } ;
119
-
120
- // We store the authConfig for use with gceImages in Zone.
121
- this . authConfig = authConfig ;
118
+ } ) ;
122
119
123
- this . makeAuthenticatedRequest_ =
124
- util . makeAuthenticatedRequestFactory ( authConfig ) ;
125
120
this . projectId = options . projectId ;
126
121
}
127
122
Original file line number Diff line number Diff line change @@ -84,7 +84,9 @@ function Zone(compute, name) {
84
84
this . name = name ;
85
85
this . metadata = { } ;
86
86
87
- this . gceImages = gceImages ( compute . authConfig ) ;
87
+ this . gceImages = gceImages ( {
88
+ authClient : compute . makeAuthenticatedRequest_ . authClient
89
+ } ) ;
88
90
}
89
91
90
92
/**
Original file line number Diff line number Diff line change 89
89
"dns-zonefile" : " 0.1.10" ,
90
90
"duplexify" : " ^3.2.0" ,
91
91
"extend" : " ^3.0.0" ,
92
- "gce-images" : " ^0.1 .0" ,
92
+ "gce-images" : " ^0.2 .0" ,
93
93
"gcs-resumable-upload" : " ^0.2.1" ,
94
94
"google-auto-auth" : " ^0.2.0" ,
95
95
"hash-stream-validation" : " ^0.1.0" ,
Original file line number Diff line number Diff line change @@ -144,17 +144,6 @@ describe('Compute', function() {
144
144
fakeUtil . normalizeArguments = normalizeArguments ;
145
145
} ) ;
146
146
147
- it ( 'should localize authConfig' , function ( ) {
148
- var compute = new Compute ( options ) ;
149
-
150
- assert . deepEqual ( compute . authConfig , {
151
- credentials : options . credentials ,
152
- keyFile : options . keyFilename ,
153
- email : options . email ,
154
- scopes : [ 'https://www.googleapis.com/auth/compute' ]
155
- } ) ;
156
- } ) ;
157
-
158
147
it ( 'should create a makeAuthenticatedRequest method' , function ( done ) {
159
148
fakeUtil . makeAuthenticatedRequestFactory = function ( options_ ) {
160
149
assert . deepEqual ( options_ , {
Original file line number Diff line number Diff line change @@ -60,7 +60,12 @@ describe('Zone', function() {
60
60
var zone ;
61
61
62
62
var COMPUTE = {
63
- authConfig : { a : 'b' , c : 'd' }
63
+ makeAuthenticatedRequest_ : {
64
+ authClient : {
65
+ a : 'b' ,
66
+ c : 'd'
67
+ }
68
+ }
64
69
} ;
65
70
var ZONE_NAME = 'us-central1-a' ;
66
71
@@ -111,7 +116,8 @@ describe('Zone', function() {
111
116
var gceVal = 'ok' ;
112
117
113
118
gceImagesOverride = function ( authConfig ) {
114
- assert . strictEqual ( authConfig , COMPUTE . authConfig ) ;
119
+ var expectedAuthClient = COMPUTE . makeAuthenticatedRequest_ . authClient ;
120
+ assert . strictEqual ( authConfig . authClient , expectedAuthClient ) ;
115
121
return gceVal ;
116
122
} ;
117
123
You can’t perform that action at this time.
0 commit comments