Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
feat: use first party client oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored Apr 1, 2020
1 parent e9a9b24 commit b687434
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand Down Expand Up @@ -328,6 +327,11 @@ message DataSource {
// Return an authorization code for a given Google+ page that can then be
// exchanged for a refresh token on the backend.
GOOGLE_PLUS_AUTHORIZATION_CODE = 2;

// Use First Party Client OAuth. First Party Client OAuth doesn't require a
// refresh token to get an offline access token. Instead, it uses a
// client-signed JWT assertion to retrieve an access token.
FIRST_PARTY_OAUTH = 3;
}

// Represents how the data source supports data auto refresh.
Expand Down
3 changes: 1 addition & 2 deletions protos/google/cloud/bigquery/datatransfer/v1/transfer.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand Down
3 changes: 2 additions & 1 deletion protos/protos.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,8 @@ export namespace google {
enum AuthorizationType {
AUTHORIZATION_TYPE_UNSPECIFIED = 0,
AUTHORIZATION_CODE = 1,
GOOGLE_PLUS_AUTHORIZATION_CODE = 2
GOOGLE_PLUS_AUTHORIZATION_CODE = 2,
FIRST_PARTY_OAUTH = 3
}

/** DataRefreshType enum. */
Expand Down
7 changes: 7 additions & 0 deletions protos/protos.js
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,7 @@
case 0:
case 1:
case 2:
case 3:
break;
}
if (message.dataRefreshType != null && message.hasOwnProperty("dataRefreshType"))
Expand Down Expand Up @@ -1740,6 +1741,10 @@
case 2:
message.authorizationType = 2;
break;
case "FIRST_PARTY_OAUTH":
case 3:
message.authorizationType = 3;
break;
}
switch (object.dataRefreshType) {
case "DATA_REFRESH_TYPE_UNSPECIFIED":
Expand Down Expand Up @@ -1865,12 +1870,14 @@
* @property {number} AUTHORIZATION_TYPE_UNSPECIFIED=0 AUTHORIZATION_TYPE_UNSPECIFIED value
* @property {number} AUTHORIZATION_CODE=1 AUTHORIZATION_CODE value
* @property {number} GOOGLE_PLUS_AUTHORIZATION_CODE=2 GOOGLE_PLUS_AUTHORIZATION_CODE value
* @property {number} FIRST_PARTY_OAUTH=3 FIRST_PARTY_OAUTH value
*/
DataSource.AuthorizationType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "AUTHORIZATION_TYPE_UNSPECIFIED"] = 0;
values[valuesById[1] = "AUTHORIZATION_CODE"] = 1;
values[valuesById[2] = "GOOGLE_PLUS_AUTHORIZATION_CODE"] = 2;
values[valuesById[3] = "FIRST_PARTY_OAUTH"] = 3;
return values;
})();

Expand Down
3 changes: 2 additions & 1 deletion protos/protos.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@
"values": {
"AUTHORIZATION_TYPE_UNSPECIFIED": 0,
"AUTHORIZATION_CODE": 1,
"GOOGLE_PLUS_AUTHORIZATION_CODE": 2
"GOOGLE_PLUS_AUTHORIZATION_CODE": 2,
"FIRST_PARTY_OAUTH": 3
}
},
"DataRefreshType": {
Expand Down
2 changes: 1 addition & 1 deletion src/v1/data_transfer_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

import * as gax from 'google-gax';
import {
GaxCall,
Callback,
CallOptions,
Descriptors,
ClientOptions,
PaginationCallback,
GaxCall,
} from 'google-gax';
import * as path from 'path';

Expand Down
19 changes: 18 additions & 1 deletion synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{
"updateTime": "2020-03-31T19:14:07.961639Z",
"updateTime": "2020-04-01T11:31:02.754106Z",
"sources": [
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "dc65f39f33cb139b3a2244199a3e722a4d94b679",
"internalRef": "304035052"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "99820243d348191bc9c634f2b48ddf65096285ed"
}
}
],
"destinations": [
{
"client": {
Expand Down
2 changes: 1 addition & 1 deletion system-test/fixtures/sample/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {DataTransferServiceClient} from '@google-cloud/bigquery-data-transfer';

function main() {
const dataTransferServiceClient = new DataTransferServiceClient();
new DataTransferServiceClient();
}

main();

0 comments on commit b687434

Please sign in to comment.