예제 #1
0
 def update_consumer(self, consumer_id, consumer):
     session = sql.get_session()
     with session.begin():
         consumer_ref = self._get_consumer(session, consumer_id)
         old_consumer_dict = consumer_ref.to_dict()
         old_consumer_dict.update(consumer)
         new_consumer = Consumer.from_dict(old_consumer_dict)
         for attr in Consumer.attributes:
             if attr != 'id':
                 setattr(consumer_ref, attr, getattr(new_consumer, attr))
         consumer_ref.extra = new_consumer.extra
     return oauth2.filter_consumer(consumer_ref.to_dict())
예제 #2
0
파일: sql.py 프로젝트: AlvaroVega/keystone
 def update_consumer(self, consumer_id, consumer):
     session = sql.get_session()
     with session.begin():            
         consumer_ref = self._get_consumer(session, consumer_id)
         old_consumer_dict = consumer_ref.to_dict()
         old_consumer_dict.update(consumer)
         new_consumer = Consumer.from_dict(old_consumer_dict)
         for attr in Consumer.attributes:
             if attr != 'id':
                 setattr(consumer_ref, attr, getattr(new_consumer, attr))
         consumer_ref.extra = new_consumer.extra
     return oauth2.filter_consumer(consumer_ref.to_dict())
예제 #3
0
 def get_consumer(self, consumer_id):
     return oauth2.filter_consumer(
         self.get_consumer_with_secret(consumer_id))
예제 #4
0
 def list_consumers(self):
     session = sql.get_session()
     cons = session.query(Consumer)
     return [
         oauth2.filter_consumer(consumer.to_dict()) for consumer in cons
     ]
예제 #5
0
파일: sql.py 프로젝트: AlvaroVega/keystone
 def get_consumer(self, consumer_id):
     return oauth2.filter_consumer(
         self.get_consumer_with_secret(consumer_id))
예제 #6
0
파일: sql.py 프로젝트: AlvaroVega/keystone
 def list_consumers(self):
     session = sql.get_session()
     cons = session.query(Consumer)
     return [oauth2.filter_consumer(consumer.to_dict()) for consumer in cons]