XOAUTH2: strip newlines of the returned values for the eval configuration options

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2016-08-14 23:17:09 +02:00
parent 00e6627299
commit 13043b5877

View File

@ -310,7 +310,7 @@ class IMAPRepository(BaseRepository):
if refresh_token is None: if refresh_token is None:
refresh_token = self.localeval.eval( refresh_token = self.localeval.eval(
self.getconf('oauth2_refresh_token_eval', "lambda: None") self.getconf('oauth2_refresh_token_eval', "lambda: None")
) ).strip("\n")
return refresh_token return refresh_token
def getoauth2_access_token(self): def getoauth2_access_token(self):
@ -318,7 +318,7 @@ class IMAPRepository(BaseRepository):
if access_token is None: if access_token is None:
access_token = self.localeval.eval( access_token = self.localeval.eval(
self.getconf('oauth2_access_token_eval', "lambda: None") self.getconf('oauth2_access_token_eval', "lambda: None")
) ).strip("\n")
return access_token return access_token
def getoauth2_client_id(self): def getoauth2_client_id(self):
@ -326,7 +326,7 @@ class IMAPRepository(BaseRepository):
if client_id is None: if client_id is None:
client_id = self.localeval.eval( client_id = self.localeval.eval(
self.getconf('oauth2_client_id_eval', "lambda: None") self.getconf('oauth2_client_id_eval', "lambda: None")
) ).strip("\n")
return client_id return client_id
def getoauth2_client_secret(self): def getoauth2_client_secret(self):
@ -334,7 +334,7 @@ class IMAPRepository(BaseRepository):
if client_secret is None: if client_secret is None:
client_secret = self.localeval.eval( client_secret = self.localeval.eval(
self.getconf('oauth2_client_secret_eval', "lambda: None") self.getconf('oauth2_client_secret_eval', "lambda: None")
) ).strip("\n")
return client_secret return client_secret
def getpreauthtunnel(self): def getpreauthtunnel(self):