Skip to content

Commit 3ab0938

Browse files
fix(sts): update the API
#### sts:v1beta The following keys were changed: - endpoints - schemas.GoogleIdentityStsV1betaExchangeTokenRequest.properties.scope.description #### sts:v1 The following keys were changed: - endpoints - schemas.GoogleIdentityStsV1ExchangeTokenRequest.properties.scope.description
1 parent 8103a64 commit 3ab0938

File tree

4 files changed

+137
-6
lines changed

4 files changed

+137
-6
lines changed

discovery/sts-v1.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
"endpointUrl": "https://sts.asia-east1.rep.googleapis.com/",
1818
"location": "asia-east1"
1919
},
20+
{
21+
"description": "Regional Endpoint",
22+
"endpointUrl": "https://sts.asia-east2.rep.googleapis.com/",
23+
"location": "asia-east2"
24+
},
2025
{
2126
"description": "Regional Endpoint",
2227
"endpointUrl": "https://sts.asia-northeast1.rep.googleapis.com/",
@@ -333,7 +338,7 @@
333338
}
334339
}
335340
},
336-
"revision": "20250331",
341+
"revision": "20250521",
337342
"rootUrl": "https://sts.googleapis.com/",
338343
"schemas": {
339344
"GoogleIamV1Binding": {
@@ -415,7 +420,7 @@
415420
"type": "string"
416421
},
417422
"scope": {
418-
"description": "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.",
423+
"description": "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).",
419424
"type": "string"
420425
},
421426
"subjectToken": {

discovery/sts-v1beta.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
"endpointUrl": "https://sts.asia-east1.rep.googleapis.com/",
1818
"location": "asia-east1"
1919
},
20+
{
21+
"description": "Regional Endpoint",
22+
"endpointUrl": "https://sts.asia-east2.rep.googleapis.com/",
23+
"location": "asia-east2"
24+
},
2025
{
2126
"description": "Regional Endpoint",
2227
"endpointUrl": "https://sts.asia-northeast1.rep.googleapis.com/",
@@ -333,7 +338,7 @@
333338
}
334339
}
335340
},
336-
"revision": "20250331",
341+
"revision": "20250521",
337342
"rootUrl": "https://sts.googleapis.com/",
338343
"schemas": {
339344
"GoogleIamV1Binding": {
@@ -466,7 +471,7 @@
466471
"type": "string"
467472
},
468473
"scope": {
469-
"description": "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.",
474+
"description": "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).",
470475
"type": "string"
471476
},
472477
"subjectToken": {

src/apis/sts/v1.ts

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export namespace sts_v1 {
227227
*/
228228
requestedTokenType?: string | null;
229229
/**
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).
231231
*/
232232
scope?: string | null;
233233
/**
@@ -307,6 +307,67 @@ export namespace sts_v1 {
307307

308308
/**
309309
* 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+
* ```
310371
*
311372
* @param params - Parameters for request
312373
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.

src/apis/sts/v1beta.ts

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export namespace sts_v1beta {
214214
*/
215215
requestedTokenType?: string | null;
216216
/**
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).
218218
*/
219219
scope?: string | null;
220220
/**
@@ -303,6 +303,66 @@ export namespace sts_v1beta {
303303

304304
/**
305305
* 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+
* ```
306366
*
307367
* @param params - Parameters for request
308368
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.

0 commit comments

Comments
 (0)