@maxim_mazurok/gapi.client.verifiedaccess-v1 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 +157 -215
- package/package.json +6 -6
- package/readme.md +18 -15
- package/tests.ts +0 -46
- package/tsconfig.json +0 -18
- package/tslint.json +0 -6
package/index.d.ts
CHANGED
|
@@ -9,225 +9,167 @@
|
|
|
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=v1
|
|
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 v1 */
|
|
18
|
+
function load(
|
|
19
|
+
urlOrObject: 'https://verifiedaccess.googleapis.com/$discovery/rest?version=v1'
|
|
20
|
+
): Promise<void>;
|
|
21
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
22
|
+
function load(name: 'verifiedaccess', version: 'v1'): Promise<void>;
|
|
23
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
24
|
+
function load(
|
|
25
|
+
name: 'verifiedaccess',
|
|
26
|
+
version: 'v1',
|
|
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
|
-
interface VerifyChallengeResponseRequest {
|
|
45
|
-
/** The generated response to the challenge */
|
|
46
|
-
challengeResponse?:
|
|
47
|
-
SignedData;
|
|
48
|
-
/**
|
|
49
|
-
* 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
|
|
50
|
-
* 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.
|
|
51
|
-
*/
|
|
52
|
-
expectedIdentity?:
|
|
53
|
-
string;
|
|
54
|
-
}
|
|
55
|
-
interface VerifyChallengeResponseResult {
|
|
56
|
-
/** Attested device id (ADID) of the device, read from the verified data. */
|
|
57
|
-
attestedDeviceId?:
|
|
58
|
-
string;
|
|
59
|
-
/** Device enrollment id is returned in this field (for the machine response only). */
|
|
60
|
-
deviceEnrollmentId?:
|
|
61
|
-
string;
|
|
62
|
-
/** Device permanent id is returned in this field (for the machine response only). */
|
|
63
|
-
devicePermanentId?:
|
|
64
|
-
string;
|
|
65
|
-
/**
|
|
66
|
-
* 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
|
|
67
|
-
* option to include CSR is now available for both user and machine responses)
|
|
68
|
-
*/
|
|
69
|
-
signedPublicKeyAndChallenge?:
|
|
70
|
-
string;
|
|
71
|
-
/**
|
|
72
|
-
* For EMCert check, device permanent id is returned here. For EUCert check, signed_public_key_and_challenge [base64 encoded] is returned if present, otherwise empty string is
|
|
73
|
-
* returned. This field is deprecated, please use device_permanent_id or signed_public_key_and_challenge fields.
|
|
74
|
-
*/
|
|
75
|
-
verificationOutput?:
|
|
76
|
-
string;
|
|
77
|
-
}
|
|
78
|
-
interface ChallengeResource {
|
|
79
|
-
/** CreateChallenge API */
|
|
80
|
-
create(request: {
|
|
81
|
-
/** V1 error format. */
|
|
82
|
-
"$.xgafv"?:
|
|
83
|
-
string;
|
|
84
|
-
/** OAuth access token. */
|
|
85
|
-
access_token?:
|
|
86
|
-
string;
|
|
87
|
-
/** Data format for response. */
|
|
88
|
-
alt?:
|
|
89
|
-
string;
|
|
90
|
-
/** JSONP */
|
|
91
|
-
callback?:
|
|
92
|
-
string;
|
|
93
|
-
/** Selector specifying which fields to include in a partial response. */
|
|
94
|
-
fields?:
|
|
95
|
-
string;
|
|
96
|
-
/** 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. */
|
|
97
|
-
key?:
|
|
98
|
-
string;
|
|
99
|
-
/** OAuth 2.0 token for the current user. */
|
|
100
|
-
oauth_token?:
|
|
101
|
-
string;
|
|
102
|
-
/** Returns response with indentations and line breaks. */
|
|
103
|
-
prettyPrint?:
|
|
104
|
-
boolean;
|
|
105
|
-
/** 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. */
|
|
106
|
-
quotaUser?:
|
|
107
|
-
string;
|
|
108
|
-
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
109
|
-
upload_protocol?:
|
|
110
|
-
string;
|
|
111
|
-
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
112
|
-
uploadType?:
|
|
113
|
-
string;
|
|
114
|
-
/** Request body */
|
|
115
|
-
resource:
|
|
116
|
-
Empty;
|
|
117
|
-
}): Request<Challenge>;
|
|
118
|
-
create(request: {
|
|
119
|
-
/** V1 error format. */
|
|
120
|
-
"$.xgafv"?:
|
|
121
|
-
string;
|
|
122
|
-
/** OAuth access token. */
|
|
123
|
-
access_token?:
|
|
124
|
-
string;
|
|
125
|
-
/** Data format for response. */
|
|
126
|
-
alt?:
|
|
127
|
-
string;
|
|
128
|
-
/** JSONP */
|
|
129
|
-
callback?:
|
|
130
|
-
string;
|
|
131
|
-
/** Selector specifying which fields to include in a partial response. */
|
|
132
|
-
fields?:
|
|
133
|
-
string;
|
|
134
|
-
/** 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. */
|
|
135
|
-
key?:
|
|
136
|
-
string;
|
|
137
|
-
/** OAuth 2.0 token for the current user. */
|
|
138
|
-
oauth_token?:
|
|
139
|
-
string;
|
|
140
|
-
/** Returns response with indentations and line breaks. */
|
|
141
|
-
prettyPrint?:
|
|
142
|
-
boolean;
|
|
143
|
-
/** 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. */
|
|
144
|
-
quotaUser?:
|
|
145
|
-
string;
|
|
146
|
-
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
147
|
-
upload_protocol?:
|
|
148
|
-
string;
|
|
149
|
-
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
150
|
-
uploadType?:
|
|
151
|
-
string;
|
|
152
|
-
},
|
|
153
|
-
body: Empty): Request<Challenge>;
|
|
154
|
-
/** VerifyChallengeResponse API */
|
|
155
|
-
verify(request: {
|
|
156
|
-
/** V1 error format. */
|
|
157
|
-
"$.xgafv"?:
|
|
158
|
-
string;
|
|
159
|
-
/** OAuth access token. */
|
|
160
|
-
access_token?:
|
|
161
|
-
string;
|
|
162
|
-
/** Data format for response. */
|
|
163
|
-
alt?:
|
|
164
|
-
string;
|
|
165
|
-
/** JSONP */
|
|
166
|
-
callback?:
|
|
167
|
-
string;
|
|
168
|
-
/** Selector specifying which fields to include in a partial response. */
|
|
169
|
-
fields?:
|
|
170
|
-
string;
|
|
171
|
-
/** 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. */
|
|
172
|
-
key?:
|
|
173
|
-
string;
|
|
174
|
-
/** OAuth 2.0 token for the current user. */
|
|
175
|
-
oauth_token?:
|
|
176
|
-
string;
|
|
177
|
-
/** Returns response with indentations and line breaks. */
|
|
178
|
-
prettyPrint?:
|
|
179
|
-
boolean;
|
|
180
|
-
/** 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. */
|
|
181
|
-
quotaUser?:
|
|
182
|
-
string;
|
|
183
|
-
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
184
|
-
upload_protocol?:
|
|
185
|
-
string;
|
|
186
|
-
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
187
|
-
uploadType?:
|
|
188
|
-
string;
|
|
189
|
-
/** Request body */
|
|
190
|
-
resource:
|
|
191
|
-
VerifyChallengeResponseRequest;
|
|
192
|
-
}): Request<VerifyChallengeResponseResult>;
|
|
193
|
-
verify(request: {
|
|
194
|
-
/** V1 error format. */
|
|
195
|
-
"$.xgafv"?:
|
|
196
|
-
string;
|
|
197
|
-
/** OAuth access token. */
|
|
198
|
-
access_token?:
|
|
199
|
-
string;
|
|
200
|
-
/** Data format for response. */
|
|
201
|
-
alt?:
|
|
202
|
-
string;
|
|
203
|
-
/** JSONP */
|
|
204
|
-
callback?:
|
|
205
|
-
string;
|
|
206
|
-
/** Selector specifying which fields to include in a partial response. */
|
|
207
|
-
fields?:
|
|
208
|
-
string;
|
|
209
|
-
/** 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. */
|
|
210
|
-
key?:
|
|
211
|
-
string;
|
|
212
|
-
/** OAuth 2.0 token for the current user. */
|
|
213
|
-
oauth_token?:
|
|
214
|
-
string;
|
|
215
|
-
/** Returns response with indentations and line breaks. */
|
|
216
|
-
prettyPrint?:
|
|
217
|
-
boolean;
|
|
218
|
-
/** 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. */
|
|
219
|
-
quotaUser?:
|
|
220
|
-
string;
|
|
221
|
-
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
222
|
-
upload_protocol?:
|
|
223
|
-
string;
|
|
224
|
-
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
225
|
-
uploadType?:
|
|
226
|
-
string;
|
|
227
|
-
},
|
|
228
|
-
body: VerifyChallengeResponseRequest): Request<VerifyChallengeResponseResult>;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
const challenge: ChallengeResource;
|
|
30
|
+
namespace verifiedaccess {
|
|
31
|
+
interface Challenge {
|
|
32
|
+
/** Challenge generated with the old signing key (this will only be present during key rotation) */
|
|
33
|
+
alternativeChallenge?: SignedData;
|
|
34
|
+
/** Generated challenge */
|
|
35
|
+
challenge?: SignedData;
|
|
36
|
+
}
|
|
37
|
+
interface Empty {}
|
|
38
|
+
interface SignedData {
|
|
39
|
+
/** The data to be signed. */
|
|
40
|
+
data?: string;
|
|
41
|
+
/** The signature of the data field. */
|
|
42
|
+
signature?: string;
|
|
43
|
+
}
|
|
44
|
+
interface VerifyChallengeResponseRequest {
|
|
45
|
+
/** The generated response to the challenge */
|
|
46
|
+
challengeResponse?: SignedData;
|
|
47
|
+
/** 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. */
|
|
48
|
+
expectedIdentity?: string;
|
|
232
49
|
}
|
|
50
|
+
interface VerifyChallengeResponseResult {
|
|
51
|
+
/** Attested device id (ADID) of the device, read from the verified data. */
|
|
52
|
+
attestedDeviceId?: string;
|
|
53
|
+
/** Device enrollment id is returned in this field (for the machine response only). */
|
|
54
|
+
deviceEnrollmentId?: string;
|
|
55
|
+
/** Device permanent id is returned in this field (for the machine response only). */
|
|
56
|
+
devicePermanentId?: string;
|
|
57
|
+
/** 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) */
|
|
58
|
+
signedPublicKeyAndChallenge?: string;
|
|
59
|
+
/** For EMCert check, device permanent id is returned here. For EUCert check, signed_public_key_and_challenge [base64 encoded] is returned if present, otherwise empty string is returned. This field is deprecated, please use device_permanent_id or signed_public_key_and_challenge fields. */
|
|
60
|
+
verificationOutput?: string;
|
|
61
|
+
}
|
|
62
|
+
interface ChallengeResource {
|
|
63
|
+
/** CreateChallenge API */
|
|
64
|
+
create(request: {
|
|
65
|
+
/** V1 error format. */
|
|
66
|
+
'$.xgafv'?: string;
|
|
67
|
+
/** OAuth access token. */
|
|
68
|
+
access_token?: string;
|
|
69
|
+
/** Data format for response. */
|
|
70
|
+
alt?: string;
|
|
71
|
+
/** JSONP */
|
|
72
|
+
callback?: string;
|
|
73
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
74
|
+
fields?: string;
|
|
75
|
+
/** 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. */
|
|
76
|
+
key?: string;
|
|
77
|
+
/** OAuth 2.0 token for the current user. */
|
|
78
|
+
oauth_token?: string;
|
|
79
|
+
/** Returns response with indentations and line breaks. */
|
|
80
|
+
prettyPrint?: boolean;
|
|
81
|
+
/** 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. */
|
|
82
|
+
quotaUser?: string;
|
|
83
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
84
|
+
upload_protocol?: string;
|
|
85
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
86
|
+
uploadType?: string;
|
|
87
|
+
/** Request body */
|
|
88
|
+
resource: Empty;
|
|
89
|
+
}): Request<Challenge>;
|
|
90
|
+
create(
|
|
91
|
+
request: {
|
|
92
|
+
/** V1 error format. */
|
|
93
|
+
'$.xgafv'?: string;
|
|
94
|
+
/** OAuth access token. */
|
|
95
|
+
access_token?: string;
|
|
96
|
+
/** Data format for response. */
|
|
97
|
+
alt?: string;
|
|
98
|
+
/** JSONP */
|
|
99
|
+
callback?: string;
|
|
100
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
101
|
+
fields?: string;
|
|
102
|
+
/** 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. */
|
|
103
|
+
key?: string;
|
|
104
|
+
/** OAuth 2.0 token for the current user. */
|
|
105
|
+
oauth_token?: string;
|
|
106
|
+
/** Returns response with indentations and line breaks. */
|
|
107
|
+
prettyPrint?: boolean;
|
|
108
|
+
/** 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. */
|
|
109
|
+
quotaUser?: string;
|
|
110
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
111
|
+
upload_protocol?: string;
|
|
112
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
113
|
+
uploadType?: string;
|
|
114
|
+
},
|
|
115
|
+
body: Empty
|
|
116
|
+
): Request<Challenge>;
|
|
117
|
+
/** VerifyChallengeResponse API */
|
|
118
|
+
verify(request: {
|
|
119
|
+
/** V1 error format. */
|
|
120
|
+
'$.xgafv'?: string;
|
|
121
|
+
/** OAuth access token. */
|
|
122
|
+
access_token?: string;
|
|
123
|
+
/** Data format for response. */
|
|
124
|
+
alt?: string;
|
|
125
|
+
/** JSONP */
|
|
126
|
+
callback?: string;
|
|
127
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
128
|
+
fields?: string;
|
|
129
|
+
/** 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. */
|
|
130
|
+
key?: string;
|
|
131
|
+
/** OAuth 2.0 token for the current user. */
|
|
132
|
+
oauth_token?: string;
|
|
133
|
+
/** Returns response with indentations and line breaks. */
|
|
134
|
+
prettyPrint?: boolean;
|
|
135
|
+
/** 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. */
|
|
136
|
+
quotaUser?: string;
|
|
137
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
138
|
+
upload_protocol?: string;
|
|
139
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
140
|
+
uploadType?: string;
|
|
141
|
+
/** Request body */
|
|
142
|
+
resource: VerifyChallengeResponseRequest;
|
|
143
|
+
}): Request<VerifyChallengeResponseResult>;
|
|
144
|
+
verify(
|
|
145
|
+
request: {
|
|
146
|
+
/** V1 error format. */
|
|
147
|
+
'$.xgafv'?: string;
|
|
148
|
+
/** OAuth access token. */
|
|
149
|
+
access_token?: string;
|
|
150
|
+
/** Data format for response. */
|
|
151
|
+
alt?: string;
|
|
152
|
+
/** JSONP */
|
|
153
|
+
callback?: string;
|
|
154
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
155
|
+
fields?: string;
|
|
156
|
+
/** 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. */
|
|
157
|
+
key?: string;
|
|
158
|
+
/** OAuth 2.0 token for the current user. */
|
|
159
|
+
oauth_token?: string;
|
|
160
|
+
/** Returns response with indentations and line breaks. */
|
|
161
|
+
prettyPrint?: boolean;
|
|
162
|
+
/** 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. */
|
|
163
|
+
quotaUser?: string;
|
|
164
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
165
|
+
upload_protocol?: string;
|
|
166
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
167
|
+
uploadType?: string;
|
|
168
|
+
},
|
|
169
|
+
body: VerifyChallengeResponseRequest
|
|
170
|
+
): Request<VerifyChallengeResponseResult>;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const challenge: ChallengeResource;
|
|
174
|
+
}
|
|
233
175
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxim_mazurok/gapi.client.verifiedaccess-v1",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231128",
|
|
4
4
|
"description": "TypeScript typings for Chrome Verified Access API v1",
|
|
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=v1',
|
|
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
|
CreateChallenge API
|
|
71
74
|
*/
|
|
72
|
-
await gapi.client.verifiedaccess.challenge.create({
|
|
75
|
+
await gapi.client.verifiedaccess.challenge.create({});
|
|
73
76
|
|
|
74
77
|
/*
|
|
75
78
|
VerifyChallengeResponse API
|
|
76
79
|
*/
|
|
77
|
-
await gapi.client.verifiedaccess.challenge.verify({
|
|
80
|
+
await gapi.client.verifiedaccess.challenge.verify({});
|
|
78
81
|
```
|
package/tests.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/* This is stub file for gapi.client.verifiedaccess-v1 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=v1');
|
|
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
|
-
/** CreateChallenge API */
|
|
33
|
-
await gapi.client.verifiedaccess.challenge.create({
|
|
34
|
-
}, {
|
|
35
|
-
});
|
|
36
|
-
/** VerifyChallengeResponse API */
|
|
37
|
-
await gapi.client.verifiedaccess.challenge.verify({
|
|
38
|
-
}, {
|
|
39
|
-
challengeResponse: {
|
|
40
|
-
data: "Test string",
|
|
41
|
-
signature: "Test string",
|
|
42
|
-
},
|
|
43
|
-
expectedIdentity: "Test string",
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
});
|
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
|
-
}
|