Commit 68fd81a0 authored by Peter Kaldis's avatar Peter Kaldis

Merge branch 'attempt-service-account-authorization' into 'master'

Fixes service account authorization

See merge request !12
parents 30829a1c 2182f96e
......@@ -110,7 +110,7 @@ class GoogleDriveClient
attr_reader :session
def initialize(config)
@session = GoogleDrive::Session.from_config(config)
@session = GoogleDrive::Session.from_service_account_key(config)
end
def valid_file?(folders, filename, file_size)
......@@ -288,14 +288,15 @@ class ZoomSyncher
# Returns a config object that responds to client_id, etc.:
# https://www.rubydoc.info/gems/google_drive/2.1.1/GoogleDrive%2FSession.from_config
def load_gdrive_config
data =
if ENV['GOOGLE_DRIVE_CONFIG']
ENV['GOOGLE_DRIVE_CONFIG']
if ENV['GOOGLE_DRIVE_SERVICE_ACCOUNT_KEY']
ENV['GOOGLE_DRIVE_SERVICE_ACCOUNT_KEY']
else
File.read('config.json')
end
JSON.parse(data, object_class: OpenStruct)
StringIO.new(data)
end
# Discard any audio or videos that aren't longer than 30 seconds
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment