Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove oauth2client from IoT and Functions samples #3255

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions functions/billing/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# [START functions_billing_limit_appengine]
# [START functions_billing_stop]
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
# [END functions_billing_stop]
# [END functions_billing_limit]
# [END functions_billing_limit_appengine]
Expand Down Expand Up @@ -80,7 +79,6 @@ def stop_billing(data, context):
'cloudbilling',
'v1',
cache_discovery=False,
credentials=GoogleCredentials.get_application_default()
busunkim96 marked this conversation as resolved.
Show resolved Hide resolved
)

projects = billing.projects()
Expand Down Expand Up @@ -130,7 +128,6 @@ def limit_use(data, context):
'compute',
'v1',
cache_discovery=False,
credentials=GoogleCredentials.get_application_default()
)
instances = compute.instances()

Expand Down Expand Up @@ -190,8 +187,7 @@ def limit_use_appengine(data, context):
appengine = discovery.build(
'appengine',
'v1',
cache_discovery=False,
credentials=GoogleCredentials.get_application_default()
cache_discovery=False
)
apps = appengine.apps()

Expand Down
1 change: 0 additions & 1 deletion functions/billing/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
slackclient==2.5.0
# [START functions_billing_limit_appengine_deps]
oauth2client==4.1.3
google-api-python-client==1.7.11
# [START functions_billing_limit_appengine_deps]
1 change: 0 additions & 1 deletion functions/slack/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
google-api-python-client==1.7.11
flask==1.1.1
oauth2client==4.1.3
slackeventsapi==2.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from google.cloud import pubsub
from googleapiclient import discovery
from googleapiclient.errors import HttpError
from oauth2client.service_account import ServiceAccountCredentials
from google.oauth2 import service_account


API_SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
Expand All @@ -58,8 +58,8 @@ class Server(object):
"""Represents the state of the server."""

def __init__(self, service_account_json):
credentials = ServiceAccountCredentials.from_json_keyfile_name(
service_account_json, API_SCOPES)
credentials = service_account.from_service_account_file(
service_account_json).with_scopes(API_SCOPES)
if not credentials:
sys.exit('Could not load service account credential '
'from {}'.format(service_account_json))
Expand Down
1 change: 0 additions & 1 deletion iot/api-client/end_to_end_example/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ google-api-python-client==1.7.11
google-auth-httplib2==0.0.3
google-auth==1.11.2
google-cloud-pubsub==1.1.0
oauth2client==4.1.3
pyjwt==1.7.1
paho-mqtt==1.5.0
1 change: 0 additions & 1 deletion iot/api-client/manager/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ google-auth-httplib2==0.0.3
google-auth==1.11.2
google-cloud-iot==1.0.0
google-cloud-pubsub==1.1.0
oauth2client==4.1.3
paho-mqtt==1.5.0
pyjwt==1.7.1