@googleapis/sts 10.0.1 → 11.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/build/v1.d.ts +62 -1
- package/build/v1.js.map +1 -1
- package/build/v1beta.d.ts +61 -1
- package/build/v1beta.js.map +1 -1
- package/package.json +1 -1
- package/v1.ts +62 -1
- package/v1beta.ts +61 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [11.0.1](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v11.0.0...sts-v11.0.1) (2025-07-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **sts:** update the API ([eebd09d](https://github.com/googleapis/google-api-nodejs-client/commit/eebd09d1bf7991f11e4e33e63592e144e540321b))
|
|
9
|
+
* **sts:** update the API ([3ab0938](https://github.com/googleapis/google-api-nodejs-client/commit/3ab093828b82861bae6fb50abef2f86a910b85bc))
|
|
10
|
+
|
|
11
|
+
## [11.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v10.0.1...sts-v11.0.0) (2025-06-30)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* upgrade to node 18
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* upgrade to node 18 ([682fbb8](https://github.com/googleapis/google-api-nodejs-client/commit/682fbb869189ae92b3e9a194d37d0548af0c1f92))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **deps:** upgrade googleapis-common to 8.0.2-rc ([f4b0990](https://github.com/googleapis/google-api-nodejs-client/commit/f4b099071040cfbcfe4a2e7d487d45ee93b369e0))
|
|
26
|
+
* **sts:** update the API ([3ab0938](https://github.com/googleapis/google-api-nodejs-client/commit/3ab093828b82861bae6fb50abef2f86a910b85bc))
|
|
27
|
+
|
|
3
28
|
## [10.0.1](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v10.0.0...sts-v10.0.1) (2025-06-04)
|
|
4
29
|
|
|
5
30
|
|
package/build/v1.d.ts
CHANGED
|
@@ -174,7 +174,7 @@ export declare namespace sts_v1 {
|
|
|
174
174
|
*/
|
|
175
175
|
requestedTokenType?: string | null;
|
|
176
176
|
/**
|
|
177
|
-
* The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings. Required when exchanging an external credential for a Google access token.
|
|
177
|
+
* The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings; for example, `https://www.googleapis.com/auth/cloud-platform`. Required when exchanging an external credential for a Google access token. For a list of OAuth 2.0 scopes, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes).
|
|
178
178
|
*/
|
|
179
179
|
scope?: string | null;
|
|
180
180
|
/**
|
|
@@ -250,6 +250,67 @@ export declare namespace sts_v1 {
|
|
|
250
250
|
constructor(context: APIRequestContext);
|
|
251
251
|
/**
|
|
252
252
|
* Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundaries. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
|
|
253
|
+
* @example
|
|
254
|
+
* ```js
|
|
255
|
+
* // Before running the sample:
|
|
256
|
+
* // - Enable the API at:
|
|
257
|
+
* // https://console.developers.google.com/apis/api/sts.googleapis.com
|
|
258
|
+
* // - Login into gcloud by running:
|
|
259
|
+
* // ```sh
|
|
260
|
+
* // $ gcloud auth application-default login
|
|
261
|
+
* // ```
|
|
262
|
+
* // - Install the npm module by running:
|
|
263
|
+
* // ```sh
|
|
264
|
+
* // $ npm install googleapis
|
|
265
|
+
* // ```
|
|
266
|
+
*
|
|
267
|
+
* const {google} = require('googleapis');
|
|
268
|
+
* const sts = google.sts('v1');
|
|
269
|
+
*
|
|
270
|
+
* async function main() {
|
|
271
|
+
* const auth = new google.auth.GoogleAuth({
|
|
272
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
273
|
+
* scopes: [],
|
|
274
|
+
* });
|
|
275
|
+
*
|
|
276
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
277
|
+
* const authClient = await auth.getClient();
|
|
278
|
+
* google.options({auth: authClient});
|
|
279
|
+
*
|
|
280
|
+
* // Do the magic
|
|
281
|
+
* const res = await sts.token({
|
|
282
|
+
* // Request body metadata
|
|
283
|
+
* requestBody: {
|
|
284
|
+
* // request body parameters
|
|
285
|
+
* // {
|
|
286
|
+
* // "audience": "my_audience",
|
|
287
|
+
* // "grantType": "my_grantType",
|
|
288
|
+
* // "options": "my_options",
|
|
289
|
+
* // "requestedTokenType": "my_requestedTokenType",
|
|
290
|
+
* // "scope": "my_scope",
|
|
291
|
+
* // "subjectToken": "my_subjectToken",
|
|
292
|
+
* // "subjectTokenType": "my_subjectTokenType"
|
|
293
|
+
* // }
|
|
294
|
+
* },
|
|
295
|
+
* });
|
|
296
|
+
* console.log(res.data);
|
|
297
|
+
*
|
|
298
|
+
* // Example response
|
|
299
|
+
* // {
|
|
300
|
+
* // "access_boundary_session_key": "my_access_boundary_session_key",
|
|
301
|
+
* // "access_token": "my_access_token",
|
|
302
|
+
* // "expires_in": 0,
|
|
303
|
+
* // "issued_token_type": "my_issued_token_type",
|
|
304
|
+
* // "token_type": "my_token_type"
|
|
305
|
+
* // }
|
|
306
|
+
* }
|
|
307
|
+
*
|
|
308
|
+
* main().catch(e => {
|
|
309
|
+
* console.error(e);
|
|
310
|
+
* throw e;
|
|
311
|
+
* });
|
|
312
|
+
*
|
|
313
|
+
* ```
|
|
253
314
|
*
|
|
254
315
|
* @param params - Parameters for request
|
|
255
316
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
package/build/v1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../v1.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../v1.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,MAAM,CAmbtB;AAnbD,WAAiB,MAAM;IAgErB;;;;;;;;;;OAUG;IACH,MAAa,GAAG;QAId,YAAY,OAAsB,EAAE,MAA2B;YAC7D,IAAI,CAAC,OAAO,GAAG;gBACb,QAAQ,EAAE,OAAO,IAAI,EAAE;gBACvB,MAAM;aACP,CAAC;YAEF,IAAI,CAAC,EAAE,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;KACF;IAZY,UAAG,MAYf,CAAA;IAiLD,MAAa,WAAW;QAEtB,YAAY,OAA0B;YACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAoGD,KAAK,CACH,gBAGkC,EAClC,iBAIkC,EAClC,QAEkC;YAOlC,IAAI,MAAM,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAA6B,CAAC;YAClE,IAAI,OAAO,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAkB,CAAC;YAEzD,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE;gBAC1C,QAAQ,GAAG,gBAAgB,CAAC;gBAC5B,MAAM,GAAG,EAA8B,CAAC;gBACxC,OAAO,GAAG,EAAE,CAAC;aACd;YAED,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;gBAC3C,QAAQ,GAAG,iBAAiB,CAAC;gBAC7B,OAAO,GAAG,EAAE,CAAC;aACd;YAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;YACjE,MAAM,UAAU,GAAG;gBACjB,OAAO,EAAE,MAAM,CAAC,MAAM,CACpB;oBACE,GAAG,EAAE,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC;oBAC1D,MAAM,EAAE,MAAM;oBACd,UAAU,EAAE,EAAE;iBACf,EACD,OAAO,CACR;gBACD,MAAM;gBACN,cAAc,EAAE,EAAE;gBAClB,UAAU,EAAE,EAAE;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;YACF,IAAI,QAAQ,EAAE;gBACZ,IAAA,oCAAgB,EACd,UAAU,EACV,QAAyC,CAC1C,CAAC;aACH;iBAAM;gBACL,OAAO,IAAA,oCAAgB,EACrB,UAAU,CACX,CAAC;aACH;QACH,CAAC;KACF;IAnKY,kBAAW,cAmKvB,CAAA;AAQH,CAAC,EAnbgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAmbtB"}
|
package/build/v1beta.d.ts
CHANGED
|
@@ -161,7 +161,7 @@ export declare namespace sts_v1beta {
|
|
|
161
161
|
*/
|
|
162
162
|
requestedTokenType?: string | null;
|
|
163
163
|
/**
|
|
164
|
-
* The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings. Required when exchanging an external credential for a Google access token.
|
|
164
|
+
* The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings; for example, `https://www.googleapis.com/auth/cloud-platform`. Required when exchanging an external credential for a Google access token. For a list of OAuth 2.0 scopes, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes).
|
|
165
165
|
*/
|
|
166
166
|
scope?: string | null;
|
|
167
167
|
/**
|
|
@@ -246,6 +246,66 @@ export declare namespace sts_v1beta {
|
|
|
246
246
|
constructor(context: APIRequestContext);
|
|
247
247
|
/**
|
|
248
248
|
* Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within a workload identity pool, or it applies a Credential Access Boundary to a Google access token. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
|
|
249
|
+
* @example
|
|
250
|
+
* ```js
|
|
251
|
+
* // Before running the sample:
|
|
252
|
+
* // - Enable the API at:
|
|
253
|
+
* // https://console.developers.google.com/apis/api/sts.googleapis.com
|
|
254
|
+
* // - Login into gcloud by running:
|
|
255
|
+
* // ```sh
|
|
256
|
+
* // $ gcloud auth application-default login
|
|
257
|
+
* // ```
|
|
258
|
+
* // - Install the npm module by running:
|
|
259
|
+
* // ```sh
|
|
260
|
+
* // $ npm install googleapis
|
|
261
|
+
* // ```
|
|
262
|
+
*
|
|
263
|
+
* const {google} = require('googleapis');
|
|
264
|
+
* const sts = google.sts('v1beta');
|
|
265
|
+
*
|
|
266
|
+
* async function main() {
|
|
267
|
+
* const auth = new google.auth.GoogleAuth({
|
|
268
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
269
|
+
* scopes: [],
|
|
270
|
+
* });
|
|
271
|
+
*
|
|
272
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
273
|
+
* const authClient = await auth.getClient();
|
|
274
|
+
* google.options({auth: authClient});
|
|
275
|
+
*
|
|
276
|
+
* // Do the magic
|
|
277
|
+
* const res = await sts.token({
|
|
278
|
+
* // Request body metadata
|
|
279
|
+
* requestBody: {
|
|
280
|
+
* // request body parameters
|
|
281
|
+
* // {
|
|
282
|
+
* // "audience": "my_audience",
|
|
283
|
+
* // "grantType": "my_grantType",
|
|
284
|
+
* // "options": "my_options",
|
|
285
|
+
* // "requestedTokenType": "my_requestedTokenType",
|
|
286
|
+
* // "scope": "my_scope",
|
|
287
|
+
* // "subjectToken": "my_subjectToken",
|
|
288
|
+
* // "subjectTokenType": "my_subjectTokenType"
|
|
289
|
+
* // }
|
|
290
|
+
* },
|
|
291
|
+
* });
|
|
292
|
+
* console.log(res.data);
|
|
293
|
+
*
|
|
294
|
+
* // Example response
|
|
295
|
+
* // {
|
|
296
|
+
* // "access_token": "my_access_token",
|
|
297
|
+
* // "expires_in": 0,
|
|
298
|
+
* // "issued_token_type": "my_issued_token_type",
|
|
299
|
+
* // "token_type": "my_token_type"
|
|
300
|
+
* // }
|
|
301
|
+
* }
|
|
302
|
+
*
|
|
303
|
+
* main().catch(e => {
|
|
304
|
+
* console.error(e);
|
|
305
|
+
* throw e;
|
|
306
|
+
* });
|
|
307
|
+
*
|
|
308
|
+
* ```
|
|
249
309
|
*
|
|
250
310
|
* @param params - Parameters for request
|
|
251
311
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
package/build/v1beta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1beta.js","sourceRoot":"","sources":["../v1beta.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,UAAU,
|
|
1
|
+
{"version":3,"file":"v1beta.js","sourceRoot":"","sources":["../v1beta.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,UAAU,CA8a1B;AA9aD,WAAiB,UAAU;IAgEzB;;;;;;;;;;OAUG;IACH,MAAa,GAAG;QAId,YAAY,OAAsB,EAAE,MAA2B;YAC7D,IAAI,CAAC,OAAO,GAAG;gBACb,QAAQ,EAAE,OAAO,IAAI,EAAE;gBACvB,MAAM;aACP,CAAC;YAEF,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,CAAC;KACF;IAZY,cAAG,MAYf,CAAA;IA6KD,MAAa,eAAe;QAE1B,YAAY,OAA0B;YACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAmGD,KAAK,CACH,gBAGkC,EAClC,iBAIkC,EAClC,QAEkC;YAOlC,IAAI,MAAM,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAiC,CAAC;YACtE,IAAI,OAAO,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAkB,CAAC;YAEzD,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE;gBAC1C,QAAQ,GAAG,gBAAgB,CAAC;gBAC5B,MAAM,GAAG,EAAkC,CAAC;gBAC5C,OAAO,GAAG,EAAE,CAAC;aACd;YAED,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;gBAC3C,QAAQ,GAAG,iBAAiB,CAAC;gBAC7B,OAAO,GAAG,EAAE,CAAC;aACd;YAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;YACjE,MAAM,UAAU,GAAG;gBACjB,OAAO,EAAE,MAAM,CAAC,MAAM,CACpB;oBACE,GAAG,EAAE,CAAC,OAAO,GAAG,eAAe,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC;oBAC9D,MAAM,EAAE,MAAM;oBACd,UAAU,EAAE,EAAE;iBACf,EACD,OAAO,CACR;gBACD,MAAM;gBACN,cAAc,EAAE,EAAE;gBAClB,UAAU,EAAE,EAAE;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;YACF,IAAI,QAAQ,EAAE;gBACZ,IAAA,oCAAgB,EACd,UAAU,EACV,QAAyC,CAC1C,CAAC;aACH;iBAAM;gBACL,OAAO,IAAA,oCAAgB,EACrB,UAAU,CACX,CAAC;aACH;QACH,CAAC;KACF;IAlKY,0BAAe,kBAkK3B,CAAA;AAQH,CAAC,EA9agB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA8a1B"}
|
package/package.json
CHANGED
package/v1.ts
CHANGED
|
@@ -227,7 +227,7 @@ export namespace sts_v1 {
|
|
|
227
227
|
*/
|
|
228
228
|
requestedTokenType?: string | null;
|
|
229
229
|
/**
|
|
230
|
-
* The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings. Required when exchanging an external credential for a Google access token.
|
|
230
|
+
* The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings; for example, `https://www.googleapis.com/auth/cloud-platform`. Required when exchanging an external credential for a Google access token. For a list of OAuth 2.0 scopes, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes).
|
|
231
231
|
*/
|
|
232
232
|
scope?: string | null;
|
|
233
233
|
/**
|
|
@@ -307,6 +307,67 @@ export namespace sts_v1 {
|
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
309
|
* Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundaries. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
|
|
310
|
+
* @example
|
|
311
|
+
* ```js
|
|
312
|
+
* // Before running the sample:
|
|
313
|
+
* // - Enable the API at:
|
|
314
|
+
* // https://console.developers.google.com/apis/api/sts.googleapis.com
|
|
315
|
+
* // - Login into gcloud by running:
|
|
316
|
+
* // ```sh
|
|
317
|
+
* // $ gcloud auth application-default login
|
|
318
|
+
* // ```
|
|
319
|
+
* // - Install the npm module by running:
|
|
320
|
+
* // ```sh
|
|
321
|
+
* // $ npm install googleapis
|
|
322
|
+
* // ```
|
|
323
|
+
*
|
|
324
|
+
* const {google} = require('googleapis');
|
|
325
|
+
* const sts = google.sts('v1');
|
|
326
|
+
*
|
|
327
|
+
* async function main() {
|
|
328
|
+
* const auth = new google.auth.GoogleAuth({
|
|
329
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
330
|
+
* scopes: [],
|
|
331
|
+
* });
|
|
332
|
+
*
|
|
333
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
334
|
+
* const authClient = await auth.getClient();
|
|
335
|
+
* google.options({auth: authClient});
|
|
336
|
+
*
|
|
337
|
+
* // Do the magic
|
|
338
|
+
* const res = await sts.token({
|
|
339
|
+
* // Request body metadata
|
|
340
|
+
* requestBody: {
|
|
341
|
+
* // request body parameters
|
|
342
|
+
* // {
|
|
343
|
+
* // "audience": "my_audience",
|
|
344
|
+
* // "grantType": "my_grantType",
|
|
345
|
+
* // "options": "my_options",
|
|
346
|
+
* // "requestedTokenType": "my_requestedTokenType",
|
|
347
|
+
* // "scope": "my_scope",
|
|
348
|
+
* // "subjectToken": "my_subjectToken",
|
|
349
|
+
* // "subjectTokenType": "my_subjectTokenType"
|
|
350
|
+
* // }
|
|
351
|
+
* },
|
|
352
|
+
* });
|
|
353
|
+
* console.log(res.data);
|
|
354
|
+
*
|
|
355
|
+
* // Example response
|
|
356
|
+
* // {
|
|
357
|
+
* // "access_boundary_session_key": "my_access_boundary_session_key",
|
|
358
|
+
* // "access_token": "my_access_token",
|
|
359
|
+
* // "expires_in": 0,
|
|
360
|
+
* // "issued_token_type": "my_issued_token_type",
|
|
361
|
+
* // "token_type": "my_token_type"
|
|
362
|
+
* // }
|
|
363
|
+
* }
|
|
364
|
+
*
|
|
365
|
+
* main().catch(e => {
|
|
366
|
+
* console.error(e);
|
|
367
|
+
* throw e;
|
|
368
|
+
* });
|
|
369
|
+
*
|
|
370
|
+
* ```
|
|
310
371
|
*
|
|
311
372
|
* @param params - Parameters for request
|
|
312
373
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
package/v1beta.ts
CHANGED
|
@@ -214,7 +214,7 @@ export namespace sts_v1beta {
|
|
|
214
214
|
*/
|
|
215
215
|
requestedTokenType?: string | null;
|
|
216
216
|
/**
|
|
217
|
-
* The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings. Required when exchanging an external credential for a Google access token.
|
|
217
|
+
* The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings; for example, `https://www.googleapis.com/auth/cloud-platform`. Required when exchanging an external credential for a Google access token. For a list of OAuth 2.0 scopes, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes).
|
|
218
218
|
*/
|
|
219
219
|
scope?: string | null;
|
|
220
220
|
/**
|
|
@@ -303,6 +303,66 @@ export namespace sts_v1beta {
|
|
|
303
303
|
|
|
304
304
|
/**
|
|
305
305
|
* Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within a workload identity pool, or it applies a Credential Access Boundary to a Google access token. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
|
|
306
|
+
* @example
|
|
307
|
+
* ```js
|
|
308
|
+
* // Before running the sample:
|
|
309
|
+
* // - Enable the API at:
|
|
310
|
+
* // https://console.developers.google.com/apis/api/sts.googleapis.com
|
|
311
|
+
* // - Login into gcloud by running:
|
|
312
|
+
* // ```sh
|
|
313
|
+
* // $ gcloud auth application-default login
|
|
314
|
+
* // ```
|
|
315
|
+
* // - Install the npm module by running:
|
|
316
|
+
* // ```sh
|
|
317
|
+
* // $ npm install googleapis
|
|
318
|
+
* // ```
|
|
319
|
+
*
|
|
320
|
+
* const {google} = require('googleapis');
|
|
321
|
+
* const sts = google.sts('v1beta');
|
|
322
|
+
*
|
|
323
|
+
* async function main() {
|
|
324
|
+
* const auth = new google.auth.GoogleAuth({
|
|
325
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
326
|
+
* scopes: [],
|
|
327
|
+
* });
|
|
328
|
+
*
|
|
329
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
330
|
+
* const authClient = await auth.getClient();
|
|
331
|
+
* google.options({auth: authClient});
|
|
332
|
+
*
|
|
333
|
+
* // Do the magic
|
|
334
|
+
* const res = await sts.token({
|
|
335
|
+
* // Request body metadata
|
|
336
|
+
* requestBody: {
|
|
337
|
+
* // request body parameters
|
|
338
|
+
* // {
|
|
339
|
+
* // "audience": "my_audience",
|
|
340
|
+
* // "grantType": "my_grantType",
|
|
341
|
+
* // "options": "my_options",
|
|
342
|
+
* // "requestedTokenType": "my_requestedTokenType",
|
|
343
|
+
* // "scope": "my_scope",
|
|
344
|
+
* // "subjectToken": "my_subjectToken",
|
|
345
|
+
* // "subjectTokenType": "my_subjectTokenType"
|
|
346
|
+
* // }
|
|
347
|
+
* },
|
|
348
|
+
* });
|
|
349
|
+
* console.log(res.data);
|
|
350
|
+
*
|
|
351
|
+
* // Example response
|
|
352
|
+
* // {
|
|
353
|
+
* // "access_token": "my_access_token",
|
|
354
|
+
* // "expires_in": 0,
|
|
355
|
+
* // "issued_token_type": "my_issued_token_type",
|
|
356
|
+
* // "token_type": "my_token_type"
|
|
357
|
+
* // }
|
|
358
|
+
* }
|
|
359
|
+
*
|
|
360
|
+
* main().catch(e => {
|
|
361
|
+
* console.error(e);
|
|
362
|
+
* throw e;
|
|
363
|
+
* });
|
|
364
|
+
*
|
|
365
|
+
* ```
|
|
306
366
|
*
|
|
307
367
|
* @param params - Parameters for request
|
|
308
368
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|