@googleapis/verifiedaccess 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1](https://github.com/googleapis/google-api-nodejs-client/compare/verifiedaccess-v0.3.0...verifiedaccess-v0.3.1) (2022-06-13)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **verifiedaccess:** update the API ([dc5e29a](https://github.com/googleapis/google-api-nodejs-client/commit/dc5e29aa85f34013a54e22cb4af48a000f7030b6))
9
+
10
+ ## [0.3.0](https://www.github.com/googleapis/google-api-nodejs-client/compare/verifiedaccess-v0.2.0...verifiedaccess-v0.3.0) (2021-09-14)
11
+
12
+
13
+ ### Features
14
+
15
+ * **auth:** adds support workload identity federation ([#2517](https://www.github.com/googleapis/google-api-nodejs-client/issues/2517)) ([a10707c](https://www.github.com/googleapis/google-api-nodejs-client/commit/a10707c477759e7c9ef6360a2fe800856fb600c1))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **deps:** update dependency googleapis-common to v5 ([#2497](https://www.github.com/googleapis/google-api-nodejs-client/issues/2497)) ([fec087a](https://www.github.com/googleapis/google-api-nodejs-client/commit/fec087abcf3d994dd41c3ffa0a0c12b1f9f09dae))
21
+ * upgrade webpack from 4 to 5 ([#2524](https://www.github.com/googleapis/google-api-nodejs-client/issues/2524)) ([ecfd8bf](https://www.github.com/googleapis/google-api-nodejs-client/commit/ecfd8bfcd06e1beabff7ec9a8c4000222379eb8d))
22
+ * **verifiedaccess:** update the API ([c70964d](https://www.github.com/googleapis/google-api-nodejs-client/commit/c70964d9ab7fabe75c58aa69185e1078a657c447))
23
+
3
24
  ## [0.2.0](https://www.github.com/googleapis/google-api-nodejs-client/compare/verifiedaccess-v0.1.0...verifiedaccess-v0.2.0) (2021-03-18)
4
25
 
5
26
 
package/README.md CHANGED
@@ -7,37 +7,18 @@
7
7
  ## Installation
8
8
 
9
9
  ```sh
10
- $ npm install googleapis
10
+ $ npm install @googleapis/verifiedaccess
11
11
  ```
12
12
 
13
13
  ## Usage
14
14
  All documentation and usage information can be found on [GitHub](https://github.com/googleapis/google-api-nodejs-client).
15
-
16
- ## Building a browser bundle
17
-
18
- This library can be used in a browser. To prepare a single file bundle, clone the
19
- [repository](https://github.com/googleapis/google-api-nodejs-client) and run
20
-
21
- ```sh
22
- $ cd src/apis/verifiedaccess
23
- $ npm install
24
- $ npm run webpack
25
- ```
26
-
27
- The generated bundle will be written to `dist/verifiedaccess.min.js`. Use it from your HTML file:
28
-
29
- ```html
30
- <script src="/path/to/verifiedaccess.min.js"></script>
31
- <script>
32
- const { verifiedaccess, auth } = Verifiedaccess;
33
- </script>
34
- ```
15
+ Information on classes can be found in [Googleapis Documentation](https://googleapis.dev/nodejs/googleapis/latest/verifiedaccess/classes/Verifiedaccess.html).
35
16
 
36
17
  ## License
37
- This library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/googleapis/google-api-nodejs-client/blob/master/LICENSE).
18
+ This library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/googleapis/google-api-nodejs-client/blob/main/LICENSE).
38
19
 
39
20
  ## Contributing
40
- We love contributions! Before submitting a Pull Request, it's always good to start with a new issue first. To learn more, see [CONTRIBUTING](https://github.com/google/google-api-nodejs-client/blob/master/.github/CONTRIBUTING.md).
21
+ We love contributions! Before submitting a Pull Request, it's always good to start with a new issue first. To learn more, see [CONTRIBUTING](https://github.com/google/google-api-nodejs-client/blob/main/.github/CONTRIBUTING.md).
41
22
 
42
23
  ## Questions/problems?
43
24
  * Ask your development related questions on [StackOverflow](http://stackoverflow.com/questions/tagged/google-api-nodejs-client).
package/build/index.d.ts CHANGED
@@ -1,12 +1,17 @@
1
1
  /*! THIS FILE IS AUTO-GENERATED */
2
2
  import { AuthPlus } from 'googleapis-common';
3
3
  import { verifiedaccess_v1 } from './v1';
4
+ import { verifiedaccess_v2 } from './v2';
4
5
  export declare const VERSIONS: {
5
6
  v1: typeof verifiedaccess_v1.Verifiedaccess;
7
+ v2: typeof verifiedaccess_v2.Verifiedaccess;
6
8
  };
7
9
  export declare function verifiedaccess(version: 'v1'): verifiedaccess_v1.Verifiedaccess;
8
10
  export declare function verifiedaccess(options: verifiedaccess_v1.Options): verifiedaccess_v1.Verifiedaccess;
11
+ export declare function verifiedaccess(version: 'v2'): verifiedaccess_v2.Verifiedaccess;
12
+ export declare function verifiedaccess(options: verifiedaccess_v2.Options): verifiedaccess_v2.Verifiedaccess;
9
13
  declare const auth: AuthPlus;
10
14
  export { auth };
11
15
  export { verifiedaccess_v1 };
16
+ export { verifiedaccess_v2 };
12
17
  export { AuthPlus, GlobalOptions, APIRequestContext, GoogleConfigurable, StreamMethodOptions, GaxiosPromise, MethodOptions, BodyResponseCallback, } from 'googleapis-common';
package/build/index.js CHANGED
@@ -16,8 +16,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  const googleapis_common_1 = require("googleapis-common");
17
17
  const v1_1 = require("./v1");
18
18
  exports.verifiedaccess_v1 = v1_1.verifiedaccess_v1;
19
+ const v2_1 = require("./v2");
20
+ exports.verifiedaccess_v2 = v2_1.verifiedaccess_v2;
19
21
  exports.VERSIONS = {
20
22
  v1: v1_1.verifiedaccess_v1.Verifiedaccess,
23
+ v2: v2_1.verifiedaccess_v2.Verifiedaccess,
21
24
  };
22
25
  function verifiedaccess(versionOrOptions) {
23
26
  return googleapis_common_1.getAPI('verifiedaccess', versionOrOptions, exports.VERSIONS, this);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.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,kCAAkC;AAElC,yDAAuE;AACvE,6BAAuC;AAmB/B,4BAnBA,sBAAiB,CAmBA;AAjBZ,QAAA,QAAQ,GAAG;IACtB,EAAE,EAAE,sBAAiB,CAAC,cAAc;CACrC,CAAC;AAMF,SAAgB,cAAc,CAE5B,gBAAkD;IAElD,OAAO,0BAAM,CAAI,gBAAgB,EAAE,gBAAgB,EAAE,gBAAQ,EAAE,IAAI,CAAC,CAAC;AACvE,CAAC;AALD,wCAKC;AAED,MAAM,IAAI,GAAG,IAAI,4BAAQ,EAAE,CAAC;AACpB,oBAAI;AAEZ,uDAS2B;AARzB,uCAAA,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.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,kCAAkC;AAElC,yDAAuE;AACvE,6BAAuC;AA+B/B,4BA/BA,sBAAiB,CA+BA;AA9BzB,6BAAuC;AA+B/B,4BA/BA,sBAAiB,CA+BA;AA7BZ,QAAA,QAAQ,GAAG;IACtB,EAAE,EAAE,sBAAiB,CAAC,cAAc;IACpC,EAAE,EAAE,sBAAiB,CAAC,cAAc;CACrC,CAAC;AAUF,SAAgB,cAAc,CAI5B,gBAI6B;IAE7B,OAAO,0BAAM,CAAI,gBAAgB,EAAE,gBAAgB,EAAE,gBAAQ,EAAE,IAAI,CAAC,CAAC;AACvE,CAAC;AAXD,wCAWC;AAED,MAAM,IAAI,GAAG,IAAI,4BAAQ,EAAE,CAAC;AACpB,oBAAI;AAGZ,uDAS2B;AARzB,uCAAA,QAAQ,CAAA"}
package/build/v2.d.ts ADDED
@@ -0,0 +1,268 @@
1
+ /// <reference types="node" />
2
+ import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
3
+ import { Readable } from 'stream';
4
+ export declare namespace verifiedaccess_v2 {
5
+ export interface Options extends GlobalOptions {
6
+ version: 'v2';
7
+ }
8
+ interface StandardParameters {
9
+ /**
10
+ * Auth client or API Key for the request
11
+ */
12
+ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
13
+ /**
14
+ * V1 error format.
15
+ */
16
+ '$.xgafv'?: string;
17
+ /**
18
+ * OAuth access token.
19
+ */
20
+ access_token?: string;
21
+ /**
22
+ * Data format for response.
23
+ */
24
+ alt?: string;
25
+ /**
26
+ * JSONP
27
+ */
28
+ callback?: string;
29
+ /**
30
+ * Selector specifying which fields to include in a partial response.
31
+ */
32
+ fields?: string;
33
+ /**
34
+ * 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.
35
+ */
36
+ key?: string;
37
+ /**
38
+ * OAuth 2.0 token for the current user.
39
+ */
40
+ oauth_token?: string;
41
+ /**
42
+ * Returns response with indentations and line breaks.
43
+ */
44
+ prettyPrint?: boolean;
45
+ /**
46
+ * 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.
47
+ */
48
+ quotaUser?: string;
49
+ /**
50
+ * Legacy upload protocol for media (e.g. "media", "multipart").
51
+ */
52
+ uploadType?: string;
53
+ /**
54
+ * Upload protocol for media (e.g. "raw", "multipart").
55
+ */
56
+ upload_protocol?: string;
57
+ }
58
+ /**
59
+ * Chrome Verified Access API
60
+ *
61
+ * API for Verified Access chrome extension to provide credential verification for chrome devices connecting to an enterprise network
62
+ *
63
+ * @example
64
+ * ```js
65
+ * const {google} = require('googleapis');
66
+ * const verifiedaccess = google.verifiedaccess('v2');
67
+ * ```
68
+ */
69
+ export class Verifiedaccess {
70
+ context: APIRequestContext;
71
+ challenge: Resource$Challenge;
72
+ constructor(options: GlobalOptions, google?: GoogleConfigurable);
73
+ }
74
+ /**
75
+ * Result message for VerifiedAccess.CreateChallenge.
76
+ */
77
+ export interface Schema$Challenge {
78
+ /**
79
+ * Challenge generated with the old signing key, the bytes representation of SignedData (this will only be present during key rotation).
80
+ */
81
+ alternativeChallenge?: string | null;
82
+ /**
83
+ * Generated challenge, the bytes representation of SignedData.
84
+ */
85
+ challenge?: string | null;
86
+ }
87
+ /**
88
+ * A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \} The JSON representation for `Empty` is empty JSON object `{\}`.
89
+ */
90
+ export interface Schema$Empty {
91
+ }
92
+ /**
93
+ * Signed ChallengeResponse.
94
+ */
95
+ export interface Schema$VerifyChallengeResponseRequest {
96
+ /**
97
+ * Required. The generated response to the challenge, the bytes representation of SignedData.
98
+ */
99
+ challengeResponse?: string | null;
100
+ /**
101
+ * 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.
102
+ */
103
+ expectedIdentity?: string | null;
104
+ }
105
+ /**
106
+ * Result message for VerifiedAccess.VerifyChallengeResponse.
107
+ */
108
+ export interface Schema$VerifyChallengeResponseResult {
109
+ /**
110
+ * Device permanent id is returned in this field (for the machine response only).
111
+ */
112
+ devicePermanentId?: string | null;
113
+ /**
114
+ * Device signal in json string representation.
115
+ */
116
+ deviceSignal?: string | null;
117
+ /**
118
+ * Device attested key trust level.
119
+ */
120
+ keyTrustLevel?: string | null;
121
+ /**
122
+ * 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)
123
+ */
124
+ signedPublicKeyAndChallenge?: string | null;
125
+ }
126
+ export class Resource$Challenge {
127
+ context: APIRequestContext;
128
+ constructor(context: APIRequestContext);
129
+ /**
130
+ * Generates a new challenge.
131
+ * @example
132
+ * ```js
133
+ * // Before running the sample:
134
+ * // - Enable the API at:
135
+ * // https://console.developers.google.com/apis/api/verifiedaccess.googleapis.com
136
+ * // - Login into gcloud by running:
137
+ * // `$ gcloud auth application-default login`
138
+ * // - Install the npm module by running:
139
+ * // `$ npm install googleapis`
140
+ *
141
+ * const {google} = require('googleapis');
142
+ * const verifiedaccess = google.verifiedaccess('v2');
143
+ *
144
+ * async function main() {
145
+ * const auth = new google.auth.GoogleAuth({
146
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
147
+ * scopes: ['https://www.googleapis.com/auth/verifiedaccess'],
148
+ * });
149
+ *
150
+ * // Acquire an auth client, and bind it to all future calls
151
+ * const authClient = await auth.getClient();
152
+ * google.options({auth: authClient});
153
+ *
154
+ * // Do the magic
155
+ * const res = await verifiedaccess.challenge.generate({
156
+ * // Request body metadata
157
+ * requestBody: {
158
+ * // request body parameters
159
+ * // {}
160
+ * },
161
+ * });
162
+ * console.log(res.data);
163
+ *
164
+ * // Example response
165
+ * // {
166
+ * // "alternativeChallenge": "my_alternativeChallenge",
167
+ * // "challenge": "my_challenge"
168
+ * // }
169
+ * }
170
+ *
171
+ * main().catch(e => {
172
+ * console.error(e);
173
+ * throw e;
174
+ * });
175
+ *
176
+ * ```
177
+ *
178
+ * @param params - Parameters for request
179
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
180
+ * @param callback - Optional callback that handles the response.
181
+ * @returns A promise if used with async/await, or void if used with a callback.
182
+ */
183
+ generate(params: Params$Resource$Challenge$Generate, options: StreamMethodOptions): GaxiosPromise<Readable>;
184
+ generate(params?: Params$Resource$Challenge$Generate, options?: MethodOptions): GaxiosPromise<Schema$Challenge>;
185
+ generate(params: Params$Resource$Challenge$Generate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
186
+ generate(params: Params$Resource$Challenge$Generate, options: MethodOptions | BodyResponseCallback<Schema$Challenge>, callback: BodyResponseCallback<Schema$Challenge>): void;
187
+ generate(params: Params$Resource$Challenge$Generate, callback: BodyResponseCallback<Schema$Challenge>): void;
188
+ generate(callback: BodyResponseCallback<Schema$Challenge>): void;
189
+ /**
190
+ * Verifies the challenge response.
191
+ * @example
192
+ * ```js
193
+ * // Before running the sample:
194
+ * // - Enable the API at:
195
+ * // https://console.developers.google.com/apis/api/verifiedaccess.googleapis.com
196
+ * // - Login into gcloud by running:
197
+ * // `$ gcloud auth application-default login`
198
+ * // - Install the npm module by running:
199
+ * // `$ npm install googleapis`
200
+ *
201
+ * const {google} = require('googleapis');
202
+ * const verifiedaccess = google.verifiedaccess('v2');
203
+ *
204
+ * async function main() {
205
+ * const auth = new google.auth.GoogleAuth({
206
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
207
+ * scopes: ['https://www.googleapis.com/auth/verifiedaccess'],
208
+ * });
209
+ *
210
+ * // Acquire an auth client, and bind it to all future calls
211
+ * const authClient = await auth.getClient();
212
+ * google.options({auth: authClient});
213
+ *
214
+ * // Do the magic
215
+ * const res = await verifiedaccess.challenge.verify({
216
+ * // Request body metadata
217
+ * requestBody: {
218
+ * // request body parameters
219
+ * // {
220
+ * // "challengeResponse": "my_challengeResponse",
221
+ * // "expectedIdentity": "my_expectedIdentity"
222
+ * // }
223
+ * },
224
+ * });
225
+ * console.log(res.data);
226
+ *
227
+ * // Example response
228
+ * // {
229
+ * // "devicePermanentId": "my_devicePermanentId",
230
+ * // "deviceSignal": "my_deviceSignal",
231
+ * // "keyTrustLevel": "my_keyTrustLevel",
232
+ * // "signedPublicKeyAndChallenge": "my_signedPublicKeyAndChallenge"
233
+ * // }
234
+ * }
235
+ *
236
+ * main().catch(e => {
237
+ * console.error(e);
238
+ * throw e;
239
+ * });
240
+ *
241
+ * ```
242
+ *
243
+ * @param params - Parameters for request
244
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
245
+ * @param callback - Optional callback that handles the response.
246
+ * @returns A promise if used with async/await, or void if used with a callback.
247
+ */
248
+ verify(params: Params$Resource$Challenge$Verify, options: StreamMethodOptions): GaxiosPromise<Readable>;
249
+ verify(params?: Params$Resource$Challenge$Verify, options?: MethodOptions): GaxiosPromise<Schema$VerifyChallengeResponseResult>;
250
+ verify(params: Params$Resource$Challenge$Verify, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
251
+ verify(params: Params$Resource$Challenge$Verify, options: MethodOptions | BodyResponseCallback<Schema$VerifyChallengeResponseResult>, callback: BodyResponseCallback<Schema$VerifyChallengeResponseResult>): void;
252
+ verify(params: Params$Resource$Challenge$Verify, callback: BodyResponseCallback<Schema$VerifyChallengeResponseResult>): void;
253
+ verify(callback: BodyResponseCallback<Schema$VerifyChallengeResponseResult>): void;
254
+ }
255
+ export interface Params$Resource$Challenge$Generate extends StandardParameters {
256
+ /**
257
+ * Request body metadata
258
+ */
259
+ requestBody?: Schema$Empty;
260
+ }
261
+ export interface Params$Resource$Challenge$Verify extends StandardParameters {
262
+ /**
263
+ * Request body metadata
264
+ */
265
+ requestBody?: Schema$VerifyChallengeResponseRequest;
266
+ }
267
+ export {};
268
+ }
package/build/v2.js ADDED
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ // Copyright 2020 Google LLC
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ /* eslint-disable @typescript-eslint/no-explicit-any */
16
+ /* eslint-disable @typescript-eslint/class-name-casing */
17
+ /* eslint-disable @typescript-eslint/no-unused-vars */
18
+ /* eslint-disable @typescript-eslint/no-empty-interface */
19
+ /* eslint-disable @typescript-eslint/no-namespace */
20
+ /* eslint-disable no-irregular-whitespace */
21
+ const googleapis_common_1 = require("googleapis-common");
22
+ var verifiedaccess_v2;
23
+ (function (verifiedaccess_v2) {
24
+ /**
25
+ * Chrome Verified Access API
26
+ *
27
+ * API for Verified Access chrome extension to provide credential verification for chrome devices connecting to an enterprise network
28
+ *
29
+ * @example
30
+ * ```js
31
+ * const {google} = require('googleapis');
32
+ * const verifiedaccess = google.verifiedaccess('v2');
33
+ * ```
34
+ */
35
+ class Verifiedaccess {
36
+ constructor(options, google) {
37
+ this.context = {
38
+ _options: options || {},
39
+ google,
40
+ };
41
+ this.challenge = new Resource$Challenge(this.context);
42
+ }
43
+ }
44
+ verifiedaccess_v2.Verifiedaccess = Verifiedaccess;
45
+ class Resource$Challenge {
46
+ constructor(context) {
47
+ this.context = context;
48
+ }
49
+ generate(paramsOrCallback, optionsOrCallback, callback) {
50
+ let params = (paramsOrCallback ||
51
+ {});
52
+ let options = (optionsOrCallback || {});
53
+ if (typeof paramsOrCallback === 'function') {
54
+ callback = paramsOrCallback;
55
+ params = {};
56
+ options = {};
57
+ }
58
+ if (typeof optionsOrCallback === 'function') {
59
+ callback = optionsOrCallback;
60
+ options = {};
61
+ }
62
+ const rootUrl = options.rootUrl || 'https://verifiedaccess.googleapis.com/';
63
+ const parameters = {
64
+ options: Object.assign({
65
+ url: (rootUrl + '/v2/challenge:generate').replace(/([^:]\/)\/+/g, '$1'),
66
+ method: 'POST',
67
+ }, options),
68
+ params,
69
+ requiredParams: [],
70
+ pathParams: [],
71
+ context: this.context,
72
+ };
73
+ if (callback) {
74
+ googleapis_common_1.createAPIRequest(parameters, callback);
75
+ }
76
+ else {
77
+ return googleapis_common_1.createAPIRequest(parameters);
78
+ }
79
+ }
80
+ verify(paramsOrCallback, optionsOrCallback, callback) {
81
+ let params = (paramsOrCallback || {});
82
+ let options = (optionsOrCallback || {});
83
+ if (typeof paramsOrCallback === 'function') {
84
+ callback = paramsOrCallback;
85
+ params = {};
86
+ options = {};
87
+ }
88
+ if (typeof optionsOrCallback === 'function') {
89
+ callback = optionsOrCallback;
90
+ options = {};
91
+ }
92
+ const rootUrl = options.rootUrl || 'https://verifiedaccess.googleapis.com/';
93
+ const parameters = {
94
+ options: Object.assign({
95
+ url: (rootUrl + '/v2/challenge:verify').replace(/([^:]\/)\/+/g, '$1'),
96
+ method: 'POST',
97
+ }, options),
98
+ params,
99
+ requiredParams: [],
100
+ pathParams: [],
101
+ context: this.context,
102
+ };
103
+ if (callback) {
104
+ googleapis_common_1.createAPIRequest(parameters, callback);
105
+ }
106
+ else {
107
+ return googleapis_common_1.createAPIRequest(parameters);
108
+ }
109
+ }
110
+ }
111
+ verifiedaccess_v2.Resource$Challenge = Resource$Challenge;
112
+ })(verifiedaccess_v2 = exports.verifiedaccess_v2 || (exports.verifiedaccess_v2 = {}));
113
+ //# sourceMappingURL=v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.js","sourceRoot":"","sources":["../v2.ts"],"names":[],"mappings":"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"}
package/index.ts CHANGED
@@ -15,18 +15,30 @@
15
15
 
16
16
  import {AuthPlus, getAPI, GoogleConfigurable} from 'googleapis-common';
17
17
  import {verifiedaccess_v1} from './v1';
18
+ import {verifiedaccess_v2} from './v2';
18
19
 
19
20
  export const VERSIONS = {
20
21
  v1: verifiedaccess_v1.Verifiedaccess,
22
+ v2: verifiedaccess_v2.Verifiedaccess,
21
23
  };
22
24
 
23
25
  export function verifiedaccess(version: 'v1'): verifiedaccess_v1.Verifiedaccess;
24
26
  export function verifiedaccess(
25
27
  options: verifiedaccess_v1.Options
26
28
  ): verifiedaccess_v1.Verifiedaccess;
27
- export function verifiedaccess<T = verifiedaccess_v1.Verifiedaccess>(
29
+ export function verifiedaccess(version: 'v2'): verifiedaccess_v2.Verifiedaccess;
30
+ export function verifiedaccess(
31
+ options: verifiedaccess_v2.Options
32
+ ): verifiedaccess_v2.Verifiedaccess;
33
+ export function verifiedaccess<
34
+ T = verifiedaccess_v1.Verifiedaccess | verifiedaccess_v2.Verifiedaccess
35
+ >(
28
36
  this: GoogleConfigurable,
29
- versionOrOptions: 'v1' | verifiedaccess_v1.Options
37
+ versionOrOptions:
38
+ | 'v1'
39
+ | verifiedaccess_v1.Options
40
+ | 'v2'
41
+ | verifiedaccess_v2.Options
30
42
  ) {
31
43
  return getAPI<T>('verifiedaccess', versionOrOptions, VERSIONS, this);
32
44
  }
@@ -34,6 +46,7 @@ export function verifiedaccess<T = verifiedaccess_v1.Verifiedaccess>(
34
46
  const auth = new AuthPlus();
35
47
  export {auth};
36
48
  export {verifiedaccess_v1};
49
+ export {verifiedaccess_v2};
37
50
  export {
38
51
  AuthPlus,
39
52
  GlobalOptions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@googleapis/verifiedaccess",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "verifiedaccess",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "@microsoft/api-extractor": "^7.8.10",
36
36
  "gts": "^2.0.0",
37
37
  "null-loader": "^4.0.0",
38
- "ts-loader": "^8.0.0",
38
+ "ts-loader": "^9.0.0",
39
39
  "typescript": "~3.7.0",
40
40
  "webpack": "^5.0.0",
41
41
  "webpack-cli": "^4.0.0"
package/v2.ts ADDED
@@ -0,0 +1,481 @@
1
+ // Copyright 2020 Google LLC
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ /* eslint-disable @typescript-eslint/no-explicit-any */
15
+ /* eslint-disable @typescript-eslint/class-name-casing */
16
+ /* eslint-disable @typescript-eslint/no-unused-vars */
17
+ /* eslint-disable @typescript-eslint/no-empty-interface */
18
+ /* eslint-disable @typescript-eslint/no-namespace */
19
+ /* eslint-disable no-irregular-whitespace */
20
+
21
+ import {
22
+ OAuth2Client,
23
+ JWT,
24
+ Compute,
25
+ UserRefreshClient,
26
+ BaseExternalAccountClient,
27
+ GaxiosPromise,
28
+ GoogleConfigurable,
29
+ createAPIRequest,
30
+ MethodOptions,
31
+ StreamMethodOptions,
32
+ GlobalOptions,
33
+ GoogleAuth,
34
+ BodyResponseCallback,
35
+ APIRequestContext,
36
+ } from 'googleapis-common';
37
+ import {Readable} from 'stream';
38
+
39
+ export namespace verifiedaccess_v2 {
40
+ export interface Options extends GlobalOptions {
41
+ version: 'v2';
42
+ }
43
+
44
+ interface StandardParameters {
45
+ /**
46
+ * Auth client or API Key for the request
47
+ */
48
+ auth?:
49
+ | string
50
+ | OAuth2Client
51
+ | JWT
52
+ | Compute
53
+ | UserRefreshClient
54
+ | BaseExternalAccountClient
55
+ | GoogleAuth;
56
+
57
+ /**
58
+ * V1 error format.
59
+ */
60
+ '$.xgafv'?: string;
61
+ /**
62
+ * OAuth access token.
63
+ */
64
+ access_token?: string;
65
+ /**
66
+ * Data format for response.
67
+ */
68
+ alt?: string;
69
+ /**
70
+ * JSONP
71
+ */
72
+ callback?: string;
73
+ /**
74
+ * Selector specifying which fields to include in a partial response.
75
+ */
76
+ fields?: string;
77
+ /**
78
+ * 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.
79
+ */
80
+ key?: string;
81
+ /**
82
+ * OAuth 2.0 token for the current user.
83
+ */
84
+ oauth_token?: string;
85
+ /**
86
+ * Returns response with indentations and line breaks.
87
+ */
88
+ prettyPrint?: boolean;
89
+ /**
90
+ * 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.
91
+ */
92
+ quotaUser?: string;
93
+ /**
94
+ * Legacy upload protocol for media (e.g. "media", "multipart").
95
+ */
96
+ uploadType?: string;
97
+ /**
98
+ * Upload protocol for media (e.g. "raw", "multipart").
99
+ */
100
+ upload_protocol?: string;
101
+ }
102
+
103
+ /**
104
+ * Chrome Verified Access API
105
+ *
106
+ * API for Verified Access chrome extension to provide credential verification for chrome devices connecting to an enterprise network
107
+ *
108
+ * @example
109
+ * ```js
110
+ * const {google} = require('googleapis');
111
+ * const verifiedaccess = google.verifiedaccess('v2');
112
+ * ```
113
+ */
114
+ export class Verifiedaccess {
115
+ context: APIRequestContext;
116
+ challenge: Resource$Challenge;
117
+
118
+ constructor(options: GlobalOptions, google?: GoogleConfigurable) {
119
+ this.context = {
120
+ _options: options || {},
121
+ google,
122
+ };
123
+
124
+ this.challenge = new Resource$Challenge(this.context);
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Result message for VerifiedAccess.CreateChallenge.
130
+ */
131
+ export interface Schema$Challenge {
132
+ /**
133
+ * Challenge generated with the old signing key, the bytes representation of SignedData (this will only be present during key rotation).
134
+ */
135
+ alternativeChallenge?: string | null;
136
+ /**
137
+ * Generated challenge, the bytes representation of SignedData.
138
+ */
139
+ challenge?: string | null;
140
+ }
141
+ /**
142
+ * A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \} The JSON representation for `Empty` is empty JSON object `{\}`.
143
+ */
144
+ export interface Schema$Empty {}
145
+ /**
146
+ * Signed ChallengeResponse.
147
+ */
148
+ export interface Schema$VerifyChallengeResponseRequest {
149
+ /**
150
+ * Required. The generated response to the challenge, the bytes representation of SignedData.
151
+ */
152
+ challengeResponse?: string | null;
153
+ /**
154
+ * 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.
155
+ */
156
+ expectedIdentity?: string | null;
157
+ }
158
+ /**
159
+ * Result message for VerifiedAccess.VerifyChallengeResponse.
160
+ */
161
+ export interface Schema$VerifyChallengeResponseResult {
162
+ /**
163
+ * Device permanent id is returned in this field (for the machine response only).
164
+ */
165
+ devicePermanentId?: string | null;
166
+ /**
167
+ * Device signal in json string representation.
168
+ */
169
+ deviceSignal?: string | null;
170
+ /**
171
+ * Device attested key trust level.
172
+ */
173
+ keyTrustLevel?: string | null;
174
+ /**
175
+ * 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)
176
+ */
177
+ signedPublicKeyAndChallenge?: string | null;
178
+ }
179
+
180
+ export class Resource$Challenge {
181
+ context: APIRequestContext;
182
+ constructor(context: APIRequestContext) {
183
+ this.context = context;
184
+ }
185
+
186
+ /**
187
+ * Generates a new challenge.
188
+ * @example
189
+ * ```js
190
+ * // Before running the sample:
191
+ * // - Enable the API at:
192
+ * // https://console.developers.google.com/apis/api/verifiedaccess.googleapis.com
193
+ * // - Login into gcloud by running:
194
+ * // `$ gcloud auth application-default login`
195
+ * // - Install the npm module by running:
196
+ * // `$ npm install googleapis`
197
+ *
198
+ * const {google} = require('googleapis');
199
+ * const verifiedaccess = google.verifiedaccess('v2');
200
+ *
201
+ * async function main() {
202
+ * const auth = new google.auth.GoogleAuth({
203
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
204
+ * scopes: ['https://www.googleapis.com/auth/verifiedaccess'],
205
+ * });
206
+ *
207
+ * // Acquire an auth client, and bind it to all future calls
208
+ * const authClient = await auth.getClient();
209
+ * google.options({auth: authClient});
210
+ *
211
+ * // Do the magic
212
+ * const res = await verifiedaccess.challenge.generate({
213
+ * // Request body metadata
214
+ * requestBody: {
215
+ * // request body parameters
216
+ * // {}
217
+ * },
218
+ * });
219
+ * console.log(res.data);
220
+ *
221
+ * // Example response
222
+ * // {
223
+ * // "alternativeChallenge": "my_alternativeChallenge",
224
+ * // "challenge": "my_challenge"
225
+ * // }
226
+ * }
227
+ *
228
+ * main().catch(e => {
229
+ * console.error(e);
230
+ * throw e;
231
+ * });
232
+ *
233
+ * ```
234
+ *
235
+ * @param params - Parameters for request
236
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
237
+ * @param callback - Optional callback that handles the response.
238
+ * @returns A promise if used with async/await, or void if used with a callback.
239
+ */
240
+ generate(
241
+ params: Params$Resource$Challenge$Generate,
242
+ options: StreamMethodOptions
243
+ ): GaxiosPromise<Readable>;
244
+ generate(
245
+ params?: Params$Resource$Challenge$Generate,
246
+ options?: MethodOptions
247
+ ): GaxiosPromise<Schema$Challenge>;
248
+ generate(
249
+ params: Params$Resource$Challenge$Generate,
250
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
251
+ callback: BodyResponseCallback<Readable>
252
+ ): void;
253
+ generate(
254
+ params: Params$Resource$Challenge$Generate,
255
+ options: MethodOptions | BodyResponseCallback<Schema$Challenge>,
256
+ callback: BodyResponseCallback<Schema$Challenge>
257
+ ): void;
258
+ generate(
259
+ params: Params$Resource$Challenge$Generate,
260
+ callback: BodyResponseCallback<Schema$Challenge>
261
+ ): void;
262
+ generate(callback: BodyResponseCallback<Schema$Challenge>): void;
263
+ generate(
264
+ paramsOrCallback?:
265
+ | Params$Resource$Challenge$Generate
266
+ | BodyResponseCallback<Schema$Challenge>
267
+ | BodyResponseCallback<Readable>,
268
+ optionsOrCallback?:
269
+ | MethodOptions
270
+ | StreamMethodOptions
271
+ | BodyResponseCallback<Schema$Challenge>
272
+ | BodyResponseCallback<Readable>,
273
+ callback?:
274
+ | BodyResponseCallback<Schema$Challenge>
275
+ | BodyResponseCallback<Readable>
276
+ ): void | GaxiosPromise<Schema$Challenge> | GaxiosPromise<Readable> {
277
+ let params = (paramsOrCallback ||
278
+ {}) as Params$Resource$Challenge$Generate;
279
+ let options = (optionsOrCallback || {}) as MethodOptions;
280
+
281
+ if (typeof paramsOrCallback === 'function') {
282
+ callback = paramsOrCallback;
283
+ params = {} as Params$Resource$Challenge$Generate;
284
+ options = {};
285
+ }
286
+
287
+ if (typeof optionsOrCallback === 'function') {
288
+ callback = optionsOrCallback;
289
+ options = {};
290
+ }
291
+
292
+ const rootUrl =
293
+ options.rootUrl || 'https://verifiedaccess.googleapis.com/';
294
+ const parameters = {
295
+ options: Object.assign(
296
+ {
297
+ url: (rootUrl + '/v2/challenge:generate').replace(
298
+ /([^:]\/)\/+/g,
299
+ '$1'
300
+ ),
301
+ method: 'POST',
302
+ },
303
+ options
304
+ ),
305
+ params,
306
+ requiredParams: [],
307
+ pathParams: [],
308
+ context: this.context,
309
+ };
310
+ if (callback) {
311
+ createAPIRequest<Schema$Challenge>(
312
+ parameters,
313
+ callback as BodyResponseCallback<unknown>
314
+ );
315
+ } else {
316
+ return createAPIRequest<Schema$Challenge>(parameters);
317
+ }
318
+ }
319
+
320
+ /**
321
+ * Verifies the challenge response.
322
+ * @example
323
+ * ```js
324
+ * // Before running the sample:
325
+ * // - Enable the API at:
326
+ * // https://console.developers.google.com/apis/api/verifiedaccess.googleapis.com
327
+ * // - Login into gcloud by running:
328
+ * // `$ gcloud auth application-default login`
329
+ * // - Install the npm module by running:
330
+ * // `$ npm install googleapis`
331
+ *
332
+ * const {google} = require('googleapis');
333
+ * const verifiedaccess = google.verifiedaccess('v2');
334
+ *
335
+ * async function main() {
336
+ * const auth = new google.auth.GoogleAuth({
337
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
338
+ * scopes: ['https://www.googleapis.com/auth/verifiedaccess'],
339
+ * });
340
+ *
341
+ * // Acquire an auth client, and bind it to all future calls
342
+ * const authClient = await auth.getClient();
343
+ * google.options({auth: authClient});
344
+ *
345
+ * // Do the magic
346
+ * const res = await verifiedaccess.challenge.verify({
347
+ * // Request body metadata
348
+ * requestBody: {
349
+ * // request body parameters
350
+ * // {
351
+ * // "challengeResponse": "my_challengeResponse",
352
+ * // "expectedIdentity": "my_expectedIdentity"
353
+ * // }
354
+ * },
355
+ * });
356
+ * console.log(res.data);
357
+ *
358
+ * // Example response
359
+ * // {
360
+ * // "devicePermanentId": "my_devicePermanentId",
361
+ * // "deviceSignal": "my_deviceSignal",
362
+ * // "keyTrustLevel": "my_keyTrustLevel",
363
+ * // "signedPublicKeyAndChallenge": "my_signedPublicKeyAndChallenge"
364
+ * // }
365
+ * }
366
+ *
367
+ * main().catch(e => {
368
+ * console.error(e);
369
+ * throw e;
370
+ * });
371
+ *
372
+ * ```
373
+ *
374
+ * @param params - Parameters for request
375
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
376
+ * @param callback - Optional callback that handles the response.
377
+ * @returns A promise if used with async/await, or void if used with a callback.
378
+ */
379
+ verify(
380
+ params: Params$Resource$Challenge$Verify,
381
+ options: StreamMethodOptions
382
+ ): GaxiosPromise<Readable>;
383
+ verify(
384
+ params?: Params$Resource$Challenge$Verify,
385
+ options?: MethodOptions
386
+ ): GaxiosPromise<Schema$VerifyChallengeResponseResult>;
387
+ verify(
388
+ params: Params$Resource$Challenge$Verify,
389
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
390
+ callback: BodyResponseCallback<Readable>
391
+ ): void;
392
+ verify(
393
+ params: Params$Resource$Challenge$Verify,
394
+ options:
395
+ | MethodOptions
396
+ | BodyResponseCallback<Schema$VerifyChallengeResponseResult>,
397
+ callback: BodyResponseCallback<Schema$VerifyChallengeResponseResult>
398
+ ): void;
399
+ verify(
400
+ params: Params$Resource$Challenge$Verify,
401
+ callback: BodyResponseCallback<Schema$VerifyChallengeResponseResult>
402
+ ): void;
403
+ verify(
404
+ callback: BodyResponseCallback<Schema$VerifyChallengeResponseResult>
405
+ ): void;
406
+ verify(
407
+ paramsOrCallback?:
408
+ | Params$Resource$Challenge$Verify
409
+ | BodyResponseCallback<Schema$VerifyChallengeResponseResult>
410
+ | BodyResponseCallback<Readable>,
411
+ optionsOrCallback?:
412
+ | MethodOptions
413
+ | StreamMethodOptions
414
+ | BodyResponseCallback<Schema$VerifyChallengeResponseResult>
415
+ | BodyResponseCallback<Readable>,
416
+ callback?:
417
+ | BodyResponseCallback<Schema$VerifyChallengeResponseResult>
418
+ | BodyResponseCallback<Readable>
419
+ ):
420
+ | void
421
+ | GaxiosPromise<Schema$VerifyChallengeResponseResult>
422
+ | GaxiosPromise<Readable> {
423
+ let params = (paramsOrCallback || {}) as Params$Resource$Challenge$Verify;
424
+ let options = (optionsOrCallback || {}) as MethodOptions;
425
+
426
+ if (typeof paramsOrCallback === 'function') {
427
+ callback = paramsOrCallback;
428
+ params = {} as Params$Resource$Challenge$Verify;
429
+ options = {};
430
+ }
431
+
432
+ if (typeof optionsOrCallback === 'function') {
433
+ callback = optionsOrCallback;
434
+ options = {};
435
+ }
436
+
437
+ const rootUrl =
438
+ options.rootUrl || 'https://verifiedaccess.googleapis.com/';
439
+ const parameters = {
440
+ options: Object.assign(
441
+ {
442
+ url: (rootUrl + '/v2/challenge:verify').replace(
443
+ /([^:]\/)\/+/g,
444
+ '$1'
445
+ ),
446
+ method: 'POST',
447
+ },
448
+ options
449
+ ),
450
+ params,
451
+ requiredParams: [],
452
+ pathParams: [],
453
+ context: this.context,
454
+ };
455
+ if (callback) {
456
+ createAPIRequest<Schema$VerifyChallengeResponseResult>(
457
+ parameters,
458
+ callback as BodyResponseCallback<unknown>
459
+ );
460
+ } else {
461
+ return createAPIRequest<Schema$VerifyChallengeResponseResult>(
462
+ parameters
463
+ );
464
+ }
465
+ }
466
+ }
467
+
468
+ export interface Params$Resource$Challenge$Generate
469
+ extends StandardParameters {
470
+ /**
471
+ * Request body metadata
472
+ */
473
+ requestBody?: Schema$Empty;
474
+ }
475
+ export interface Params$Resource$Challenge$Verify extends StandardParameters {
476
+ /**
477
+ * Request body metadata
478
+ */
479
+ requestBody?: Schema$VerifyChallengeResponseRequest;
480
+ }
481
+ }