@maxim_mazurok/gapi.client.verifiedaccess-v2 0.0.20231107 → 0.0.20231128
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/index.d.ts +233 -348
- package/package.json +6 -6
- package/readme.md +18 -15
- package/tests.ts +0 -43
- package/tsconfig.json +0 -18
- package/tslint.json +0 -6
package/index.d.ts
CHANGED
|
@@ -9,358 +9,243 @@
|
|
|
9
9
|
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
10
|
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
11
|
// Generated from: https://verifiedaccess.googleapis.com/$discovery/rest?version=v2
|
|
12
|
-
// Revision:
|
|
12
|
+
// Revision: 20231128
|
|
13
13
|
|
|
14
14
|
/// <reference types="gapi.client" />
|
|
15
15
|
|
|
16
16
|
declare namespace gapi.client {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
/** Load Chrome Verified Access API v2 */
|
|
18
|
+
function load(
|
|
19
|
+
urlOrObject: 'https://verifiedaccess.googleapis.com/$discovery/rest?version=v2'
|
|
20
|
+
): Promise<void>;
|
|
21
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
22
|
+
function load(name: 'verifiedaccess', version: 'v2'): Promise<void>;
|
|
23
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
24
|
+
function load(
|
|
25
|
+
name: 'verifiedaccess',
|
|
26
|
+
version: 'v2',
|
|
27
|
+
callback: () => any
|
|
28
|
+
): void;
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
passwordProtectionWarningTrigger?:
|
|
106
|
-
string;
|
|
107
|
-
/** Affiliation IDs of the organizations that are affiliated with the organization that is currently managing the Chrome Profile’s user or ChromeOS user. */
|
|
108
|
-
profileAffiliationIds?:
|
|
109
|
-
string[];
|
|
110
|
-
/**
|
|
111
|
-
* Whether Enterprise-grade (i.e. custom) unsafe URL scanning is enabled or not. This setting may be controlled by an enterprise policy:
|
|
112
|
-
* https://chromeenterprise.google/policies/#EnterpriseRealTimeUrlCheckMode
|
|
113
|
-
*/
|
|
114
|
-
realtimeUrlCheckMode?:
|
|
115
|
-
string;
|
|
116
|
-
/** Safe Browsing Protection Level. That setting may be controlled by an enterprise policy: https://chromeenterprise.google/policies/#SafeBrowsingProtectionLevel. */
|
|
117
|
-
safeBrowsingProtectionLevel?:
|
|
118
|
-
string;
|
|
119
|
-
/**
|
|
120
|
-
* The state of the Screen Lock password protection. On ChromeOS, this value will always be ENABLED as there is not way to disable requiring a password or pin when unlocking the
|
|
121
|
-
* device.
|
|
122
|
-
*/
|
|
123
|
-
screenLockSecured?:
|
|
124
|
-
string;
|
|
125
|
-
/** Whether the device's startup software has its Secure Boot feature enabled. Available on Windows only. */
|
|
126
|
-
secureBootMode?:
|
|
127
|
-
string;
|
|
128
|
-
/** The serial number of the device. On Windows, this represents the BIOS's serial number. Not available on most Linux distributions. */
|
|
129
|
-
serialNumber?:
|
|
130
|
-
string;
|
|
131
|
-
/**
|
|
132
|
-
* Whether the Site Isolation (a.k.a Site Per Process) setting is enabled. That setting may be controlled by an enterprise policy:
|
|
133
|
-
* https://chromeenterprise.google/policies/#SitePerProcess
|
|
134
|
-
*/
|
|
135
|
-
siteIsolationEnabled?:
|
|
136
|
-
boolean;
|
|
137
|
-
/** List of the addesses of all OS level DNS servers configured in the device's network settings. */
|
|
138
|
-
systemDnsServers?:
|
|
139
|
-
string[];
|
|
140
|
-
/**
|
|
141
|
-
* Whether Chrome is blocking third-party software injection or not. This setting may be controlled by an enterprise policy:
|
|
142
|
-
* https://chromeenterprise.google/policies/?policy=ThirdPartyBlockingEnabled. Available on Windows only.
|
|
143
|
-
*/
|
|
144
|
-
thirdPartyBlockingEnabled?:
|
|
145
|
-
boolean;
|
|
146
|
-
/** The trigger which generated this set of signals. */
|
|
147
|
-
trigger?:
|
|
148
|
-
string;
|
|
149
|
-
/** Windows domain that the current machine has joined. Available on Windows only. */
|
|
150
|
-
windowsMachineDomain?:
|
|
151
|
-
string;
|
|
152
|
-
/** Windows domain for the current OS user. Available on Windows only. */
|
|
153
|
-
windowsUserDomain?:
|
|
154
|
-
string;
|
|
155
|
-
}
|
|
156
|
-
// tslint:disable-next-line:no-empty-interface
|
|
157
|
-
interface Empty {
|
|
158
|
-
}
|
|
159
|
-
interface VerifyChallengeResponseRequest {
|
|
160
|
-
/** Required. The generated response to the challenge, the bytes representation of SignedData. */
|
|
161
|
-
challengeResponse?:
|
|
162
|
-
string;
|
|
163
|
-
/**
|
|
164
|
-
* Optional. Service can optionally provide identity information about the device or user associated with the key. For an EMK, this value is the enrolled domain. For an EUK, this value
|
|
165
|
-
* is the user's email address. If present, this value will be checked against contents of the response, and verification will fail if there is no match.
|
|
166
|
-
*/
|
|
167
|
-
expectedIdentity?:
|
|
168
|
-
string;
|
|
169
|
-
}
|
|
170
|
-
interface VerifyChallengeResponseResult {
|
|
171
|
-
/** Attested device ID (ADID). */
|
|
172
|
-
attestedDeviceId?:
|
|
173
|
-
string;
|
|
174
|
-
/** Unique customer id that this device belongs to, as defined by the Google Admin SDK at https://developers.google.com/admin-sdk/directory/v1/guides/manage-customers */
|
|
175
|
-
customerId?:
|
|
176
|
-
string;
|
|
177
|
-
/** Device enrollment id for ChromeOS devices. */
|
|
178
|
-
deviceEnrollmentId?:
|
|
179
|
-
string;
|
|
180
|
-
/** Device permanent id is returned in this field (for the machine response only). */
|
|
181
|
-
devicePermanentId?:
|
|
182
|
-
string;
|
|
183
|
-
/** Deprecated. Device signal in json string representation. Prefer using `device_signals` instead. */
|
|
184
|
-
deviceSignal?:
|
|
185
|
-
string;
|
|
186
|
-
/** Device signals. */
|
|
187
|
-
deviceSignals?:
|
|
188
|
-
DeviceSignals;
|
|
189
|
-
/** Device attested key trust level. */
|
|
190
|
-
keyTrustLevel?:
|
|
191
|
-
string;
|
|
192
|
-
/** Unique customer id that this profile belongs to, as defined by the Google Admin SDK at https://developers.google.com/admin-sdk/directory/v1/guides/manage-customers */
|
|
193
|
-
profileCustomerId?:
|
|
194
|
-
string;
|
|
195
|
-
/** Profile attested key trust level. */
|
|
196
|
-
profileKeyTrustLevel?:
|
|
197
|
-
string;
|
|
198
|
-
/**
|
|
199
|
-
* Certificate Signing Request (in the SPKAC format, base64 encoded) is returned in this field. This field will be set only if device has included CSR in its challenge response. (the
|
|
200
|
-
* option to include CSR is now available for both user and machine responses)
|
|
201
|
-
*/
|
|
202
|
-
signedPublicKeyAndChallenge?:
|
|
203
|
-
string;
|
|
204
|
-
/** Virtual device id of the device. The definition of virtual device id is platform-specific. */
|
|
205
|
-
virtualDeviceId?:
|
|
206
|
-
string;
|
|
207
|
-
/** The ID of a profile on the device. */
|
|
208
|
-
virtualProfileId?:
|
|
209
|
-
string;
|
|
210
|
-
}
|
|
211
|
-
interface ChallengeResource {
|
|
212
|
-
/** Generates a new challenge. */
|
|
213
|
-
generate(request: {
|
|
214
|
-
/** V1 error format. */
|
|
215
|
-
"$.xgafv"?:
|
|
216
|
-
string;
|
|
217
|
-
/** OAuth access token. */
|
|
218
|
-
access_token?:
|
|
219
|
-
string;
|
|
220
|
-
/** Data format for response. */
|
|
221
|
-
alt?:
|
|
222
|
-
string;
|
|
223
|
-
/** JSONP */
|
|
224
|
-
callback?:
|
|
225
|
-
string;
|
|
226
|
-
/** Selector specifying which fields to include in a partial response. */
|
|
227
|
-
fields?:
|
|
228
|
-
string;
|
|
229
|
-
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
230
|
-
key?:
|
|
231
|
-
string;
|
|
232
|
-
/** OAuth 2.0 token for the current user. */
|
|
233
|
-
oauth_token?:
|
|
234
|
-
string;
|
|
235
|
-
/** Returns response with indentations and line breaks. */
|
|
236
|
-
prettyPrint?:
|
|
237
|
-
boolean;
|
|
238
|
-
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
239
|
-
quotaUser?:
|
|
240
|
-
string;
|
|
241
|
-
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
242
|
-
upload_protocol?:
|
|
243
|
-
string;
|
|
244
|
-
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
245
|
-
uploadType?:
|
|
246
|
-
string;
|
|
247
|
-
/** Request body */
|
|
248
|
-
resource:
|
|
249
|
-
Empty;
|
|
250
|
-
}): Request<Challenge>;
|
|
251
|
-
generate(request: {
|
|
252
|
-
/** V1 error format. */
|
|
253
|
-
"$.xgafv"?:
|
|
254
|
-
string;
|
|
255
|
-
/** OAuth access token. */
|
|
256
|
-
access_token?:
|
|
257
|
-
string;
|
|
258
|
-
/** Data format for response. */
|
|
259
|
-
alt?:
|
|
260
|
-
string;
|
|
261
|
-
/** JSONP */
|
|
262
|
-
callback?:
|
|
263
|
-
string;
|
|
264
|
-
/** Selector specifying which fields to include in a partial response. */
|
|
265
|
-
fields?:
|
|
266
|
-
string;
|
|
267
|
-
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
268
|
-
key?:
|
|
269
|
-
string;
|
|
270
|
-
/** OAuth 2.0 token for the current user. */
|
|
271
|
-
oauth_token?:
|
|
272
|
-
string;
|
|
273
|
-
/** Returns response with indentations and line breaks. */
|
|
274
|
-
prettyPrint?:
|
|
275
|
-
boolean;
|
|
276
|
-
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
277
|
-
quotaUser?:
|
|
278
|
-
string;
|
|
279
|
-
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
280
|
-
upload_protocol?:
|
|
281
|
-
string;
|
|
282
|
-
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
283
|
-
uploadType?:
|
|
284
|
-
string;
|
|
285
|
-
},
|
|
286
|
-
body: Empty): Request<Challenge>;
|
|
287
|
-
/** Verifies the challenge response. */
|
|
288
|
-
verify(request: {
|
|
289
|
-
/** V1 error format. */
|
|
290
|
-
"$.xgafv"?:
|
|
291
|
-
string;
|
|
292
|
-
/** OAuth access token. */
|
|
293
|
-
access_token?:
|
|
294
|
-
string;
|
|
295
|
-
/** Data format for response. */
|
|
296
|
-
alt?:
|
|
297
|
-
string;
|
|
298
|
-
/** JSONP */
|
|
299
|
-
callback?:
|
|
300
|
-
string;
|
|
301
|
-
/** Selector specifying which fields to include in a partial response. */
|
|
302
|
-
fields?:
|
|
303
|
-
string;
|
|
304
|
-
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
305
|
-
key?:
|
|
306
|
-
string;
|
|
307
|
-
/** OAuth 2.0 token for the current user. */
|
|
308
|
-
oauth_token?:
|
|
309
|
-
string;
|
|
310
|
-
/** Returns response with indentations and line breaks. */
|
|
311
|
-
prettyPrint?:
|
|
312
|
-
boolean;
|
|
313
|
-
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
314
|
-
quotaUser?:
|
|
315
|
-
string;
|
|
316
|
-
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
317
|
-
upload_protocol?:
|
|
318
|
-
string;
|
|
319
|
-
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
320
|
-
uploadType?:
|
|
321
|
-
string;
|
|
322
|
-
/** Request body */
|
|
323
|
-
resource:
|
|
324
|
-
VerifyChallengeResponseRequest;
|
|
325
|
-
}): Request<VerifyChallengeResponseResult>;
|
|
326
|
-
verify(request: {
|
|
327
|
-
/** V1 error format. */
|
|
328
|
-
"$.xgafv"?:
|
|
329
|
-
string;
|
|
330
|
-
/** OAuth access token. */
|
|
331
|
-
access_token?:
|
|
332
|
-
string;
|
|
333
|
-
/** Data format for response. */
|
|
334
|
-
alt?:
|
|
335
|
-
string;
|
|
336
|
-
/** JSONP */
|
|
337
|
-
callback?:
|
|
338
|
-
string;
|
|
339
|
-
/** Selector specifying which fields to include in a partial response. */
|
|
340
|
-
fields?:
|
|
341
|
-
string;
|
|
342
|
-
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
343
|
-
key?:
|
|
344
|
-
string;
|
|
345
|
-
/** OAuth 2.0 token for the current user. */
|
|
346
|
-
oauth_token?:
|
|
347
|
-
string;
|
|
348
|
-
/** Returns response with indentations and line breaks. */
|
|
349
|
-
prettyPrint?:
|
|
350
|
-
boolean;
|
|
351
|
-
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
352
|
-
quotaUser?:
|
|
353
|
-
string;
|
|
354
|
-
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
355
|
-
upload_protocol?:
|
|
356
|
-
string;
|
|
357
|
-
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
358
|
-
uploadType?:
|
|
359
|
-
string;
|
|
360
|
-
},
|
|
361
|
-
body: VerifyChallengeResponseRequest): Request<VerifyChallengeResponseResult>;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
const challenge: ChallengeResource;
|
|
30
|
+
namespace verifiedaccess {
|
|
31
|
+
interface Challenge {
|
|
32
|
+
/** Generated challenge, the bytes representation of SignedData. */
|
|
33
|
+
challenge?: string;
|
|
34
|
+
}
|
|
35
|
+
interface CrowdStrikeAgent {
|
|
36
|
+
/** The Agent ID of the Crowdstrike agent. */
|
|
37
|
+
agentId?: string;
|
|
38
|
+
/** The Customer ID to which the agent belongs to. */
|
|
39
|
+
customerId?: string;
|
|
40
|
+
}
|
|
41
|
+
interface DeviceSignals {
|
|
42
|
+
/** Value of the AllowScreenLock policy on the device. See https://chromeenterprise.google/policies/?policy=AllowScreenLock for more details. Available on ChromeOS only. */
|
|
43
|
+
allowScreenLock?: boolean;
|
|
44
|
+
/** Current version of the Chrome browser which generated this set of signals. Example value: "107.0.5286.0". */
|
|
45
|
+
browserVersion?: string;
|
|
46
|
+
/** Whether Chrome's built-in DNS client is used. The OS DNS client is otherwise used. This value may be controlled by an enterprise policy: https://chromeenterprise.google/policies/#BuiltInDnsClientEnabled. */
|
|
47
|
+
builtInDnsClientEnabled?: boolean;
|
|
48
|
+
/** Whether access to the Chrome Remote Desktop application is blocked via a policy. */
|
|
49
|
+
chromeRemoteDesktopAppBlocked?: boolean;
|
|
50
|
+
/** Crowdstrike agent properties installed on the device, if any. Available on Windows and MacOS only. */
|
|
51
|
+
crowdStrikeAgent?: CrowdStrikeAgent;
|
|
52
|
+
/** Affiliation IDs of the organizations that are affiliated with the organization that is currently managing the device. When the sets of device and profile affiliation IDs overlap, it means that the organizations managing the device and user are affiliated. To learn more about user affiliation, visit https://support.google.com/chrome/a/answer/12801245?ref_topic=9027936. */
|
|
53
|
+
deviceAffiliationIds?: string[];
|
|
54
|
+
/** Enrollment domain of the customer which is currently managing the device. */
|
|
55
|
+
deviceEnrollmentDomain?: string;
|
|
56
|
+
/** The name of the device's manufacturer. */
|
|
57
|
+
deviceManufacturer?: string;
|
|
58
|
+
/** The name of the device's model. */
|
|
59
|
+
deviceModel?: string;
|
|
60
|
+
/** The encryption state of the disk. On ChromeOS, the main disk is always ENCRYPTED. */
|
|
61
|
+
diskEncryption?: string;
|
|
62
|
+
/** The display name of the device, as defined by the user. */
|
|
63
|
+
displayName?: string;
|
|
64
|
+
/** Hostname of the device. */
|
|
65
|
+
hostname?: string;
|
|
66
|
+
/** International Mobile Equipment Identity (IMEI) of the device. Available on ChromeOS only. */
|
|
67
|
+
imei?: string[];
|
|
68
|
+
/** MAC addresses of the device. */
|
|
69
|
+
macAddresses?: string[];
|
|
70
|
+
/** Mobile Equipment Identifier (MEID) of the device. Available on ChromeOS only. */
|
|
71
|
+
meid?: string[];
|
|
72
|
+
/** The type of the Operating System currently running on the device. */
|
|
73
|
+
operatingSystem?: string;
|
|
74
|
+
/** The state of the OS level firewall. On ChromeOS, the value will always be ENABLED on regular devices and UNKNOWN on devices in developer mode. */
|
|
75
|
+
osFirewall?: string;
|
|
76
|
+
/** The current version of the Operating System. On Windows and linux, the value will also include the security patch information. */
|
|
77
|
+
osVersion?: string;
|
|
78
|
+
/** Whether the Password Protection Warning feature is enabled or not. Password protection alerts users when they reuse their protected password on potentially suspicious sites. This setting is controlled by an enterprise policy: https://chromeenterprise.google/policies/#PasswordProtectionWarningTrigger. Note that the policy unset does not have the same effects as having the policy explicitly set to `PASSWORD_PROTECTION_OFF`. */
|
|
79
|
+
passwordProtectionWarningTrigger?: string;
|
|
80
|
+
/** Affiliation IDs of the organizations that are affiliated with the organization that is currently managing the Chrome Profile’s user or ChromeOS user. */
|
|
81
|
+
profileAffiliationIds?: string[];
|
|
82
|
+
/** Whether Enterprise-grade (i.e. custom) unsafe URL scanning is enabled or not. This setting may be controlled by an enterprise policy: https://chromeenterprise.google/policies/#EnterpriseRealTimeUrlCheckMode */
|
|
83
|
+
realtimeUrlCheckMode?: string;
|
|
84
|
+
/** Safe Browsing Protection Level. That setting may be controlled by an enterprise policy: https://chromeenterprise.google/policies/#SafeBrowsingProtectionLevel. */
|
|
85
|
+
safeBrowsingProtectionLevel?: string;
|
|
86
|
+
/** The state of the Screen Lock password protection. On ChromeOS, this value will always be ENABLED as there is not way to disable requiring a password or pin when unlocking the device. */
|
|
87
|
+
screenLockSecured?: string;
|
|
88
|
+
/** Whether the device's startup software has its Secure Boot feature enabled. Available on Windows only. */
|
|
89
|
+
secureBootMode?: string;
|
|
90
|
+
/** The serial number of the device. On Windows, this represents the BIOS's serial number. Not available on most Linux distributions. */
|
|
91
|
+
serialNumber?: string;
|
|
92
|
+
/** Whether the Site Isolation (a.k.a Site Per Process) setting is enabled. That setting may be controlled by an enterprise policy: https://chromeenterprise.google/policies/#SitePerProcess */
|
|
93
|
+
siteIsolationEnabled?: boolean;
|
|
94
|
+
/** List of the addesses of all OS level DNS servers configured in the device's network settings. */
|
|
95
|
+
systemDnsServers?: string[];
|
|
96
|
+
/** Whether Chrome is blocking third-party software injection or not. This setting may be controlled by an enterprise policy: https://chromeenterprise.google/policies/?policy=ThirdPartyBlockingEnabled. Available on Windows only. */
|
|
97
|
+
thirdPartyBlockingEnabled?: boolean;
|
|
98
|
+
/** The trigger which generated this set of signals. */
|
|
99
|
+
trigger?: string;
|
|
100
|
+
/** Windows domain that the current machine has joined. Available on Windows only. */
|
|
101
|
+
windowsMachineDomain?: string;
|
|
102
|
+
/** Windows domain for the current OS user. Available on Windows only. */
|
|
103
|
+
windowsUserDomain?: string;
|
|
104
|
+
}
|
|
105
|
+
interface Empty {}
|
|
106
|
+
interface VerifyChallengeResponseRequest {
|
|
107
|
+
/** Required. The generated response to the challenge, the bytes representation of SignedData. */
|
|
108
|
+
challengeResponse?: string;
|
|
109
|
+
/** Optional. Service can optionally provide identity information about the device or user associated with the key. For an EMK, this value is the enrolled domain. For an EUK, this value is the user's email address. If present, this value will be checked against contents of the response, and verification will fail if there is no match. */
|
|
110
|
+
expectedIdentity?: string;
|
|
365
111
|
}
|
|
112
|
+
interface VerifyChallengeResponseResult {
|
|
113
|
+
/** Attested device ID (ADID). */
|
|
114
|
+
attestedDeviceId?: string;
|
|
115
|
+
/** Unique customer id that this device belongs to, as defined by the Google Admin SDK at https://developers.google.com/admin-sdk/directory/v1/guides/manage-customers */
|
|
116
|
+
customerId?: string;
|
|
117
|
+
/** Device enrollment id for ChromeOS devices. */
|
|
118
|
+
deviceEnrollmentId?: string;
|
|
119
|
+
/** Device permanent id is returned in this field (for the machine response only). */
|
|
120
|
+
devicePermanentId?: string;
|
|
121
|
+
/** Deprecated. Device signal in json string representation. Prefer using `device_signals` instead. */
|
|
122
|
+
deviceSignal?: string;
|
|
123
|
+
/** Device signals. */
|
|
124
|
+
deviceSignals?: DeviceSignals;
|
|
125
|
+
/** Device attested key trust level. */
|
|
126
|
+
keyTrustLevel?: string;
|
|
127
|
+
/** Unique customer id that this profile belongs to, as defined by the Google Admin SDK at https://developers.google.com/admin-sdk/directory/v1/guides/manage-customers */
|
|
128
|
+
profileCustomerId?: string;
|
|
129
|
+
/** Profile attested key trust level. */
|
|
130
|
+
profileKeyTrustLevel?: string;
|
|
131
|
+
/** Certificate Signing Request (in the SPKAC format, base64 encoded) is returned in this field. This field will be set only if device has included CSR in its challenge response. (the option to include CSR is now available for both user and machine responses) */
|
|
132
|
+
signedPublicKeyAndChallenge?: string;
|
|
133
|
+
/** Virtual device id of the device. The definition of virtual device id is platform-specific. */
|
|
134
|
+
virtualDeviceId?: string;
|
|
135
|
+
/** The ID of a profile on the device. */
|
|
136
|
+
virtualProfileId?: string;
|
|
137
|
+
}
|
|
138
|
+
interface ChallengeResource {
|
|
139
|
+
/** Generates a new challenge. */
|
|
140
|
+
generate(request: {
|
|
141
|
+
/** V1 error format. */
|
|
142
|
+
'$.xgafv'?: string;
|
|
143
|
+
/** OAuth access token. */
|
|
144
|
+
access_token?: string;
|
|
145
|
+
/** Data format for response. */
|
|
146
|
+
alt?: string;
|
|
147
|
+
/** JSONP */
|
|
148
|
+
callback?: string;
|
|
149
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
150
|
+
fields?: string;
|
|
151
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
152
|
+
key?: string;
|
|
153
|
+
/** OAuth 2.0 token for the current user. */
|
|
154
|
+
oauth_token?: string;
|
|
155
|
+
/** Returns response with indentations and line breaks. */
|
|
156
|
+
prettyPrint?: boolean;
|
|
157
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
158
|
+
quotaUser?: string;
|
|
159
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
160
|
+
upload_protocol?: string;
|
|
161
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
162
|
+
uploadType?: string;
|
|
163
|
+
/** Request body */
|
|
164
|
+
resource: Empty;
|
|
165
|
+
}): Request<Challenge>;
|
|
166
|
+
generate(
|
|
167
|
+
request: {
|
|
168
|
+
/** V1 error format. */
|
|
169
|
+
'$.xgafv'?: string;
|
|
170
|
+
/** OAuth access token. */
|
|
171
|
+
access_token?: string;
|
|
172
|
+
/** Data format for response. */
|
|
173
|
+
alt?: string;
|
|
174
|
+
/** JSONP */
|
|
175
|
+
callback?: string;
|
|
176
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
177
|
+
fields?: string;
|
|
178
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
179
|
+
key?: string;
|
|
180
|
+
/** OAuth 2.0 token for the current user. */
|
|
181
|
+
oauth_token?: string;
|
|
182
|
+
/** Returns response with indentations and line breaks. */
|
|
183
|
+
prettyPrint?: boolean;
|
|
184
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
185
|
+
quotaUser?: string;
|
|
186
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
187
|
+
upload_protocol?: string;
|
|
188
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
189
|
+
uploadType?: string;
|
|
190
|
+
},
|
|
191
|
+
body: Empty
|
|
192
|
+
): Request<Challenge>;
|
|
193
|
+
/** Verifies the challenge response. */
|
|
194
|
+
verify(request: {
|
|
195
|
+
/** V1 error format. */
|
|
196
|
+
'$.xgafv'?: string;
|
|
197
|
+
/** OAuth access token. */
|
|
198
|
+
access_token?: string;
|
|
199
|
+
/** Data format for response. */
|
|
200
|
+
alt?: string;
|
|
201
|
+
/** JSONP */
|
|
202
|
+
callback?: string;
|
|
203
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
204
|
+
fields?: string;
|
|
205
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
206
|
+
key?: string;
|
|
207
|
+
/** OAuth 2.0 token for the current user. */
|
|
208
|
+
oauth_token?: string;
|
|
209
|
+
/** Returns response with indentations and line breaks. */
|
|
210
|
+
prettyPrint?: boolean;
|
|
211
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
212
|
+
quotaUser?: string;
|
|
213
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
214
|
+
upload_protocol?: string;
|
|
215
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
216
|
+
uploadType?: string;
|
|
217
|
+
/** Request body */
|
|
218
|
+
resource: VerifyChallengeResponseRequest;
|
|
219
|
+
}): Request<VerifyChallengeResponseResult>;
|
|
220
|
+
verify(
|
|
221
|
+
request: {
|
|
222
|
+
/** V1 error format. */
|
|
223
|
+
'$.xgafv'?: string;
|
|
224
|
+
/** OAuth access token. */
|
|
225
|
+
access_token?: string;
|
|
226
|
+
/** Data format for response. */
|
|
227
|
+
alt?: string;
|
|
228
|
+
/** JSONP */
|
|
229
|
+
callback?: string;
|
|
230
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
231
|
+
fields?: string;
|
|
232
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
233
|
+
key?: string;
|
|
234
|
+
/** OAuth 2.0 token for the current user. */
|
|
235
|
+
oauth_token?: string;
|
|
236
|
+
/** Returns response with indentations and line breaks. */
|
|
237
|
+
prettyPrint?: boolean;
|
|
238
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
239
|
+
quotaUser?: string;
|
|
240
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
241
|
+
upload_protocol?: string;
|
|
242
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
243
|
+
uploadType?: string;
|
|
244
|
+
},
|
|
245
|
+
body: VerifyChallengeResponseRequest
|
|
246
|
+
): Request<VerifyChallengeResponseResult>;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const challenge: ChallengeResource;
|
|
250
|
+
}
|
|
366
251
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxim_mazurok/gapi.client.verifiedaccess-v2",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231128",
|
|
4
4
|
"description": "TypeScript typings for Chrome Verified Access API v2",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
8
|
+
},
|
|
5
9
|
"license": "MIT",
|
|
6
10
|
"author": {
|
|
7
|
-
"email": "maxim@mazurok.com",
|
|
8
11
|
"name": "Maxim Mazurok",
|
|
12
|
+
"email": "maxim@mazurok.com",
|
|
9
13
|
"url": "https://maxim.mazurok.com"
|
|
10
14
|
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
-
},
|
|
15
15
|
"types": "index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/gapi.client": "*",
|
package/readme.md
CHANGED
|
@@ -25,10 +25,13 @@ gapi.load('client', () => {
|
|
|
25
25
|
Then load api client wrapper:
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
gapi.client.load(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
gapi.client.load(
|
|
29
|
+
'https://verifiedaccess.googleapis.com/$discovery/rest?version=v2',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.verifiedaccess
|
|
33
|
+
}
|
|
34
|
+
);
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
```typescript
|
|
@@ -45,34 +48,34 @@ Don't forget to authenticate your client before sending any request to resources
|
|
|
45
48
|
// declare client_id registered in Google Developers Console
|
|
46
49
|
var client_id = '',
|
|
47
50
|
scope = [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
// Verify your enterprise credentials
|
|
52
|
+
'https://www.googleapis.com/auth/verifiedaccess',
|
|
53
|
+
],
|
|
54
|
+
immediate = true;
|
|
52
55
|
// ...
|
|
53
56
|
|
|
54
57
|
gapi.auth.authorize(
|
|
55
|
-
{
|
|
58
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
56
59
|
authResult => {
|
|
57
60
|
if (authResult && !authResult.error) {
|
|
58
|
-
|
|
61
|
+
/* handle successful authorization */
|
|
59
62
|
} else {
|
|
60
|
-
|
|
63
|
+
/* handle authorization error */
|
|
61
64
|
}
|
|
62
|
-
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
63
67
|
```
|
|
64
68
|
|
|
65
69
|
After that you can use Chrome Verified Access API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
70
|
|
|
67
71
|
```typescript
|
|
68
|
-
|
|
69
72
|
/*
|
|
70
73
|
Generates a new challenge.
|
|
71
74
|
*/
|
|
72
|
-
await gapi.client.verifiedaccess.challenge.generate({
|
|
75
|
+
await gapi.client.verifiedaccess.challenge.generate({});
|
|
73
76
|
|
|
74
77
|
/*
|
|
75
78
|
Verifies the challenge response.
|
|
76
79
|
*/
|
|
77
|
-
await gapi.client.verifiedaccess.challenge.verify({
|
|
80
|
+
await gapi.client.verifiedaccess.challenge.verify({});
|
|
78
81
|
```
|
package/tests.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/* This is stub file for gapi.client.verifiedaccess-v2 definition tests */
|
|
2
|
-
// IMPORTANT
|
|
3
|
-
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
-
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
-
|
|
6
|
-
// Revision: 20231107
|
|
7
|
-
|
|
8
|
-
gapi.load('client', async () => {
|
|
9
|
-
/** now we can use gapi.client */
|
|
10
|
-
|
|
11
|
-
await gapi.client.load('https://verifiedaccess.googleapis.com/$discovery/rest?version=v2');
|
|
12
|
-
/** now we can use gapi.client.verifiedaccess */
|
|
13
|
-
|
|
14
|
-
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
-
/** declare client_id registered in Google Developers Console */
|
|
16
|
-
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
-
const scope = [
|
|
18
|
-
/** Verify your enterprise credentials */
|
|
19
|
-
'https://www.googleapis.com/auth/verifiedaccess',
|
|
20
|
-
];
|
|
21
|
-
const immediate = false;
|
|
22
|
-
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
23
|
-
if (authResult && !authResult.error) {
|
|
24
|
-
/** handle successful authorization */
|
|
25
|
-
run();
|
|
26
|
-
} else {
|
|
27
|
-
/** handle authorization error */
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
async function run() {
|
|
32
|
-
/** Generates a new challenge. */
|
|
33
|
-
await gapi.client.verifiedaccess.challenge.generate({
|
|
34
|
-
}, {
|
|
35
|
-
});
|
|
36
|
-
/** Verifies the challenge response. */
|
|
37
|
-
await gapi.client.verifiedaccess.challenge.verify({
|
|
38
|
-
}, {
|
|
39
|
-
challengeResponse: "Test string",
|
|
40
|
-
expectedIdentity: "Test string",
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"lib": ["es6", "dom"],
|
|
5
|
-
"noImplicitAny": true,
|
|
6
|
-
"noImplicitThis": true,
|
|
7
|
-
"strictNullChecks": true,
|
|
8
|
-
"baseUrl": "../",
|
|
9
|
-
"typeRoots": [
|
|
10
|
-
"../"
|
|
11
|
-
],
|
|
12
|
-
"types": [],
|
|
13
|
-
"noEmit": true,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"strictFunctionTypes": true
|
|
16
|
-
},
|
|
17
|
-
"files": ["index.d.ts", "tests.ts"]
|
|
18
|
-
}
|