Exemplo n.º 1
0
    def _lookup(self, container_id, *remainder):
        if not utils.validate_id_is_uuid(container_id):
            invalid_container_id()
        container = self.container_repo.get_container_by_id(
            entity_id=container_id, suppress_exception=True)
        if not container:
            container_not_found()

        if len(remainder) > 0 and remainder[0] == 'secrets':
            return ContainersSecretsController(container), ()

        return ContainerController(container), remainder
Exemplo n.º 2
0
    def _lookup(self, container_id, *remainder):
        if not utils.validate_id_is_uuid(container_id):
            invalid_container_id()
        container = self.container_repo.get_container_by_id(
            entity_id=container_id, suppress_exception=True)
        if not container:
            container_not_found()

        if len(remainder) > 0 and remainder[0] == 'secrets':
            return ContainersSecretsController(container), ()

        return ContainerController(container), remainder
Exemplo n.º 3
0
    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.

        if not utils.validate_id_is_uuid(secret_id):
            _invalid_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
Exemplo n.º 4
0
    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.

        if not utils.validate_id_is_uuid(secret_id):
            _invalid_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
Exemplo n.º 5
0
 def _lookup(self, consumer_id, *remainder):
     if not utils.validate_id_is_uuid(consumer_id):
         _invalid_consumer_id()()
     return ContainerConsumerController(self.container, consumer_id), \
         remainder
Exemplo n.º 6
0
 def _lookup(self, consumer_id, *remainder):
     if not utils.validate_id_is_uuid(consumer_id):
         _invalid_consumer_id()()
     return SecretConsumerController(self.secret, consumer_id), remainder
Exemplo n.º 7
0
 def _lookup(self, consumer_id, *remainder):
     if not utils.validate_id_is_uuid(consumer_id):
         _invalid_consumer_id()()
     return ContainerConsumerController(consumer_id), remainder
Exemplo n.º 8
0
 def _lookup(self, transport_key_id, *remainder):
     if not utils.validate_id_is_uuid(transport_key_id):
         _invalid_transport_key_id()
     return TransportKeyController(transport_key_id, self.repo), remainder