@googleapis/sts 3.3.5 → 4.0.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 +11 -0
- package/build/v1.d.ts +0 -152
- package/build/v1.js +0 -60
- package/build/v1.js.map +1 -1
- package/package.json +1 -1
- package/v1.ts +0 -308
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v3.3.5...sts-v4.0.0) (2024-04-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* This release has breaking changes.
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* 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))
|
|
13
|
+
|
|
3
14
|
## [3.3.5](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v3.3.4...sts-v3.3.5) (2024-02-07)
|
|
4
15
|
|
|
5
16
|
|
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
|
*/
|
|
@@ -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 || {});
|
package/build/v1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../v1.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../v1.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,MAAM,CAqXtB;AArXD,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;IAqLD,MAAa,WAAW;QAEtB,YAAY,OAA0B;YACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAqCD,KAAK,CACH,gBAGkC,EAClC,iBAIkC,EAClC,QAEkC;YAKlC,IAAI,MAAM,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAA6B,CAAC;YAClE,IAAI,OAAO,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAkB,CAAC;YAEzD,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE;gBAC1C,QAAQ,GAAG,gBAAgB,CAAC;gBAC5B,MAAM,GAAG,EAA8B,CAAC;gBACxC,OAAO,GAAG,EAAE,CAAC;aACd;YAED,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;gBAC3C,QAAQ,GAAG,iBAAiB,CAAC;gBAC7B,OAAO,GAAG,EAAE,CAAC;aACd;YAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;YACjE,MAAM,UAAU,GAAG;gBACjB,OAAO,EAAE,MAAM,CAAC,MAAM,CACpB;oBACE,GAAG,EAAE,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC;oBAC1D,MAAM,EAAE,MAAM;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;IAjGY,kBAAW,cAiGvB,CAAA;AAQH,CAAC,EArXgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAqXtB"}
|
package/package.json
CHANGED
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
|
*/
|
|
@@ -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
|
*
|
|
@@ -698,18 +402,6 @@ export namespace sts_v1 {
|
|
|
698
402
|
}
|
|
699
403
|
}
|
|
700
404
|
|
|
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
405
|
export interface Params$Resource$V1$Token extends StandardParameters {
|
|
714
406
|
/**
|
|
715
407
|
* Request body metadata
|