@googleapis/sts 3.0.0 → 3.2.0

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v3.1.0...sts-v3.2.0) (2023-02-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * **sts:** update the API ([b6e069b](https://github.com/googleapis/google-api-nodejs-client/commit/b6e069bd1a5618685f949d97606feeb0204aa8fb))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **sts:** update the API ([df55772](https://github.com/googleapis/google-api-nodejs-client/commit/df5577227f9833b53c24dc9e03b08553a91f20da))
14
+
15
+ ## [3.1.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v3.0.0...sts-v3.1.0) (2022-12-22)
16
+
17
+
18
+ ### Features
19
+
20
+ * **sts:** update the API ([6329c89](https://github.com/googleapis/google-api-nodejs-client/commit/6329c89747d9e6e8a31804cac232ba231e5ce56b))
21
+
3
22
  ## [3.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v2.1.8...sts-v3.0.0) (2022-10-28)
4
23
 
5
24
 
package/build/v1.d.ts CHANGED
@@ -80,7 +80,7 @@ export declare namespace sts_v1 {
80
80
  */
81
81
  condition?: Schema$GoogleTypeExpr;
82
82
  /**
83
- * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid\}.svc.id.goog[{namespace\}/{kubernetes-sa\}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
83
+ * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid\}.svc.id.goog[{namespace\}/{kubernetes-sa\}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding.
84
84
  */
85
85
  members?: string[] | null;
86
86
  /**
@@ -157,6 +157,68 @@ export declare namespace sts_v1 {
157
157
  */
158
158
  userProject?: string | null;
159
159
  }
160
+ /**
161
+ * Request message for ExchangeOauthToken
162
+ */
163
+ export interface Schema$GoogleIdentityStsV1ExchangeOauthTokenRequest {
164
+ /**
165
+ * Optional. The client identifier for the OAuth 2.0 client that requested the provided token. It is REQUIRED when the [client] (https://www.rfc-editor.org/rfc/rfc6749#section-1.1) is not authenticating with the authorization server, i.e. when authentication method is [client authentication] (https://www.rfc-editor.org/rfc/rfc6749#section-3.2.1).
166
+ */
167
+ clientId?: string | null;
168
+ /**
169
+ * Optional. The authorization code that was previously from workforce identity federation's `authorize` endpoint. Required if the flow is authorization code flow, i.e. if grant_type is 'authorization_code'
170
+ */
171
+ code?: string | null;
172
+ /**
173
+ * Optional. The code verifier for the PKCE request, Google Cloud CLI originally generates it before the authorization request. PKCE is used to protect authorization code from interception attacks. See https://www.rfc-editor.org/rfc/rfc7636#section-1.1 and https://www.rfc-editor.org/rfc/rfc7636#section-3. It is required when the flow is authorization code flow, i.e. if grant_type is 'authorization_code'
174
+ */
175
+ codeVerifier?: string | null;
176
+ /**
177
+ * Required. The grant types are as follows: - 'authorization_code' : an authorization code flow, i.e. exchange of authorization code for the Oauth access token - 'refresh_token' : a refresh token flow, i.e. obtain a new access token by providing the refresh token. See https://www.rfc-editor.org/rfc/rfc6749#section-6
178
+ */
179
+ grantType?: string | null;
180
+ /**
181
+ * Optional. redirect_url is required when the flow is authorization code flow i.e. if grant_type is `authorization_code` See https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3
182
+ */
183
+ redirectUri?: string | null;
184
+ /**
185
+ * Optional. The Refresh token is the credential that is used to obtain a new access token when the current access token becomes invalid or expires. Required when using refresh token flow, i.e. if `grant_type` is 'refresh_token' See https://www.rfc-editor.org/rfc/rfc6749#section-1.5 and https://www.rfc-editor.org/rfc/rfc6749#section-6
186
+ */
187
+ refreshToken?: string | null;
188
+ /**
189
+ * Optional. An optional list of scopes that are requested for the token to be returned. See https://www.rfc-editor.org/rfc/rfc6749#section-3.3 Must be a list of space-delimited, case-sensitive strings. Note: Currently, the scopes in the request are not supported
190
+ */
191
+ scope?: string | null;
192
+ }
193
+ /**
194
+ * Response message for ExchangeOauthToken. see https://www.rfc-editor.org/rfc/rfc6749#section-5.1
195
+ */
196
+ export interface Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse {
197
+ /**
198
+ * An OAuth 2.0 security token, issued by Google, in response to the Oauth token exchange request for the authorization code and refresh token flows. The returned [access token](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.4). Tokens can vary in size, depending, in part, on the size of mapped claims, up to a maximum of 12288 bytes (12 KB). Google reserves the right to change the token size and the maximum length at any time.
199
+ */
200
+ access_token?: string | null;
201
+ /**
202
+ * The amount of time, in seconds, between the time when the access token was issued and the time when the access token will expires.
203
+ */
204
+ expires_in?: number | null;
205
+ /**
206
+ * Google issued ID token in response to the OAuth token exchange request for ID token flow.
207
+ */
208
+ id_token?: string | null;
209
+ /**
210
+ * A refresh token, issued by Google, in response to the OAuth token exchange request for refresh token flow
211
+ */
212
+ refresh_token?: string | null;
213
+ /**
214
+ * A list of scopes associated with the returned token.
215
+ */
216
+ scope?: string | null;
217
+ /**
218
+ * The type of token. Field reserved for RFC compliance. See https://www.rfc-editor.org/rfc/rfc6749#section-5.1
219
+ */
220
+ token_type?: string | null;
221
+ }
160
222
  /**
161
223
  * Request message for ExchangeToken.
162
224
  */
@@ -372,7 +434,79 @@ export declare namespace sts_v1 {
372
434
  introspect(params: Params$Resource$V1$Introspect, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>): void;
373
435
  introspect(callback: BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>): void;
374
436
  /**
375
- * 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 Boundary at the moment. 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.
437
+ * Exchanges a credential that represents the resource owner's authorization for a Google-generated [OAuth 2.0 access token] (https://www.rfc-editor.org/rfc/rfc6749#section-5) or [refreshes an accesstoken] (https://www.rfc-editor.org/rfc/rfc6749#section-6) following [the OAuth 2.0 authorization framework] (https://tools.ietf.org/html/rfc8693) The credential can be one of the following: - An authorization code issued by the workforce identity federation authorization endpoint - A [refresh token](https://www.rfc-editor.org/rfc/rfc6749#section-10.4) issued by this endpoint This endpoint is only meant to be called by the Google Cloud CLI. Also note that this API only accepts the authorization code issued for workforce pools.
438
+ * @example
439
+ * ```js
440
+ * // Before running the sample:
441
+ * // - Enable the API at:
442
+ * // https://console.developers.google.com/apis/api/sts.googleapis.com
443
+ * // - Login into gcloud by running:
444
+ * // `$ gcloud auth application-default login`
445
+ * // - Install the npm module by running:
446
+ * // `$ npm install googleapis`
447
+ *
448
+ * const {google} = require('googleapis');
449
+ * const sts = google.sts('v1');
450
+ *
451
+ * async function main() {
452
+ * const auth = new google.auth.GoogleAuth({
453
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
454
+ * scopes: [],
455
+ * });
456
+ *
457
+ * // Acquire an auth client, and bind it to all future calls
458
+ * const authClient = await auth.getClient();
459
+ * google.options({auth: authClient});
460
+ *
461
+ * // Do the magic
462
+ * const res = await sts.oauthtoken({
463
+ * // Request body metadata
464
+ * requestBody: {
465
+ * // request body parameters
466
+ * // {
467
+ * // "clientId": "my_clientId",
468
+ * // "code": "my_code",
469
+ * // "codeVerifier": "my_codeVerifier",
470
+ * // "grantType": "my_grantType",
471
+ * // "redirectUri": "my_redirectUri",
472
+ * // "refreshToken": "my_refreshToken",
473
+ * // "scope": "my_scope"
474
+ * // }
475
+ * },
476
+ * });
477
+ * console.log(res.data);
478
+ *
479
+ * // Example response
480
+ * // {
481
+ * // "access_token": "my_access_token",
482
+ * // "expires_in": 0,
483
+ * // "id_token": "my_id_token",
484
+ * // "refresh_token": "my_refresh_token",
485
+ * // "scope": "my_scope",
486
+ * // "token_type": "my_token_type"
487
+ * // }
488
+ * }
489
+ *
490
+ * main().catch(e => {
491
+ * console.error(e);
492
+ * throw e;
493
+ * });
494
+ *
495
+ * ```
496
+ *
497
+ * @param params - Parameters for request
498
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
499
+ * @param callback - Optional callback that handles the response.
500
+ * @returns A promise if used with async/await, or void if used with a callback.
501
+ */
502
+ oauthtoken(params: Params$Resource$V1$Oauthtoken, options: StreamMethodOptions): GaxiosPromise<Readable>;
503
+ oauthtoken(params?: Params$Resource$V1$Oauthtoken, options?: MethodOptions): GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>;
504
+ oauthtoken(params: Params$Resource$V1$Oauthtoken, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
505
+ oauthtoken(params: Params$Resource$V1$Oauthtoken, options: MethodOptions | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>): void;
506
+ oauthtoken(params: Params$Resource$V1$Oauthtoken, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>): void;
507
+ oauthtoken(callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>): void;
508
+ /**
509
+ * 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.
376
510
  * @example
377
511
  * ```js
378
512
  * // Before running the sample:
@@ -448,6 +582,12 @@ export declare namespace sts_v1 {
448
582
  */
449
583
  requestBody?: Schema$GoogleIdentityStsV1IntrospectTokenRequest;
450
584
  }
585
+ export interface Params$Resource$V1$Oauthtoken extends StandardParameters {
586
+ /**
587
+ * Request body metadata
588
+ */
589
+ requestBody?: Schema$GoogleIdentityStsV1ExchangeOauthTokenRequest;
590
+ }
451
591
  export interface Params$Resource$V1$Token extends StandardParameters {
452
592
  /**
453
593
  * Request body metadata
package/build/v1.js CHANGED
@@ -76,6 +76,36 @@ var sts_v1;
76
76
  return (0, googleapis_common_1.createAPIRequest)(parameters);
77
77
  }
78
78
  }
79
+ oauthtoken(paramsOrCallback, optionsOrCallback, callback) {
80
+ let params = (paramsOrCallback || {});
81
+ let options = (optionsOrCallback || {});
82
+ if (typeof paramsOrCallback === 'function') {
83
+ callback = paramsOrCallback;
84
+ params = {};
85
+ options = {};
86
+ }
87
+ if (typeof optionsOrCallback === 'function') {
88
+ callback = optionsOrCallback;
89
+ options = {};
90
+ }
91
+ const rootUrl = options.rootUrl || 'https://sts.googleapis.com/';
92
+ const parameters = {
93
+ options: Object.assign({
94
+ url: (rootUrl + '/v1/oauthtoken').replace(/([^:]\/)\/+/g, '$1'),
95
+ method: 'POST',
96
+ }, options),
97
+ params,
98
+ requiredParams: [],
99
+ pathParams: [],
100
+ context: this.context,
101
+ };
102
+ if (callback) {
103
+ (0, googleapis_common_1.createAPIRequest)(parameters, callback);
104
+ }
105
+ else {
106
+ return (0, googleapis_common_1.createAPIRequest)(parameters);
107
+ }
108
+ }
79
109
  token(paramsOrCallback, optionsOrCallback, callback) {
80
110
  let params = (paramsOrCallback || {});
81
111
  let options = (optionsOrCallback || {});
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,CAwnBtB;AAxnBD,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;IAuOD,MAAa,WAAW;QAEtB,YAAY,OAA0B;YACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QA4FD,UAAU,CACR,gBAGkC,EAClC,iBAIkC,EAClC,QAEkC;YAKlC,IAAI,MAAM,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAkC,CAAC;YACvE,IAAI,OAAO,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAkB,CAAC;YAEzD,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE;gBAC1C,QAAQ,GAAG,gBAAgB,CAAC;gBAC5B,MAAM,GAAG,EAAmC,CAAC;gBAC7C,OAAO,GAAG,EAAE,CAAC;aACd;YAED,IAAI,OAAO,iBA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AAO,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;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;IAlcY,kBAAW,cAkcvB,CAAA;AAoBH,CAAC,EAl1BgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAk1BtB"}
package/build/v1beta.d.ts CHANGED
@@ -80,7 +80,7 @@ export declare namespace sts_v1beta {
80
80
  */
81
81
  condition?: Schema$GoogleTypeExpr;
82
82
  /**
83
- * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid\}.svc.id.goog[{namespace\}/{kubernetes-sa\}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
83
+ * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid\}.svc.id.goog[{namespace\}/{kubernetes-sa\}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding.
84
84
  */
85
85
  members?: string[] | null;
86
86
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@googleapis/sts",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "sts",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -38,6 +38,6 @@
38
38
  "ts-loader": "^9.0.0",
39
39
  "typescript": "~4.8.4",
40
40
  "webpack": "^5.0.0",
41
- "webpack-cli": "^4.0.0"
41
+ "webpack-cli": "^5.0.0"
42
42
  }
43
43
  }
package/v1.ts CHANGED
@@ -133,7 +133,7 @@ export namespace sts_v1 {
133
133
  */
134
134
  condition?: Schema$GoogleTypeExpr;
135
135
  /**
136
- * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid\}.svc.id.goog[{namespace\}/{kubernetes-sa\}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
136
+ * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid\}.svc.id.goog[{namespace\}/{kubernetes-sa\}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding.
137
137
  */
138
138
  members?: string[] | null;
139
139
  /**
@@ -210,6 +210,68 @@ export namespace sts_v1 {
210
210
  */
211
211
  userProject?: string | null;
212
212
  }
213
+ /**
214
+ * Request message for ExchangeOauthToken
215
+ */
216
+ export interface Schema$GoogleIdentityStsV1ExchangeOauthTokenRequest {
217
+ /**
218
+ * Optional. The client identifier for the OAuth 2.0 client that requested the provided token. It is REQUIRED when the [client] (https://www.rfc-editor.org/rfc/rfc6749#section-1.1) is not authenticating with the authorization server, i.e. when authentication method is [client authentication] (https://www.rfc-editor.org/rfc/rfc6749#section-3.2.1).
219
+ */
220
+ clientId?: string | null;
221
+ /**
222
+ * Optional. The authorization code that was previously from workforce identity federation's `authorize` endpoint. Required if the flow is authorization code flow, i.e. if grant_type is 'authorization_code'
223
+ */
224
+ code?: string | null;
225
+ /**
226
+ * Optional. The code verifier for the PKCE request, Google Cloud CLI originally generates it before the authorization request. PKCE is used to protect authorization code from interception attacks. See https://www.rfc-editor.org/rfc/rfc7636#section-1.1 and https://www.rfc-editor.org/rfc/rfc7636#section-3. It is required when the flow is authorization code flow, i.e. if grant_type is 'authorization_code'
227
+ */
228
+ codeVerifier?: string | null;
229
+ /**
230
+ * Required. The grant types are as follows: - 'authorization_code' : an authorization code flow, i.e. exchange of authorization code for the Oauth access token - 'refresh_token' : a refresh token flow, i.e. obtain a new access token by providing the refresh token. See https://www.rfc-editor.org/rfc/rfc6749#section-6
231
+ */
232
+ grantType?: string | null;
233
+ /**
234
+ * Optional. redirect_url is required when the flow is authorization code flow i.e. if grant_type is `authorization_code` See https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3
235
+ */
236
+ redirectUri?: string | null;
237
+ /**
238
+ * Optional. The Refresh token is the credential that is used to obtain a new access token when the current access token becomes invalid or expires. Required when using refresh token flow, i.e. if `grant_type` is 'refresh_token' See https://www.rfc-editor.org/rfc/rfc6749#section-1.5 and https://www.rfc-editor.org/rfc/rfc6749#section-6
239
+ */
240
+ refreshToken?: string | null;
241
+ /**
242
+ * Optional. An optional list of scopes that are requested for the token to be returned. See https://www.rfc-editor.org/rfc/rfc6749#section-3.3 Must be a list of space-delimited, case-sensitive strings. Note: Currently, the scopes in the request are not supported
243
+ */
244
+ scope?: string | null;
245
+ }
246
+ /**
247
+ * Response message for ExchangeOauthToken. see https://www.rfc-editor.org/rfc/rfc6749#section-5.1
248
+ */
249
+ export interface Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse {
250
+ /**
251
+ * An OAuth 2.0 security token, issued by Google, in response to the Oauth token exchange request for the authorization code and refresh token flows. The returned [access token](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.4). Tokens can vary in size, depending, in part, on the size of mapped claims, up to a maximum of 12288 bytes (12 KB). Google reserves the right to change the token size and the maximum length at any time.
252
+ */
253
+ access_token?: string | null;
254
+ /**
255
+ * The amount of time, in seconds, between the time when the access token was issued and the time when the access token will expires.
256
+ */
257
+ expires_in?: number | null;
258
+ /**
259
+ * Google issued ID token in response to the OAuth token exchange request for ID token flow.
260
+ */
261
+ id_token?: string | null;
262
+ /**
263
+ * A refresh token, issued by Google, in response to the OAuth token exchange request for refresh token flow
264
+ */
265
+ refresh_token?: string | null;
266
+ /**
267
+ * A list of scopes associated with the returned token.
268
+ */
269
+ scope?: string | null;
270
+ /**
271
+ * The type of token. Field reserved for RFC compliance. See https://www.rfc-editor.org/rfc/rfc6749#section-5.1
272
+ */
273
+ token_type?: string | null;
274
+ }
213
275
  /**
214
276
  * Request message for ExchangeToken.
215
277
  */
@@ -507,7 +569,157 @@ export namespace sts_v1 {
507
569
  }
508
570
 
509
571
  /**
510
- * 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 Boundary at the moment. 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.
572
+ * Exchanges a credential that represents the resource owner's authorization for a Google-generated [OAuth 2.0 access token] (https://www.rfc-editor.org/rfc/rfc6749#section-5) or [refreshes an accesstoken] (https://www.rfc-editor.org/rfc/rfc6749#section-6) following [the OAuth 2.0 authorization framework] (https://tools.ietf.org/html/rfc8693) The credential can be one of the following: - An authorization code issued by the workforce identity federation authorization endpoint - A [refresh token](https://www.rfc-editor.org/rfc/rfc6749#section-10.4) issued by this endpoint This endpoint is only meant to be called by the Google Cloud CLI. Also note that this API only accepts the authorization code issued for workforce pools.
573
+ * @example
574
+ * ```js
575
+ * // Before running the sample:
576
+ * // - Enable the API at:
577
+ * // https://console.developers.google.com/apis/api/sts.googleapis.com
578
+ * // - Login into gcloud by running:
579
+ * // `$ gcloud auth application-default login`
580
+ * // - Install the npm module by running:
581
+ * // `$ npm install googleapis`
582
+ *
583
+ * const {google} = require('googleapis');
584
+ * const sts = google.sts('v1');
585
+ *
586
+ * async function main() {
587
+ * const auth = new google.auth.GoogleAuth({
588
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
589
+ * scopes: [],
590
+ * });
591
+ *
592
+ * // Acquire an auth client, and bind it to all future calls
593
+ * const authClient = await auth.getClient();
594
+ * google.options({auth: authClient});
595
+ *
596
+ * // Do the magic
597
+ * const res = await sts.oauthtoken({
598
+ * // Request body metadata
599
+ * requestBody: {
600
+ * // request body parameters
601
+ * // {
602
+ * // "clientId": "my_clientId",
603
+ * // "code": "my_code",
604
+ * // "codeVerifier": "my_codeVerifier",
605
+ * // "grantType": "my_grantType",
606
+ * // "redirectUri": "my_redirectUri",
607
+ * // "refreshToken": "my_refreshToken",
608
+ * // "scope": "my_scope"
609
+ * // }
610
+ * },
611
+ * });
612
+ * console.log(res.data);
613
+ *
614
+ * // Example response
615
+ * // {
616
+ * // "access_token": "my_access_token",
617
+ * // "expires_in": 0,
618
+ * // "id_token": "my_id_token",
619
+ * // "refresh_token": "my_refresh_token",
620
+ * // "scope": "my_scope",
621
+ * // "token_type": "my_token_type"
622
+ * // }
623
+ * }
624
+ *
625
+ * main().catch(e => {
626
+ * console.error(e);
627
+ * throw e;
628
+ * });
629
+ *
630
+ * ```
631
+ *
632
+ * @param params - Parameters for request
633
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
634
+ * @param callback - Optional callback that handles the response.
635
+ * @returns A promise if used with async/await, or void if used with a callback.
636
+ */
637
+ oauthtoken(
638
+ params: Params$Resource$V1$Oauthtoken,
639
+ options: StreamMethodOptions
640
+ ): GaxiosPromise<Readable>;
641
+ oauthtoken(
642
+ params?: Params$Resource$V1$Oauthtoken,
643
+ options?: MethodOptions
644
+ ): GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>;
645
+ oauthtoken(
646
+ params: Params$Resource$V1$Oauthtoken,
647
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
648
+ callback: BodyResponseCallback<Readable>
649
+ ): void;
650
+ oauthtoken(
651
+ params: Params$Resource$V1$Oauthtoken,
652
+ options:
653
+ | MethodOptions
654
+ | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>,
655
+ callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
656
+ ): void;
657
+ oauthtoken(
658
+ params: Params$Resource$V1$Oauthtoken,
659
+ callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
660
+ ): void;
661
+ oauthtoken(
662
+ callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
663
+ ): void;
664
+ oauthtoken(
665
+ paramsOrCallback?:
666
+ | Params$Resource$V1$Oauthtoken
667
+ | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
668
+ | BodyResponseCallback<Readable>,
669
+ optionsOrCallback?:
670
+ | MethodOptions
671
+ | StreamMethodOptions
672
+ | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
673
+ | BodyResponseCallback<Readable>,
674
+ callback?:
675
+ | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
676
+ | BodyResponseCallback<Readable>
677
+ ):
678
+ | void
679
+ | GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
680
+ | GaxiosPromise<Readable> {
681
+ let params = (paramsOrCallback || {}) as Params$Resource$V1$Oauthtoken;
682
+ let options = (optionsOrCallback || {}) as MethodOptions;
683
+
684
+ if (typeof paramsOrCallback === 'function') {
685
+ callback = paramsOrCallback;
686
+ params = {} as Params$Resource$V1$Oauthtoken;
687
+ options = {};
688
+ }
689
+
690
+ if (typeof optionsOrCallback === 'function') {
691
+ callback = optionsOrCallback;
692
+ options = {};
693
+ }
694
+
695
+ const rootUrl = options.rootUrl || 'https://sts.googleapis.com/';
696
+ const parameters = {
697
+ options: Object.assign(
698
+ {
699
+ url: (rootUrl + '/v1/oauthtoken').replace(/([^:]\/)\/+/g, '$1'),
700
+ method: 'POST',
701
+ },
702
+ options
703
+ ),
704
+ params,
705
+ requiredParams: [],
706
+ pathParams: [],
707
+ context: this.context,
708
+ };
709
+ if (callback) {
710
+ createAPIRequest<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>(
711
+ parameters,
712
+ callback as BodyResponseCallback<unknown>
713
+ );
714
+ } else {
715
+ return createAPIRequest<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>(
716
+ parameters
717
+ );
718
+ }
719
+ }
720
+
721
+ /**
722
+ * 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.
511
723
  * @example
512
724
  * ```js
513
725
  * // Before running the sample:
@@ -661,6 +873,12 @@ export namespace sts_v1 {
661
873
  */
662
874
  requestBody?: Schema$GoogleIdentityStsV1IntrospectTokenRequest;
663
875
  }
876
+ export interface Params$Resource$V1$Oauthtoken extends StandardParameters {
877
+ /**
878
+ * Request body metadata
879
+ */
880
+ requestBody?: Schema$GoogleIdentityStsV1ExchangeOauthTokenRequest;
881
+ }
664
882
  export interface Params$Resource$V1$Token extends StandardParameters {
665
883
  /**
666
884
  * Request body metadata
package/v1beta.ts CHANGED
@@ -133,7 +133,7 @@ export namespace sts_v1beta {
133
133
  */
134
134
  condition?: Schema$GoogleTypeExpr;
135
135
  /**
136
- * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid\}.svc.id.goog[{namespace\}/{kubernetes-sa\}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
136
+ * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid\}.svc.id.goog[{namespace\}/{kubernetes-sa\}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding.
137
137
  */
138
138
  members?: string[] | null;
139
139
  /**