コード例 #1
0
ファイル: gateway.py プロジェクト: crowdy/glance
 def get_task_stub_repo(self, context, authorization_layer=True):
     repo = glance.db.TaskRepo(context, self.db_api)
     if authorization_layer:
         repo = policy.TaskStubRepoProxy(repo, context, self.policy)
     repo = glance.notifier.TaskStubRepoProxy(repo, context, self.notifier)
     if authorization_layer:
         repo = authorization.TaskStubRepoProxy(repo, context)
     return repo
コード例 #2
0
ファイル: gateway.py プロジェクト: onodes/glance
 def get_task_stub_repo(self, context):
     task_stub_repo = glance.db.TaskRepo(context, self.db_api)
     policy_task_stub_repo = policy.TaskStubRepoProxy(
         task_stub_repo, context, self.policy)
     notifier_task_stub_repo = glance.notifier.TaskStubRepoProxy(
         policy_task_stub_repo, context, self.notifier)
     authorized_task_stub_repo = authorization.TaskStubRepoProxy(
         notifier_task_stub_repo, context)
     return authorized_task_stub_repo
コード例 #3
0
ファイル: test_auth.py プロジェクト: p0i0/openstack-glance
 def setUp(self):
     super(TestTaskRepoProxy, self).setUp()
     task_factory = glance.domain.TaskFactory()
     task_type = 'import'
     owner = None
     self.fixtures = [
         task_factory.new_task(task_type, owner),
         task_factory.new_task(task_type, owner),
         task_factory.new_task(task_type, owner),
     ]
     self.context = glance.context.RequestContext(tenant=TENANT1)
     task_repo = self.TaskRepoStub(self.fixtures)
     task_stub_repo = self.TaskStubRepoStub(self.fixtures)
     self.task_repo = authorization.TaskRepoProxy(task_repo, self.context)
     self.task_stub_repo = authorization.TaskStubRepoProxy(
         task_stub_repo, self.context)