class Lt::Google::Api::Auth::Cli

Constants

CONFIG_SECRET_FILE
CONFIG_TOKEN_FILE
SCOPE
USER_ID

Public Class Methods

authorizer() click to toggle source
# File lib/lt/google/api/auth/cli.rb, line 16
def self.authorizer
  @authorizer ||= begin
    client_id = ::Google::Auth::ClientId.from_file(CONFIG_SECRET_FILE)
    token_store = ::Google::Auth::Stores::FileTokenStore.new(file: CONFIG_TOKEN_FILE)
    ::Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)
  end
end

Public Instance Methods

authorizer() click to toggle source
# File lib/lt/google/api/auth/cli.rb, line 24
def authorizer
  self.class.authorizer
end
credentials() click to toggle source
# File lib/lt/google/api/auth/cli.rb, line 28
def credentials
  @credentials ||= authorizer.get_credentials(USER_ID)
end