def _lookup(self, secret_id, *remainder): # NOTE(jaosorior): It's worth noting that even though this section # actually does a lookup in the database regardless of the RBAC policy # check, the execution only gets here if authentication of the user was # previously successful. controllers.assert_is_valid_uuid_from_uri(secret_id) secret = self.secret_repo.get_secret_by_id( entity_id=secret_id, suppress_exception=True) if not secret: _secret_not_found() return SecretController(secret), remainder
def _lookup(self, secret_id, *remainder): # NOTE(jaosorior): It's worth noting that even though this section # actually does a lookup in the database regardless of the RBAC policy # check, the execution only gets here if authentication of the user was # previously successful. controllers.assert_is_valid_uuid_from_uri(secret_id) secret = self.secret_repo.get_secret_by_id(entity_id=secret_id, suppress_exception=True) if not secret: _secret_not_found() return SecretController(secret), remainder
def _lookup(self, order_id, *remainder): # NOTE(jaosorior): It's worth noting that even though this section # actually does a lookup in the database regardless of the RBAC policy # check, the execution only gets here if authentication of the user was # previously successful. controllers.assert_is_valid_uuid_from_uri(order_id) ctx = controllers._get_barbican_context(pecan.request) order = self.order_repo.get(entity_id=order_id, external_project_id=ctx.project, suppress_exception=True) if not order: _order_not_found() return OrderController(order, self.order_repo), remainder
def _lookup(self, order_id, *remainder): # NOTE(jaosorior): It's worth noting that even though this section # actually does a lookup in the database regardless of the RBAC policy # check, the execution only gets here if authentication of the user was # previously successful. controllers.assert_is_valid_uuid_from_uri(order_id) ctx = controllers._get_barbican_context(pecan.request) order = self.order_repo.get(entity_id=order_id, external_project_id=ctx.project, suppress_exception=True) if not order: _order_not_found() return OrderController(order, self.order_repo), remainder
def _assert_id_and_set_container(self, suppress_exception=False): """Checks whether container_id is valid or not. Whether container is associated with token's project is not needed as that check is now made via policy rule. """ if self.container: return controllers.assert_is_valid_uuid_from_uri(self.container_id) self.container = self.container_repo.get_container_by_id( entity_id=self.container_id, suppress_exception=True) if not self.container and not suppress_exception: controllers.containers.container_not_found() if self.container: self.container_project_id = self.container.project.external_id