예제 #1
0
    def _get_auth_headers(self, file_transfer_token: FileTransferToken):
        auth_key = base64.b64encode(file_transfer_token.serialize()).decode()
        auth_data = base64.b64encode(
            golem_messages.dump(
                ClientAuthorization(
                    client_public_key=self.keys_auth.public_key),
                self.keys_auth._private_key,
                self.variant['pubkey']  # noqa pylint:disable=protected-access
            )).decode()

        logger.debug(
            "Generating headers - ftt: %s, auth: %s, concent_auth: %s",
            file_transfer_token, auth_key, auth_data)

        return {
            'Authorization': 'Golem ' + auth_key,
            'Concent-Auth': auth_data,
        }
예제 #2
0
 def _mock_get_auth_headers(self, file_transfer_token: FileTransferToken):
     return {
         'Authorization': 'Golem ' + base64.b64encode(
             file_transfer_token.serialize()).decode(),
     }