@@ -115,7 +115,33 @@ export interface GoogleAuthOptions<T extends AuthClient = AnyAuthClient> {
115115 keyFilename ?: string ;
116116
117117 /**
118- * Path to a .json, .pem, or .p12 key file
118+ * @deprecated This option is being deprecated because of a potential security risk.
119+ *
120+ * This option does not validate the credential configuration. The security
121+ * risk occurs when a credential configuration is accepted from a source that
122+ * is not under your control and used without validation on your side.
123+ *
124+ * The recommended way to provide credentials is to create an `auth` object
125+ * using `google-auth-library` and pass it to the client constructor.
126+ * This will ensure that unexpected credential types with potential for
127+ * malicious intent are not loaded unintentionally. For example:
128+ * ```
129+ * const {GoogleAuth} = require('google-auth-library');
130+ * const auth = new GoogleAuth({
131+ * // Scopes can be specified either as an array or as a single, space-delimited string.
132+ * scopes: 'https://www.googleapis.com/auth/cloud-platform'
133+ * });
134+ * const client = new MyClient({ auth: auth });
135+ * ```
136+ *
137+ * If you are loading your credential configuration from an untrusted source and have
138+ * not mitigated the risks (e.g. by validating the configuration yourself), make
139+ * these changes as soon as possible to prevent security risks to your environment.
140+ *
141+ * Regardless of the method used, it is always your responsibility to validate
142+ * configurations received from external sources.
143+ *
144+ * For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
119145 */
120146 keyFile ?: string ;
121147
0 commit comments