Ejemplo n.º 1
0
    def get_signed_upload_url(self):
        """Generate pre-signed upload URL."""
        assert self.scan_initiated_on is None

        return sign_s3_url(
            self.bucket_id,
            self.path,
            method='put_object',
        )
Ejemplo n.º 2
0
    def get_signed_url(self, allow_unsafe=False):
        """
        Generate pre-signed download URL.

        URL is generated when either file has passed virus scanning (av_clean=True)
        or allow_unsafe is set.
        """
        if self.av_clean or allow_unsafe:
            return sign_s3_url(
                self.bucket_id,
                self.path,
            )
        return None
Ejemplo n.º 3
0
 def get_absolute_url(self):
     """Generate pre-signed download URL."""
     return sign_s3_url('report', self.s3_key)