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
            # XXX
            #self.openid_store = sqlstore.SQLStore(sql_connstring,
            #        sql_associations_table, sql_connstring)
            raise NotImplementedError()

        self.scope = self.config.get('scope', None)
        self.return_to_query = {}
Beispiel #2
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))
Beispiel #3
0
 def __init__(self, account):
     self.domain = domain
     self.account = account
     self.host = "smtp.gmail.com"
     self.port = 587
     self.config = get_oauth_config(domain)
     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))
Beispiel #4
0
    def __init__(self,
                 account=None,
                 oauth_token=None,
                 oauth_token_secret=None):
        self.domain = domain
        self.config = get_oauth_config(domain)
        oauth_token = account and account.get('oauth_token') or oauth_token
        oauth_token_secret = (account and account.get('oauth_token_secret')
                              or oauth_token_secret)

        self.account = account
        try:
            self.oauth_token = oauth.Token(key=oauth_token,
                                           secret=oauth_token_secret)
        except ValueError, e:
            # missing oauth tokens, raise our own exception
            raise OAuthKeysException(str(e))