Пример #1
0
 def __init__(self, account):
     self.config = get_oauth_config(domain)
     self.account = account
     try:
         self.oauth_token = oauth.Token(key=account.get('oauth_token'), secret=account.get('oauth_token_secret'))
     except ValueError, e:
         # missing oauth tokens, raise our own exception
         raise OAuthKeysException(str(e))
Пример #2
0
 def __init__(self, account):
     self.config = get_oauth_config(domain)
     self.account = account
     self.oauth_token = oauth.Token(key=account.get('oauth_token'), secret=account.get('oauth_token_secret'))
     self.consumer_key = self.config.get('consumer_key')
     self.consumer_secret = self.config.get('consumer_secret')
     self.consumer = oauth.Consumer(key=self.consumer_key, secret=self.consumer_secret)
     self.sigmethod = oauth.SignatureMethod_HMAC_SHA1()
Пример #3
0
 def __init__(self, account):
     self.config = get_oauth_config(domain)
     self.account = account
     try:
         self.oauth_token = oauth.Token(key=account.get('oauth_token'), secret=account.get('oauth_token_secret'))
     except ValueError, e:
         # missing oauth tokens, raise our own exception
         raise OAuthKeysException(str(e))
Пример #4
0
 def __init__(self, account):
     self.host = "smtp.gmail.com"
     self.port = 587
     self.config = get_oauth_config(domain)
     self.account = account
     self.oauth_token = oauth.Token(key=account.get('oauth_token'), secret=account.get('oauth_token_secret'))
     self.consumer_key = self.config.get('consumer_key')
     self.consumer_secret = self.config.get('consumer_secret')
     self.consumer = oauth.Consumer(key=self.consumer_key, secret=self.consumer_secret)
Пример #5
0
 def __init__(self,
              account=None,
              oauth_token=None,
              oauth_token_secret=None):
     self.oauth_token = account and account.get(
         'oauth_token') or oauth_token
     self.oauth_token_secret = account and account.get(
         'oauth_token_secret') or oauth_token_secret
     self.config = get_oauth_config(domain)
Пример #6
0
 def __init__(self, account):
     self.host = "smtp.gmail.com"
     self.port = 587
     self.config = get_oauth_config(domain)
     self.account = account
     try:
         self.oauth_token = oauth.Token(
             key=str(account.get("oauth_token")), secret=str(account.get("oauth_token_secret"))
         )
     except ValueError, e:
         # missing oauth tokens, raise our own exception
         raise OAuthKeysException(str(e))
Пример #7
0
    def __init__(self, provider):
        self.provider = provider
        self.log_debug = logging.DEBUG >= log.getEffectiveLevel()

        self.config = get_oauth_config(provider)

        self.endpoint_regex = self.config.get('endpoint_regex')

        # application config items, dont use self.config
        store = config.get('openid_store', 'mem')
        if store==u"file":
            store_file_path = config.get('openid_store_path', None)
            self.openid_store = filestore.FileOpenIDStore(store_file_path)
        elif store==u"mem":
            self.openid_store = memstore.MemoryStore()
        elif store==u"sql":
            # TODO: This does not work as we need a connection, not a string
            self.openid_store = sqlstore.SQLStore(sql_connstring, sql_associations_table, sql_connstring)
        self.scope = self.config.get('scope', None)
        self.return_to_query = {}
Пример #8
0
    def __init__(self, provider):
        self.provider = provider
        self.consumer_class = None
        self.log_debug = logging.DEBUG >= log.getEffectiveLevel()

        self.config = get_oauth_config(provider)

        self.endpoint_regex = self.config.get('endpoint_regex')

        # application config items, dont use self.config
        store = config.get('openid_store', 'mem')
        if store == u"file":
            store_file_path = config.get('openid_store_path', None)
            self.openid_store = filestore.FileOpenIDStore(store_file_path)
        elif store == u"mem":
            self.openid_store = memstore.MemoryStore()
        elif store == u"sql":
            # TODO: This does not work as we need a connection, not a string
            self.openid_store = sqlstore.SQLStore(sql_connstring,
                                                  sql_associations_table,
                                                  sql_connstring)
        self.scope = self.config.get('scope', None)
        self.return_to_query = {}
Пример #9
0
 def __init__(self, account=None, oauth_token=None, oauth_token_secret=None):
     self.oauth_token = account and account.get('oauth_token') or oauth_token
     self.oauth_token_secret = account and account.get('oauth_token_secret') or oauth_token_secret
     self.config = get_oauth_config(domain)