@@ -38,7 +38,7 @@ export type Options = {
38
38
iamAccessToken ?: string ;
39
39
iamUrl ?: string ;
40
40
iamClientId ?: string ;
41
- iamSecret ?: string ;
41
+ iamClientSecret ?: string ;
42
42
}
43
43
44
44
// this interface is a representation of the response
@@ -60,7 +60,7 @@ export class IamTokenManagerV1 {
60
60
private iamApikey : string ;
61
61
private userAccessToken : string ;
62
62
private iamClientId : string ;
63
- private iamSecret : string ;
63
+ private iamClientSecret : string ;
64
64
65
65
/**
66
66
* IAM Token Manager Service
@@ -85,10 +85,10 @@ export class IamTokenManagerV1 {
85
85
if ( options . iamClientId ) {
86
86
this . iamClientId = options . iamClientId ;
87
87
}
88
- if ( options . iamSecret ) {
89
- this . iamSecret = options . iamSecret ;
88
+ if ( options . iamClientSecret ) {
89
+ this . iamClientSecret = options . iamClientSecret ;
90
90
}
91
- if ( onlyOne ( options . iamClientId , options . iamSecret ) ) {
91
+ if ( onlyOne ( options . iamClientId , options . iamClientSecret ) ) {
92
92
// tslint:disable-next-line
93
93
console . log ( CLIENT_ID_SECRET_WARNING ) ;
94
94
}
@@ -127,20 +127,20 @@ export class IamTokenManagerV1 {
127
127
}
128
128
129
129
/**
130
- * Set the IAM 'client_id' and 'secret ' values.
130
+ * Set the IAM 'client_id' and 'client_secret ' values.
131
131
* These values are used to compute the Authorization header used
132
132
* when retrieving or refreshing the IAM access token.
133
133
* If these values are not set, then a default Authorization header
134
134
* will be used when interacting with the IAM token server.
135
135
*
136
136
* @param {string } iamClientId - The client id
137
- * @param {string } iamSecret - The secret
137
+ * @param {string } iamClientSecret - The client secret
138
138
* @returns {void }
139
139
*/
140
- public setIamAuthorizationInfo ( iamClientId : string , iamSecret : string ) : void {
140
+ public setIamAuthorizationInfo ( iamClientId : string , iamClientSecret : string ) : void {
141
141
this . iamClientId = iamClientId ;
142
- this . iamSecret = iamSecret ;
143
- if ( onlyOne ( iamClientId , iamSecret ) ) {
142
+ this . iamClientSecret = iamClientSecret ;
143
+ if ( onlyOne ( iamClientId , iamClientSecret ) ) {
144
144
// tslint:disable-next-line
145
145
console . log ( CLIENT_ID_SECRET_WARNING ) ;
146
146
}
@@ -271,14 +271,14 @@ export class IamTokenManagerV1 {
271
271
private computeIamAuthHeader ( ) : string {
272
272
// Use bx:bx as default auth header creds.
273
273
let clientId = 'bx' ;
274
- let secret = 'bx' ;
274
+ let clientSecret = 'bx' ;
275
275
276
276
// If both the clientId and secret were specified by the user, then use them.
277
- if ( this . iamClientId && this . iamSecret ) {
277
+ if ( this . iamClientId && this . iamClientSecret ) {
278
278
clientId = this . iamClientId ;
279
- secret = this . iamSecret ;
279
+ clientSecret = this . iamClientSecret ;
280
280
}
281
- const encodedCreds = Buffer . from ( `${ clientId } :${ secret } ` ) . toString ( 'base64' ) ;
281
+ const encodedCreds = Buffer . from ( `${ clientId } :${ clientSecret } ` ) . toString ( 'base64' ) ;
282
282
return `Basic ${ encodedCreds } ` ;
283
283
}
284
284
}
0 commit comments