Skip to content

Commit 10817e2

Browse files
chore: deprecate unsafe client option (#2135)
* chore: deprecate unsafe client option * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 123e10e commit 10817e2

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

.github/workflows/issues-no-repro.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
node-version: 18
1717
- run: npm install
1818
working-directory: ./.github/scripts
19-
- uses: actions/github-script@v8
19+
- uses: actions/github-script@v7
2020
with:
2121
script: |
2222
const script = require('./.github/scripts/close-invalid-link.cjs')

.github/workflows/response.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
pull-requests: write
1515
steps:
1616
- uses: actions/checkout@v5
17-
- uses: actions/github-script@v8
17+
- uses: actions/github-script@v7
1818
with:
1919
script: |
2020
const script = require('./.github/scripts/close-unresponsive.cjs')
@@ -28,7 +28,7 @@ jobs:
2828
pull-requests: write
2929
steps:
3030
- uses: actions/checkout@v5
31-
- uses: actions/github-script@v8
31+
- uses: actions/github-script@v7
3232
with:
3333
script: |
3434
const script = require('./.github/scripts/remove-response-label.cjs')

src/auth/googleauth.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)