Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit a806b8b

Browse files
feat: add first party oauth (#22)
1 parent d10fd6d commit a806b8b

File tree

14 files changed

+221
-194
lines changed

14 files changed

+221
-194
lines changed

.coveragerc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
# Generated by synthtool. DO NOT EDIT!
218
[run]
319
branch = True

.flake8

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
# Generated by synthtool. DO NOT EDIT!
218
[flake8]
319
ignore = E203, E266, E501, W503

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ Thanks for stopping by to let us know something could be better!
1111
Please run down the following list and make sure you've tried the usual "quick fixes":
1212

1313
- Search the issues already opened: https://github.com/googleapis/python-bigquery-datatransfer/issues
14-
- Search the issues on our "catch-all" repository: https://github.com/googleapis/google-cloud-python
15-
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+python
14+
- Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python
1615

1716
If you are still having issues, please be sure to include as much information as possible:
1817

CONTRIBUTING.rst

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions: 2.7,
25-
3.5, 3.6, and 3.7 on both UNIX and Windows.
25+
3.5, 3.6, 3.7 and 3.8 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -214,26 +214,18 @@ We support:
214214
- `Python 3.5`_
215215
- `Python 3.6`_
216216
- `Python 3.7`_
217+
- `Python 3.8`_
217218

218219
.. _Python 3.5: https://docs.python.org/3.5/
219220
.. _Python 3.6: https://docs.python.org/3.6/
220221
.. _Python 3.7: https://docs.python.org/3.7/
222+
.. _Python 3.8: https://docs.python.org/3.8/
221223

222224

223225
Supported versions can be found in our ``noxfile.py`` `config`_.
224226

225227
.. _config: https://github.com/googleapis/python-bigquery-datatransfer/blob/master/noxfile.py
226228

227-
We explicitly decided not to support `Python 2.5`_ due to `decreased usage`_
228-
and lack of continuous integration `support`_.
229-
230-
.. _Python 2.5: https://docs.python.org/2.5/
231-
.. _decreased usage: https://caremad.io/2013/10/a-look-at-pypi-downloads/
232-
.. _support: https://blog.travis-ci.com/2013-11-18-upcoming-build-environment-updates/
233-
234-
We have `dropped 2.6`_ as a supported version as well since Python 2.6 is no
235-
longer supported by the core development team.
236-
237229
Python 2.7 support is deprecated. All code changes should maintain Python 2.7 compatibility until January 1, 2020.
238230

239231
We also explicitly decided to support Python 3 beginning with version
@@ -247,7 +239,6 @@ We also explicitly decided to support Python 3 beginning with version
247239
.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
248240
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
249241
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
250-
.. _dropped 2.6: https://github.com/googleapis/google-cloud-python/issues/995
251242

252243
**********
253244
Versioning

MANIFEST.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
# Generated by synthtool. DO NOT EDIT!
218
include README.rst LICENSE
319
recursive-include google *.json *.proto

google/cloud/bigquery_datatransfer_v1/gapic/data_transfer_service_client.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8888

8989
from_service_account_json = from_service_account_file
9090

91+
@classmethod
92+
def data_source_path(cls, project, data_source):
93+
"""Return a fully-qualified data_source string."""
94+
return google.api_core.path_template.expand(
95+
"projects/{project}/dataSources/{data_source}",
96+
project=project,
97+
data_source=data_source,
98+
)
99+
91100
@classmethod
92101
def location_path(cls, project, location):
93102
"""Return a fully-qualified location string."""
@@ -163,6 +172,25 @@ def project_transfer_config_path(cls, project, transfer_config):
163172
transfer_config=transfer_config,
164173
)
165174

175+
@classmethod
176+
def run_path(cls, project, transfer_config, run):
177+
"""Return a fully-qualified run string."""
178+
return google.api_core.path_template.expand(
179+
"projects/{project}/transferConfigs/{transfer_config}/runs/{run}",
180+
project=project,
181+
transfer_config=transfer_config,
182+
run=run,
183+
)
184+
185+
@classmethod
186+
def transfer_config_path(cls, project, transfer_config):
187+
"""Return a fully-qualified transfer_config string."""
188+
return google.api_core.path_template.expand(
189+
"projects/{project}/transferConfigs/{transfer_config}",
190+
project=project,
191+
transfer_config=transfer_config,
192+
)
193+
166194
def __init__(
167195
self,
168196
transport=None,

google/cloud/bigquery_datatransfer_v1/gapic/enums.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ class AuthorizationType(enum.IntEnum):
8282
for a refresh token on the backend.
8383
GOOGLE_PLUS_AUTHORIZATION_CODE (int): Return an authorization code for a given Google+ page that can then be
8484
exchanged for a refresh token on the backend.
85+
FIRST_PARTY_OAUTH (int): Use First Party Client OAuth. First Party Client OAuth doesn't require a
86+
refresh token to get an offline access token. Instead, it uses a
87+
client-signed JWT assertion to retrieve an access token.
8588
"""
8689

8790
AUTHORIZATION_TYPE_UNSPECIFIED = 0
8891
AUTHORIZATION_CODE = 1
8992
GOOGLE_PLUS_AUTHORIZATION_CODE = 2
93+
FIRST_PARTY_OAUTH = 3
9094

9195
class DataRefreshType(enum.IntEnum):
9296
"""

google/cloud/bigquery_datatransfer_v1/proto/datatransfer.proto

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2020 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
//
1514

1615
syntax = "proto3";
1716

@@ -34,6 +33,7 @@ option java_multiple_files = true;
3433
option java_outer_classname = "DataTransferProto";
3534
option java_package = "com.google.cloud.bigquery.datatransfer.v1";
3635
option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1";
36+
option ruby_package = "Google::Cloud::Bigquery::DataTransfer::V1";
3737

3838
// The Google BigQuery Data Transfer Service API enables BigQuery users to
3939
// configure the transfer of their data from other Google Products into
@@ -328,6 +328,11 @@ message DataSource {
328328
// Return an authorization code for a given Google+ page that can then be
329329
// exchanged for a refresh token on the backend.
330330
GOOGLE_PLUS_AUTHORIZATION_CODE = 2;
331+
332+
// Use First Party Client OAuth. First Party Client OAuth doesn't require a
333+
// refresh token to get an offline access token. Instead, it uses a
334+
// client-signed JWT assertion to retrieve an access token.
335+
FIRST_PARTY_OAUTH = 3;
331336
}
332337

333338
// Represents how the data source supports data auto refresh.

0 commit comments

Comments
 (0)