@googleapis/sts 3.3.5 → 4.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.0.1](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v4.0.0...sts-v4.0.1) (2024-05-02)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **sts:** update the API ([bce176a](https://github.com/googleapis/google-api-nodejs-client/commit/bce176a17c9e5ff821d2e6a058720f9f744e18b4))
9
+
10
+ ## [4.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v3.3.5...sts-v4.0.0) (2024-04-04)
11
+
12
+
13
+ ### ⚠ BREAKING CHANGES
14
+
15
+ * This release has breaking changes.
16
+
17
+ ### Features
18
+
19
+ * run the generator ([#3456](https://github.com/googleapis/google-api-nodejs-client/issues/3456)) ([a865e81](https://github.com/googleapis/google-api-nodejs-client/commit/a865e81539b315d3b321650663ba0b2555b1e5a1))
20
+
3
21
  ## [3.3.5](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v3.3.4...sts-v3.3.5) (2024-02-07)
4
22
 
5
23
 
package/build/v1.d.ts CHANGED
@@ -157,68 +157,6 @@ 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
- }
222
160
  /**
223
161
  * Request message for ExchangeToken.
224
162
  */
@@ -244,7 +182,7 @@ export declare namespace sts_v1 {
244
182
  */
245
183
  scope?: string | null;
246
184
  /**
247
- * Required. The input token. This token is either an external credential issued by a workload identity pool provider, or a short-lived access token issued by Google. If the token is an OIDC JWT, it must use the JWT format defined in [RFC 7523](https://tools.ietf.org/html/rfc7523), and the `subject_token_type` must be either `urn:ietf:params:oauth:token-type:jwt` or `urn:ietf:params:oauth:token-type:id_token`. The following headers are required: - `kid`: The identifier of the signing key securing the JWT. - `alg`: The cryptographic algorithm securing the JWT. Must be `RS256` or `ES256`. The following payload fields are required. For more information, see [RFC 7523, Section 3](https://tools.ietf.org/html/rfc7523#section-3): - `iss`: The issuer of the token. The issuer must provide a discovery document at the URL `/.well-known/openid-configuration`, where `` is the value of this field. The document must be formatted according to section 4.2 of the [OIDC 1.0 Discovery specification](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse). - `iat`: The issue time, in seconds, since the Unix epoch. Must be in the past. - `exp`: The expiration time, in seconds, since the Unix epoch. Must be less than 48 hours after `iat`. Shorter expiration times are more secure. If possible, we recommend setting an expiration time less than 6 hours. - `sub`: The identity asserted in the JWT. - `aud`: For workload identity pools, this must be a value specified in the allowed audiences for the workload identity pool provider, or one of the audiences allowed by default if no audiences were specified. See https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.workloadIdentityPools.providers#oidc. For workforce pools, this must match the client ID specified in the provider configuration. See https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools.providers#oidc. Example header: ``` { "alg": "RS256", "kid": "us-east-11" \} ``` Example payload: ``` { "iss": "https://accounts.google.com", "iat": 1517963104, "exp": 1517966704, "aud": "//iam.googleapis.com/projects/1234567890123/locations/global/workloadIdentityPools/my-pool/providers/my-provider", "sub": "113475438248934895348", "my_claims": { "additional_claim": "value" \} \} ``` If `subject_token` is for AWS, it must be a serialized `GetCallerIdentity` token. This token contains the same information as a request to the AWS [`GetCallerIdentity()`](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity) method, as well as the AWS [signature](https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) for the request information. Use Signature Version 4. Format the request as URL-encoded JSON, and set the `subject_token_type` parameter to `urn:ietf:params:aws:token-type:aws4_request`. The following parameters are required: - `url`: The URL of the AWS STS endpoint for `GetCallerIdentity()`, such as `https://sts.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15`. Regional endpoints are also supported. - `method`: The HTTP request method: `POST`. - `headers`: The HTTP request headers, which must include: - `Authorization`: The request signature. - `x-amz-date`: The time you will send the request, formatted as an [ISO8601 Basic](https://docs.aws.amazon.com/general/latest/gr/sigv4_elements.html#sigv4_elements_date) string. This value is typically set to the current time and is used to help prevent replay attacks. - `host`: The hostname of the `url` field; for example, `sts.amazonaws.com`. - `x-goog-cloud-target-resource`: The full, canonical resource name of the workload identity pool provider, with or without an `https:` prefix. To help ensure data integrity, we recommend including this header in the `SignedHeaders` field of the signed request. For example: //iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/ https://iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/ If you are using temporary security credentials provided by AWS, you must also include the header `x-amz-security-token`, with the value set to the session token. The following example shows a `GetCallerIdentity` token: ``` { "headers": [ {"key": "x-amz-date", "value": "20200815T015049Z"\}, {"key": "Authorization", "value": "AWS4-HMAC-SHA256+Credential=$credential,+SignedHeaders=host;x-amz-date;x-goog-cloud-target-resource,+Signature=$signature"\}, {"key": "x-goog-cloud-target-resource", "value": "//iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/"\}, {"key": "host", "value": "sts.amazonaws.com"\} . ], "method": "POST", "url": "https://sts.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" \} ``` If the token is a SAML 2.0 assertion, it must use the format defined in [the SAML 2.0 spec](https://www.oasis-open.org/committees/download.php/56776/sstc-saml-core-errata-2.0-wd-07.pdf), and the `subject_token_type` must be `urn:ietf:params:oauth:token-type:saml2`. See [Verification of external credentials](https://cloud.google.com/iam/docs/using-workload-identity-federation#verification_of_external_credentials) for details on how SAML 2.0 assertions are validated during token exchanges. You can also use a Google-issued OAuth 2.0 access token with this field to obtain an access token with new security attributes applied, such as a Credential Access Boundary. In this case, set `subject_token_type` to `urn:ietf:params:oauth:token-type:access_token`. If an access token already contains security attributes, you cannot apply additional security attributes.
185
+ * Required. The input token. This token is either an external credential issued by a workload identity pool provider, or a short-lived access token issued by Google. If the token is an OIDC JWT, it must use the JWT format defined in [RFC 7523](https://tools.ietf.org/html/rfc7523), and the `subject_token_type` must be either `urn:ietf:params:oauth:token-type:jwt` or `urn:ietf:params:oauth:token-type:id_token`. The following headers are required: - `kid`: The identifier of the signing key securing the JWT. - `alg`: The cryptographic algorithm securing the JWT. Must be `RS256` or `ES256`. The following payload fields are required. For more information, see [RFC 7523, Section 3](https://tools.ietf.org/html/rfc7523#section-3): - `iss`: The issuer of the token. The issuer must provide a discovery document at the URL `/.well-known/openid-configuration`, where `` is the value of this field. The document must be formatted according to section 4.2 of the [OIDC 1.0 Discovery specification](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse). - `iat`: The issue time, in seconds, since the Unix epoch. Must be in the past. - `exp`: The expiration time, in seconds, since the Unix epoch. Must be less than 48 hours after `iat`. Shorter expiration times are more secure. If possible, we recommend setting an expiration time less than 6 hours. - `sub`: The identity asserted in the JWT. - `aud`: For workload identity pools, this must be a value specified in the allowed audiences for the workload identity pool provider, or one of the audiences allowed by default if no audiences were specified. See https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.workloadIdentityPools.providers#oidc. For workforce pools, this must match the client ID specified in the provider configuration. See https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools.providers#oidc. Example header: ``` { "alg": "RS256", "kid": "us-east-11" \} ``` Example payload: ``` { "iss": "https://accounts.google.com", "iat": 1517963104, "exp": 1517966704, "aud": "//iam.googleapis.com/projects/1234567890123/locations/global/workloadIdentityPools/my-pool/providers/my-provider", "sub": "113475438248934895348", "my_claims": { "additional_claim": "value" \} \} ``` If `subject_token` is for AWS, it must be a serialized `GetCallerIdentity` token. This token contains the same information as a request to the AWS [`GetCallerIdentity()`](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity) method, as well as the AWS [signature](https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) for the request information. Use Signature Version 4. Format the request as URL-encoded JSON, and set the `subject_token_type` parameter to `urn:ietf:params:aws:token-type:aws4_request`. The following parameters are required: - `url`: The URL of the AWS STS endpoint for `GetCallerIdentity()`, such as `https://sts.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15`. Regional endpoints are also supported. - `method`: The HTTP request method: `POST`. - `headers`: The HTTP request headers, which must include: - `Authorization`: The request signature. - `x-amz-date`: The time you will send the request, formatted as an [ISO8601 Basic](https://docs.aws.amazon.com/general/latest/gr/sigv4_elements.html#sigv4_elements_date) string. This value is typically set to the current time and is used to help prevent replay attacks. - `host`: The hostname of the `url` field; for example, `sts.amazonaws.com`. - `x-goog-cloud-target-resource`: The full, canonical resource name of the workload identity pool provider, with or without an `https:` prefix. To help ensure data integrity, we recommend including this header in the `SignedHeaders` field of the signed request. For example: //iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/ https://iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/ If you are using temporary security credentials provided by AWS, you must also include the header `x-amz-security-token`, with the value set to the session token. The following example shows a `GetCallerIdentity` token: ``` { "headers": [ {"key": "x-amz-date", "value": "20200815T015049Z"\}, {"key": "Authorization", "value": "AWS4-HMAC-SHA256+Credential=$credential,+SignedHeaders=host;x-amz-date;x-goog-cloud-target-resource,+Signature=$signature"\}, {"key": "x-goog-cloud-target-resource", "value": "//iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/"\}, {"key": "host", "value": "sts.amazonaws.com"\} . ], "method": "POST", "url": "https://sts.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" \} ``` If the token is a SAML 2.0 assertion, it must use the format defined in [the SAML 2.0 spec](https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0-cd-02.pdf), and the `subject_token_type` must be `urn:ietf:params:oauth:token-type:saml2`. See [Verification of external credentials](https://cloud.google.com/iam/docs/using-workload-identity-federation#verification_of_external_credentials) for details on how SAML 2.0 assertions are validated during token exchanges. You can also use a Google-issued OAuth 2.0 access token with this field to obtain an access token with new security attributes applied, such as a Credential Access Boundary. In this case, set `subject_token_type` to `urn:ietf:params:oauth:token-type:access_token`. If an access token already contains security attributes, you cannot apply additional security attributes.
248
186
  */
249
187
  subjectToken?: string | null;
250
188
  /**
@@ -273,56 +211,6 @@ export declare namespace sts_v1 {
273
211
  */
274
212
  token_type?: string | null;
275
213
  }
276
- /**
277
- * Request message for IntrospectToken.
278
- */
279
- export interface Schema$GoogleIdentityStsV1IntrospectTokenRequest {
280
- /**
281
- * Required. The OAuth 2.0 security token issued by the Security Token Service API.
282
- */
283
- token?: string | null;
284
- /**
285
- * Optional. The type of the given token. Supported values are `urn:ietf:params:oauth:token-type:access_token` and `access_token`.
286
- */
287
- tokenTypeHint?: string | null;
288
- }
289
- /**
290
- * Response message for IntrospectToken.
291
- */
292
- export interface Schema$GoogleIdentityStsV1IntrospectTokenResponse {
293
- /**
294
- * A boolean value that indicates whether the provided access token is currently active.
295
- */
296
- active?: boolean | null;
297
- /**
298
- * The client identifier for the OAuth 2.0 client that requested the provided token.
299
- */
300
- client_id?: string | null;
301
- /**
302
- * The expiration timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire.
303
- */
304
- exp?: string | null;
305
- /**
306
- * The issued timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token was originally issued.
307
- */
308
- iat?: string | null;
309
- /**
310
- * The issuer of the provided token.
311
- */
312
- iss?: string | null;
313
- /**
314
- * A list of scopes associated with the provided token.
315
- */
316
- scope?: string | null;
317
- /**
318
- * The unique user ID associated with the provided token. For Google Accounts, this value is based on the Google Account's user ID. For federated identities, this value is based on the identity pool ID and the value of the mapped `google.subject` attribute.
319
- */
320
- sub?: string | null;
321
- /**
322
- * The human-readable identifier for the token principal subject. For example, if the provided token is associated with a workload identity pool, this field contains a value in the following format: `principal://iam.googleapis.com/projects//locations/global/workloadIdentityPools//subject/`. If the provided token is associated with a workforce pool, this field contains a value in the following format: `principal://iam.googleapis.com/locations/global/workforcePools//subject/`.
323
- */
324
- username?: string | null;
325
- }
326
214
  /**
327
215
  * An `Options` object configures features that the Security Token Service supports, but that are not supported by standard OAuth 2.0 token exchange endpoints, as defined in https://tools.ietf.org/html/rfc8693.
328
216
  */
@@ -364,34 +252,6 @@ export declare namespace sts_v1 {
364
252
  export class Resource$V1 {
365
253
  context: APIRequestContext;
366
254
  constructor(context: APIRequestContext);
367
- /**
368
- * Gets information about a Google OAuth 2.0 access token issued by the Google Cloud [Security Token Service API](https://cloud.google.com/iam/docs/reference/sts/rest).
369
- *
370
- * @param params - Parameters for request
371
- * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
372
- * @param callback - Optional callback that handles the response.
373
- * @returns A promise if used with async/await, or void if used with a callback.
374
- */
375
- introspect(params: Params$Resource$V1$Introspect, options: StreamMethodOptions): GaxiosPromise<Readable>;
376
- introspect(params?: Params$Resource$V1$Introspect, options?: MethodOptions): GaxiosPromise<Schema$GoogleIdentityStsV1IntrospectTokenResponse>;
377
- introspect(params: Params$Resource$V1$Introspect, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
378
- introspect(params: Params$Resource$V1$Introspect, options: MethodOptions | BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>): void;
379
- introspect(params: Params$Resource$V1$Introspect, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>): void;
380
- introspect(callback: BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>): void;
381
- /**
382
- * 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.
383
- *
384
- * @param params - Parameters for request
385
- * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
386
- * @param callback - Optional callback that handles the response.
387
- * @returns A promise if used with async/await, or void if used with a callback.
388
- */
389
- oauthtoken(params: Params$Resource$V1$Oauthtoken, options: StreamMethodOptions): GaxiosPromise<Readable>;
390
- oauthtoken(params?: Params$Resource$V1$Oauthtoken, options?: MethodOptions): GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>;
391
- oauthtoken(params: Params$Resource$V1$Oauthtoken, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
392
- oauthtoken(params: Params$Resource$V1$Oauthtoken, options: MethodOptions | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>): void;
393
- oauthtoken(params: Params$Resource$V1$Oauthtoken, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>): void;
394
- oauthtoken(callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>): void;
395
255
  /**
396
256
  * 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.
397
257
  *
@@ -407,18 +267,6 @@ export declare namespace sts_v1 {
407
267
  token(params: Params$Resource$V1$Token, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeTokenResponse>): void;
408
268
  token(callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeTokenResponse>): void;
409
269
  }
410
- export interface Params$Resource$V1$Introspect extends StandardParameters {
411
- /**
412
- * Request body metadata
413
- */
414
- requestBody?: Schema$GoogleIdentityStsV1IntrospectTokenRequest;
415
- }
416
- export interface Params$Resource$V1$Oauthtoken extends StandardParameters {
417
- /**
418
- * Request body metadata
419
- */
420
- requestBody?: Schema$GoogleIdentityStsV1ExchangeOauthTokenRequest;
421
- }
422
270
  export interface Params$Resource$V1$Token extends StandardParameters {
423
271
  /**
424
272
  * Request body metadata
package/build/v1.js CHANGED
@@ -46,66 +46,6 @@ var sts_v1;
46
46
  constructor(context) {
47
47
  this.context = context;
48
48
  }
49
- introspect(paramsOrCallback, optionsOrCallback, callback) {
50
- let params = (paramsOrCallback || {});
51
- let options = (optionsOrCallback || {});
52
- if (typeof paramsOrCallback === 'function') {
53
- callback = paramsOrCallback;
54
- params = {};
55
- options = {};
56
- }
57
- if (typeof optionsOrCallback === 'function') {
58
- callback = optionsOrCallback;
59
- options = {};
60
- }
61
- const rootUrl = options.rootUrl || 'https://sts.googleapis.com/';
62
- const parameters = {
63
- options: Object.assign({
64
- url: (rootUrl + '/v1/introspect').replace(/([^:]\/)\/+/g, '$1'),
65
- method: 'POST',
66
- }, options),
67
- params,
68
- requiredParams: [],
69
- pathParams: [],
70
- context: this.context,
71
- };
72
- if (callback) {
73
- (0, googleapis_common_1.createAPIRequest)(parameters, callback);
74
- }
75
- else {
76
- return (0, googleapis_common_1.createAPIRequest)(parameters);
77
- }
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
- }
109
49
  token(paramsOrCallback, optionsOrCallback, callback) {
110
50
  let params = (paramsOrCallback || {});
111
51
  let options = (optionsOrCallback || {});
@@ -123,6 +63,7 @@ var sts_v1;
123
63
  options: Object.assign({
124
64
  url: (rootUrl + '/v1/token').replace(/([^:]\/)\/+/g, '$1'),
125
65
  method: 'POST',
66
+ apiVersion: '',
126
67
  }, options),
127
68
  params,
128
69
  requiredParams: [],
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;AACt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pB;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;IAlGY,kBAAW,cAkGvB,CAAA;AAQH,CAAC,EAtXgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAsXtB"}
package/build/v1beta.js CHANGED
@@ -63,6 +63,7 @@ var sts_v1beta;
63
63
  options: Object.assign({
64
64
  url: (rootUrl + '/v1beta/token').replace(/([^:]\/)\/+/g, '$1'),
65
65
  method: 'POST',
66
+ apiVersion: '',
66
67
  }, options),
67
68
  params,
68
69
  requiredParams: [],
@@ -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,CAqX1B;AArXD,WAAiB,UAAU;IAgEzB;;;;;;;;;;OAUG;IACH,MAAa,GAAG;QAId,YAAY,OAAsB,EAAE,MAA2B;YAC7D,IAAI,CAAC,OAAO,GAAG;gBACb,QAAQ,EA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AK,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;IAlGY,0BAAe,kBAkG3B,CAAA;AAQH,CAAC,EAtXgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAsX1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@googleapis/sts",
3
- "version": "3.3.5",
3
+ "version": "4.0.1",
4
4
  "description": "sts",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
package/v1.ts CHANGED
@@ -210,68 +210,6 @@ 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
- }
275
213
  /**
276
214
  * Request message for ExchangeToken.
277
215
  */
@@ -297,7 +235,7 @@ export namespace sts_v1 {
297
235
  */
298
236
  scope?: string | null;
299
237
  /**
300
- * Required. The input token. This token is either an external credential issued by a workload identity pool provider, or a short-lived access token issued by Google. If the token is an OIDC JWT, it must use the JWT format defined in [RFC 7523](https://tools.ietf.org/html/rfc7523), and the `subject_token_type` must be either `urn:ietf:params:oauth:token-type:jwt` or `urn:ietf:params:oauth:token-type:id_token`. The following headers are required: - `kid`: The identifier of the signing key securing the JWT. - `alg`: The cryptographic algorithm securing the JWT. Must be `RS256` or `ES256`. The following payload fields are required. For more information, see [RFC 7523, Section 3](https://tools.ietf.org/html/rfc7523#section-3): - `iss`: The issuer of the token. The issuer must provide a discovery document at the URL `/.well-known/openid-configuration`, where `` is the value of this field. The document must be formatted according to section 4.2 of the [OIDC 1.0 Discovery specification](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse). - `iat`: The issue time, in seconds, since the Unix epoch. Must be in the past. - `exp`: The expiration time, in seconds, since the Unix epoch. Must be less than 48 hours after `iat`. Shorter expiration times are more secure. If possible, we recommend setting an expiration time less than 6 hours. - `sub`: The identity asserted in the JWT. - `aud`: For workload identity pools, this must be a value specified in the allowed audiences for the workload identity pool provider, or one of the audiences allowed by default if no audiences were specified. See https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.workloadIdentityPools.providers#oidc. For workforce pools, this must match the client ID specified in the provider configuration. See https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools.providers#oidc. Example header: ``` { "alg": "RS256", "kid": "us-east-11" \} ``` Example payload: ``` { "iss": "https://accounts.google.com", "iat": 1517963104, "exp": 1517966704, "aud": "//iam.googleapis.com/projects/1234567890123/locations/global/workloadIdentityPools/my-pool/providers/my-provider", "sub": "113475438248934895348", "my_claims": { "additional_claim": "value" \} \} ``` If `subject_token` is for AWS, it must be a serialized `GetCallerIdentity` token. This token contains the same information as a request to the AWS [`GetCallerIdentity()`](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity) method, as well as the AWS [signature](https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) for the request information. Use Signature Version 4. Format the request as URL-encoded JSON, and set the `subject_token_type` parameter to `urn:ietf:params:aws:token-type:aws4_request`. The following parameters are required: - `url`: The URL of the AWS STS endpoint for `GetCallerIdentity()`, such as `https://sts.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15`. Regional endpoints are also supported. - `method`: The HTTP request method: `POST`. - `headers`: The HTTP request headers, which must include: - `Authorization`: The request signature. - `x-amz-date`: The time you will send the request, formatted as an [ISO8601 Basic](https://docs.aws.amazon.com/general/latest/gr/sigv4_elements.html#sigv4_elements_date) string. This value is typically set to the current time and is used to help prevent replay attacks. - `host`: The hostname of the `url` field; for example, `sts.amazonaws.com`. - `x-goog-cloud-target-resource`: The full, canonical resource name of the workload identity pool provider, with or without an `https:` prefix. To help ensure data integrity, we recommend including this header in the `SignedHeaders` field of the signed request. For example: //iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/ https://iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/ If you are using temporary security credentials provided by AWS, you must also include the header `x-amz-security-token`, with the value set to the session token. The following example shows a `GetCallerIdentity` token: ``` { "headers": [ {"key": "x-amz-date", "value": "20200815T015049Z"\}, {"key": "Authorization", "value": "AWS4-HMAC-SHA256+Credential=$credential,+SignedHeaders=host;x-amz-date;x-goog-cloud-target-resource,+Signature=$signature"\}, {"key": "x-goog-cloud-target-resource", "value": "//iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/"\}, {"key": "host", "value": "sts.amazonaws.com"\} . ], "method": "POST", "url": "https://sts.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" \} ``` If the token is a SAML 2.0 assertion, it must use the format defined in [the SAML 2.0 spec](https://www.oasis-open.org/committees/download.php/56776/sstc-saml-core-errata-2.0-wd-07.pdf), and the `subject_token_type` must be `urn:ietf:params:oauth:token-type:saml2`. See [Verification of external credentials](https://cloud.google.com/iam/docs/using-workload-identity-federation#verification_of_external_credentials) for details on how SAML 2.0 assertions are validated during token exchanges. You can also use a Google-issued OAuth 2.0 access token with this field to obtain an access token with new security attributes applied, such as a Credential Access Boundary. In this case, set `subject_token_type` to `urn:ietf:params:oauth:token-type:access_token`. If an access token already contains security attributes, you cannot apply additional security attributes.
238
+ * Required. The input token. This token is either an external credential issued by a workload identity pool provider, or a short-lived access token issued by Google. If the token is an OIDC JWT, it must use the JWT format defined in [RFC 7523](https://tools.ietf.org/html/rfc7523), and the `subject_token_type` must be either `urn:ietf:params:oauth:token-type:jwt` or `urn:ietf:params:oauth:token-type:id_token`. The following headers are required: - `kid`: The identifier of the signing key securing the JWT. - `alg`: The cryptographic algorithm securing the JWT. Must be `RS256` or `ES256`. The following payload fields are required. For more information, see [RFC 7523, Section 3](https://tools.ietf.org/html/rfc7523#section-3): - `iss`: The issuer of the token. The issuer must provide a discovery document at the URL `/.well-known/openid-configuration`, where `` is the value of this field. The document must be formatted according to section 4.2 of the [OIDC 1.0 Discovery specification](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse). - `iat`: The issue time, in seconds, since the Unix epoch. Must be in the past. - `exp`: The expiration time, in seconds, since the Unix epoch. Must be less than 48 hours after `iat`. Shorter expiration times are more secure. If possible, we recommend setting an expiration time less than 6 hours. - `sub`: The identity asserted in the JWT. - `aud`: For workload identity pools, this must be a value specified in the allowed audiences for the workload identity pool provider, or one of the audiences allowed by default if no audiences were specified. See https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.workloadIdentityPools.providers#oidc. For workforce pools, this must match the client ID specified in the provider configuration. See https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools.providers#oidc. Example header: ``` { "alg": "RS256", "kid": "us-east-11" \} ``` Example payload: ``` { "iss": "https://accounts.google.com", "iat": 1517963104, "exp": 1517966704, "aud": "//iam.googleapis.com/projects/1234567890123/locations/global/workloadIdentityPools/my-pool/providers/my-provider", "sub": "113475438248934895348", "my_claims": { "additional_claim": "value" \} \} ``` If `subject_token` is for AWS, it must be a serialized `GetCallerIdentity` token. This token contains the same information as a request to the AWS [`GetCallerIdentity()`](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity) method, as well as the AWS [signature](https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) for the request information. Use Signature Version 4. Format the request as URL-encoded JSON, and set the `subject_token_type` parameter to `urn:ietf:params:aws:token-type:aws4_request`. The following parameters are required: - `url`: The URL of the AWS STS endpoint for `GetCallerIdentity()`, such as `https://sts.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15`. Regional endpoints are also supported. - `method`: The HTTP request method: `POST`. - `headers`: The HTTP request headers, which must include: - `Authorization`: The request signature. - `x-amz-date`: The time you will send the request, formatted as an [ISO8601 Basic](https://docs.aws.amazon.com/general/latest/gr/sigv4_elements.html#sigv4_elements_date) string. This value is typically set to the current time and is used to help prevent replay attacks. - `host`: The hostname of the `url` field; for example, `sts.amazonaws.com`. - `x-goog-cloud-target-resource`: The full, canonical resource name of the workload identity pool provider, with or without an `https:` prefix. To help ensure data integrity, we recommend including this header in the `SignedHeaders` field of the signed request. For example: //iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/ https://iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/ If you are using temporary security credentials provided by AWS, you must also include the header `x-amz-security-token`, with the value set to the session token. The following example shows a `GetCallerIdentity` token: ``` { "headers": [ {"key": "x-amz-date", "value": "20200815T015049Z"\}, {"key": "Authorization", "value": "AWS4-HMAC-SHA256+Credential=$credential,+SignedHeaders=host;x-amz-date;x-goog-cloud-target-resource,+Signature=$signature"\}, {"key": "x-goog-cloud-target-resource", "value": "//iam.googleapis.com/projects//locations/global/workloadIdentityPools//providers/"\}, {"key": "host", "value": "sts.amazonaws.com"\} . ], "method": "POST", "url": "https://sts.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" \} ``` If the token is a SAML 2.0 assertion, it must use the format defined in [the SAML 2.0 spec](https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0-cd-02.pdf), and the `subject_token_type` must be `urn:ietf:params:oauth:token-type:saml2`. See [Verification of external credentials](https://cloud.google.com/iam/docs/using-workload-identity-federation#verification_of_external_credentials) for details on how SAML 2.0 assertions are validated during token exchanges. You can also use a Google-issued OAuth 2.0 access token with this field to obtain an access token with new security attributes applied, such as a Credential Access Boundary. In this case, set `subject_token_type` to `urn:ietf:params:oauth:token-type:access_token`. If an access token already contains security attributes, you cannot apply additional security attributes.
301
239
  */
302
240
  subjectToken?: string | null;
303
241
  /**
@@ -326,56 +264,6 @@ export namespace sts_v1 {
326
264
  */
327
265
  token_type?: string | null;
328
266
  }
329
- /**
330
- * Request message for IntrospectToken.
331
- */
332
- export interface Schema$GoogleIdentityStsV1IntrospectTokenRequest {
333
- /**
334
- * Required. The OAuth 2.0 security token issued by the Security Token Service API.
335
- */
336
- token?: string | null;
337
- /**
338
- * Optional. The type of the given token. Supported values are `urn:ietf:params:oauth:token-type:access_token` and `access_token`.
339
- */
340
- tokenTypeHint?: string | null;
341
- }
342
- /**
343
- * Response message for IntrospectToken.
344
- */
345
- export interface Schema$GoogleIdentityStsV1IntrospectTokenResponse {
346
- /**
347
- * A boolean value that indicates whether the provided access token is currently active.
348
- */
349
- active?: boolean | null;
350
- /**
351
- * The client identifier for the OAuth 2.0 client that requested the provided token.
352
- */
353
- client_id?: string | null;
354
- /**
355
- * The expiration timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire.
356
- */
357
- exp?: string | null;
358
- /**
359
- * The issued timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token was originally issued.
360
- */
361
- iat?: string | null;
362
- /**
363
- * The issuer of the provided token.
364
- */
365
- iss?: string | null;
366
- /**
367
- * A list of scopes associated with the provided token.
368
- */
369
- scope?: string | null;
370
- /**
371
- * The unique user ID associated with the provided token. For Google Accounts, this value is based on the Google Account's user ID. For federated identities, this value is based on the identity pool ID and the value of the mapped `google.subject` attribute.
372
- */
373
- sub?: string | null;
374
- /**
375
- * The human-readable identifier for the token principal subject. For example, if the provided token is associated with a workload identity pool, this field contains a value in the following format: `principal://iam.googleapis.com/projects//locations/global/workloadIdentityPools//subject/`. If the provided token is associated with a workforce pool, this field contains a value in the following format: `principal://iam.googleapis.com/locations/global/workforcePools//subject/`.
376
- */
377
- username?: string | null;
378
- }
379
267
  /**
380
268
  * An `Options` object configures features that the Security Token Service supports, but that are not supported by standard OAuth 2.0 token exchange endpoints, as defined in https://tools.ietf.org/html/rfc8693.
381
269
  */
@@ -421,190 +309,6 @@ export namespace sts_v1 {
421
309
  this.context = context;
422
310
  }
423
311
 
424
- /**
425
- * Gets information about a Google OAuth 2.0 access token issued by the Google Cloud [Security Token Service API](https://cloud.google.com/iam/docs/reference/sts/rest).
426
- *
427
- * @param params - Parameters for request
428
- * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
429
- * @param callback - Optional callback that handles the response.
430
- * @returns A promise if used with async/await, or void if used with a callback.
431
- */
432
- introspect(
433
- params: Params$Resource$V1$Introspect,
434
- options: StreamMethodOptions
435
- ): GaxiosPromise<Readable>;
436
- introspect(
437
- params?: Params$Resource$V1$Introspect,
438
- options?: MethodOptions
439
- ): GaxiosPromise<Schema$GoogleIdentityStsV1IntrospectTokenResponse>;
440
- introspect(
441
- params: Params$Resource$V1$Introspect,
442
- options: StreamMethodOptions | BodyResponseCallback<Readable>,
443
- callback: BodyResponseCallback<Readable>
444
- ): void;
445
- introspect(
446
- params: Params$Resource$V1$Introspect,
447
- options:
448
- | MethodOptions
449
- | BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>,
450
- callback: BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>
451
- ): void;
452
- introspect(
453
- params: Params$Resource$V1$Introspect,
454
- callback: BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>
455
- ): void;
456
- introspect(
457
- callback: BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>
458
- ): void;
459
- introspect(
460
- paramsOrCallback?:
461
- | Params$Resource$V1$Introspect
462
- | BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>
463
- | BodyResponseCallback<Readable>,
464
- optionsOrCallback?:
465
- | MethodOptions
466
- | StreamMethodOptions
467
- | BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>
468
- | BodyResponseCallback<Readable>,
469
- callback?:
470
- | BodyResponseCallback<Schema$GoogleIdentityStsV1IntrospectTokenResponse>
471
- | BodyResponseCallback<Readable>
472
- ):
473
- | void
474
- | GaxiosPromise<Schema$GoogleIdentityStsV1IntrospectTokenResponse>
475
- | GaxiosPromise<Readable> {
476
- let params = (paramsOrCallback || {}) as Params$Resource$V1$Introspect;
477
- let options = (optionsOrCallback || {}) as MethodOptions;
478
-
479
- if (typeof paramsOrCallback === 'function') {
480
- callback = paramsOrCallback;
481
- params = {} as Params$Resource$V1$Introspect;
482
- options = {};
483
- }
484
-
485
- if (typeof optionsOrCallback === 'function') {
486
- callback = optionsOrCallback;
487
- options = {};
488
- }
489
-
490
- const rootUrl = options.rootUrl || 'https://sts.googleapis.com/';
491
- const parameters = {
492
- options: Object.assign(
493
- {
494
- url: (rootUrl + '/v1/introspect').replace(/([^:]\/)\/+/g, '$1'),
495
- method: 'POST',
496
- },
497
- options
498
- ),
499
- params,
500
- requiredParams: [],
501
- pathParams: [],
502
- context: this.context,
503
- };
504
- if (callback) {
505
- createAPIRequest<Schema$GoogleIdentityStsV1IntrospectTokenResponse>(
506
- parameters,
507
- callback as BodyResponseCallback<unknown>
508
- );
509
- } else {
510
- return createAPIRequest<Schema$GoogleIdentityStsV1IntrospectTokenResponse>(
511
- parameters
512
- );
513
- }
514
- }
515
-
516
- /**
517
- * 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.
518
- *
519
- * @param params - Parameters for request
520
- * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
521
- * @param callback - Optional callback that handles the response.
522
- * @returns A promise if used with async/await, or void if used with a callback.
523
- */
524
- oauthtoken(
525
- params: Params$Resource$V1$Oauthtoken,
526
- options: StreamMethodOptions
527
- ): GaxiosPromise<Readable>;
528
- oauthtoken(
529
- params?: Params$Resource$V1$Oauthtoken,
530
- options?: MethodOptions
531
- ): GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>;
532
- oauthtoken(
533
- params: Params$Resource$V1$Oauthtoken,
534
- options: StreamMethodOptions | BodyResponseCallback<Readable>,
535
- callback: BodyResponseCallback<Readable>
536
- ): void;
537
- oauthtoken(
538
- params: Params$Resource$V1$Oauthtoken,
539
- options:
540
- | MethodOptions
541
- | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>,
542
- callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
543
- ): void;
544
- oauthtoken(
545
- params: Params$Resource$V1$Oauthtoken,
546
- callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
547
- ): void;
548
- oauthtoken(
549
- callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
550
- ): void;
551
- oauthtoken(
552
- paramsOrCallback?:
553
- | Params$Resource$V1$Oauthtoken
554
- | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
555
- | BodyResponseCallback<Readable>,
556
- optionsOrCallback?:
557
- | MethodOptions
558
- | StreamMethodOptions
559
- | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
560
- | BodyResponseCallback<Readable>,
561
- callback?:
562
- | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
563
- | BodyResponseCallback<Readable>
564
- ):
565
- | void
566
- | GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>
567
- | GaxiosPromise<Readable> {
568
- let params = (paramsOrCallback || {}) as Params$Resource$V1$Oauthtoken;
569
- let options = (optionsOrCallback || {}) as MethodOptions;
570
-
571
- if (typeof paramsOrCallback === 'function') {
572
- callback = paramsOrCallback;
573
- params = {} as Params$Resource$V1$Oauthtoken;
574
- options = {};
575
- }
576
-
577
- if (typeof optionsOrCallback === 'function') {
578
- callback = optionsOrCallback;
579
- options = {};
580
- }
581
-
582
- const rootUrl = options.rootUrl || 'https://sts.googleapis.com/';
583
- const parameters = {
584
- options: Object.assign(
585
- {
586
- url: (rootUrl + '/v1/oauthtoken').replace(/([^:]\/)\/+/g, '$1'),
587
- method: 'POST',
588
- },
589
- options
590
- ),
591
- params,
592
- requiredParams: [],
593
- pathParams: [],
594
- context: this.context,
595
- };
596
- if (callback) {
597
- createAPIRequest<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>(
598
- parameters,
599
- callback as BodyResponseCallback<unknown>
600
- );
601
- } else {
602
- return createAPIRequest<Schema$GoogleIdentityStsV1ExchangeOauthTokenResponse>(
603
- parameters
604
- );
605
- }
606
- }
607
-
608
312
  /**
609
313
  * 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.
610
314
  *
@@ -677,6 +381,7 @@ export namespace sts_v1 {
677
381
  {
678
382
  url: (rootUrl + '/v1/token').replace(/([^:]\/)\/+/g, '$1'),
679
383
  method: 'POST',
384
+ apiVersion: '',
680
385
  },
681
386
  options
682
387
  ),
@@ -698,18 +403,6 @@ export namespace sts_v1 {
698
403
  }
699
404
  }
700
405
 
701
- export interface Params$Resource$V1$Introspect extends StandardParameters {
702
- /**
703
- * Request body metadata
704
- */
705
- requestBody?: Schema$GoogleIdentityStsV1IntrospectTokenRequest;
706
- }
707
- export interface Params$Resource$V1$Oauthtoken extends StandardParameters {
708
- /**
709
- * Request body metadata
710
- */
711
- requestBody?: Schema$GoogleIdentityStsV1ExchangeOauthTokenRequest;
712
- }
713
406
  export interface Params$Resource$V1$Token extends StandardParameters {
714
407
  /**
715
408
  * Request body metadata
package/v1beta.ts CHANGED
@@ -381,6 +381,7 @@ export namespace sts_v1beta {
381
381
  {
382
382
  url: (rootUrl + '/v1beta/token').replace(/([^:]\/)\/+/g, '$1'),
383
383
  method: 'POST',
384
+ apiVersion: '',
384
385
  },
385
386
  options
386
387
  ),