Skip to content

Commit fbc6b11

Browse files
authored
Revert "feat: add console warnings for mitigating file based credential load … (#2143)" (#2160)
This reverts commit cae596b.
1 parent 7e547d4 commit fbc6b11

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

src/auth/externalclient.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ export class ExternalAccountClient {
7373
static fromJSON(
7474
options: ExternalAccountClientOptions,
7575
): BaseExternalAccountClient | null {
76-
console.warn(
77-
'The `fromJSON` method does not validate the credential configuration. A security risk occurs when a credential configuration configured with malicious URLs is used. When the credential configuration is accepted from an untrusted source, you should validate it before using it with this method. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.',
78-
);
7976
if (options && options.type === EXTERNAL_ACCOUNT_TYPE) {
8077
if ((options as AwsClientOptions).credential_source?.environment_id) {
8178
return new AwsClient(options as AwsClientOptions);

src/auth/googleauth.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -275,19 +275,9 @@ export class GoogleAuth<T extends AuthClient = AuthClient> {
275275
this._cachedProjectId = opts.projectId || null;
276276
this.cachedCredential = opts.authClient || null;
277277
this.keyFilename = opts.keyFilename || opts.keyFile;
278-
if (this.keyFilename) {
279-
console.warn(
280-
'The `keyFilename` option is deprecated. Please use the `credentials` option instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.',
281-
);
282-
}
283278
this.scopes = opts.scopes;
284279
this.clientOptions = opts.clientOptions || {};
285280
this.jsonContent = opts.credentials || null;
286-
if (this.jsonContent) {
287-
console.warn(
288-
'The `credentials` option is deprecated. Please use the `auth` object constructor instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.',
289-
);
290-
}
291281
this.apiKey = opts.apiKey || this.clientOptions.apiKey || null;
292282

293283
// Cannot use both API Key + Credentials
@@ -776,9 +766,6 @@ export class GoogleAuth<T extends AuthClient = AuthClient> {
776766
json: JWTInput | ImpersonatedJWTInput,
777767
options: AuthClientOptions = {},
778768
): JSONClient {
779-
console.warn(
780-
'The `fromJSON` method is deprecated. Please use the `JWT` constructor instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.',
781-
);
782769
let client: JSONClient;
783770

784771
// user's preferred universe domain
@@ -895,9 +882,6 @@ export class GoogleAuth<T extends AuthClient = AuthClient> {
895882
optionsOrCallback: AuthClientOptions | CredentialCallback = {},
896883
callback?: CredentialCallback,
897884
): Promise<JSONClient> | void {
898-
console.warn(
899-
'The `fromStream` method is deprecated. Please use the `JWT` constructor with a parsed stream instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.',
900-
);
901885
let options: AuthClientOptions = {};
902886
if (typeof optionsOrCallback === 'function') {
903887
callback = optionsOrCallback;

src/auth/impersonated.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ export class Impersonated extends OAuth2Client implements IdTokenProvider {
121121
*/
122122
constructor(options: ImpersonatedOptions = {}) {
123123
super(options);
124-
console.warn(
125-
'The `Impersonated` constructor does not validate the credential configuration. A security risk occurs when a credential configuration configured with malicious URLs is used. When the credential configuration is accepted from an untrusted source, you should validate it before using it with this method. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.',
126-
);
127124
// Start with an expired refresh token, which will automatically be
128125
// refreshed before the first API call is made.
129126
this.credentials = {

0 commit comments

Comments
 (0)