Repository: jina-ai/jina
File: jina/hubble/hubio.py (Python)

Code before:
            headers=req_header,
            stream=True,
            method='post',
        )

        verbose = form_data.get('verbose', False)
        push_task = None
        for stream_line in resp.iter_lines():
            stream_msg = json.loads(stream_line)
            if stream_msg.get('code') == 202:
                push_task = stream_msg['data']
            else:
                msg = stream_msg.get('message')
                raise Exception(f'{ msg or "Unknown Error"} session_id: {session_id}')

        new_task_id = push_task.get('_id')
        if new_task_id:

            dump_secret(work_path, form_data.get('id'), form_data.get('secret'), new_task_id)
            self._prettyprint_status_usage(console, work_path, new_task_id)
            st.update(f'Async Uploaded!')

            image = self._status_with_progress(console, st, new_task_id, False, verbose)
            if image:

                #new_secret always None
                new_uuid8, new_secret = self._prettyprint_result(console, image)
                if new_uuid8 != form_data.get('id'):
                    dump_secret(work_path, new_uuid8, form_data.get('secret'), new_task_id)

            else:
                raise Exception(f'Unknown Error, session_id: {session_id}')

        else:
            raise Exception(f'Error: can\'t get task_id session_id: {session_id}')

    def _sync_push(
        self, console, st, req_header, content, form_data, work_path, uuid8, secret
    ):
        # upload the archived executor to Jina Hub
        if form_data.get('id'):
            hubble_url = urljoin(hubble.utils.get_base_url(), 'executor.update')
        else:
            hubble_url = urljoin(hubble.utils.get_base_url(), 'executor.create')

        st.update(f'Uploading...')
        resp = upload_file(
            hubble_url,
            'filename',
            content,
            dict_data=form_data,

Review comment (security):
```suggestion
                # `new_secret` is always None
```

Code after:
            headers=req_header,
            stream=True,
            method='post',
        )

        verbose = form_data.get('verbose', False)
        push_task = None
        for stream_line in resp.iter_lines():
            stream_msg = json.loads(stream_line)
            if stream_msg.get('code') == 202:
                push_task = stream_msg['data']
            else:
                msg = stream_msg.get('message')
                raise Exception(f'{ msg or "Unknown Error"} session_id: {session_id}')

        new_task_id = push_task.get('_id')
        if new_task_id:

            dump_secret(work_path, form_data.get('id'), form_data.get('secret'), new_task_id)
            self._prettyprint_status_usage(console, work_path, new_task_id)
            st.update(f'Async Uploaded!')

            image = self._status_with_progress(console, st, new_task_id, False, verbose)
            if image:

                # `new_secret` is always None
                new_uuid8, new_secret = self._prettyprint_result(console, image)
                if new_uuid8 != form_data.get('id'):
                    dump_secret(work_path, new_uuid8, form_data.get('secret'), new_task_id)

            else:
                raise Exception(f'Unknown Error, session_id: {session_id}')

        else:
            raise Exception(f'Error: can\'t get task_id session_id: {session_id}')

    def _sync_push(
        self, console, st, req_header, content, form_data, work_path, uuid8, secret
    ):
        # upload the archived executor to Jina Hub
        if form_data.get('id'):
            hubble_url = urljoin(hubble.utils.get_base_url(), 'executor.update')
        else:
            hubble_url = urljoin(hubble.utils.get_base_url(), 'executor.create')

        st.update(f'Uploading...')
        resp = upload_file(
            hubble_url,
            'filename',
            content,
            dict_data=form_data,