All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: tools@linux.kernel.org, "Noralf Trønnes" <noralf@tronnes.org>
Subject: Re: Error using b4 web endpoint (was Re: git send-email friendly smtp provider anyone?)
Date: Tue, 22 Nov 2022 20:48:27 +0100	[thread overview]
Message-ID: <3d2f9038-435f-f78e-31f4-59dbae587d18@tronnes.org> (raw)
In-Reply-To: <20221122194428.fmbayuz6vbvdd6uw@meerkat.local>



Den 22.11.2022 20.44, skrev Konstantin Ryabitsev:
> (Dropping everyone from cc's and adding the tools list.)
> 
> On Tue, Nov 22, 2022 at 08:22:22PM +0100, Noralf Trønnes wrote:
>>> Yes. There will be a 0.10.2 in the near future, but the incoming fixes
>>> shouldn't make much difference for the b4 send code.
>>>
>>
>> This is what I got:
>>
>> $ b4 send --web-auth-verify <challenge string from email>
>> Signing challenge
>> Submitting verification to https://lkml.kernel.org/_b4_submit
>> Traceback (most recent call last):
>>   File "/home/pi/.local/lib/python3.10/site-packages/b4/ez.py", line 188, in auth_verify
>>     res = ses.post(endpoint, json=req)
>> ...
>> TypeError: Object of type bytes is not JSON serializable
> 
> This is very strange, because this is literally the code in question:
> 
>     req = {
>         'action': 'auth-verify',
>         'msg': bdata.encode(),
>     }
>     logger.info('Submitting verification to %s', endpoint)
>     ses = b4.get_requests_session()
>     res = ses.post(endpoint, json=req)
> 
> I don't see where "Object of type bytes" would come from. Can you possibly
> insert the following above the `res = ses.post` line:
> 
>     logger.debug('endpoint=%s, req=%s', endpoint, req)
> 

$ b4 -d send --web-auth-verify <challenge>
Running git --no-pager rev-parse --show-toplevel
Running git --no-pager config -z --get-regexp b4\..*
Running git --no-pager config -z --get-regexp gpg\..*
Running git --no-pager config -z --get-regexp user\..*
Signing challenge
Submitting verification to https://lkml.kernel.org/_b4_submit
endpoint=https://lkml.kernel.org/_b4_submit, req={'action':
'auth-verify', 'msg': b'From: noralf@tronnes.org\nSubject:
b4-send-verify\nX-Developer-Signature: v=1; a=ed25519-sha256;
t=1669146435; l=45;\n i=noralf@tronnes.org; s=20221122;
h=from:subject;\n bh=E4BgU7G2i7CeIkR8F1AfDTtOvDBQA7ld22s0U29/H84=;\n
b=eRcDEBQvE702NSqEWQDLRyp9emSRvBjdhIW1c8e65OPf9Z1h78HB8UVqwWpf21mBSBtO8ZsLzPkg\n
L5w0Y/ekCLtNWAVqAjRGRASBZKkcbWnQ/CWLAHmzbHskL1tiwgMv\nX-Developer-Key:
i=noralf@tronnes.org; a=ed25519;\n
pk=0o9is4iddvvlrY3yON5SVtAbgPnVs0LfQsjfqR2Hvz8=\n\nverify:7ad470b4-f531-4632-8093-738d4d3e5d88\n'}
Traceback (most recent call last):
  File "/home/pi/.local/bin/b4", line 8, in <module>
    sys.exit(cmd())
  File "/home/pi/.local/lib/python3.10/site-packages/b4/command.py",
line 341, in cmd
    cmdargs.func(cmdargs)
  File "/home/pi/.local/lib/python3.10/site-packages/b4/command.py",
line 86, in cmd_send
    b4.ez.cmd_send(cmdargs)
  File "/home/pi/.local/lib/python3.10/site-packages/b4/ez.py", line
1103, in cmd_send
    auth_verify(cmdargs)
  File "/home/pi/.local/lib/python3.10/site-packages/b4/ez.py", line
189, in auth_verify
    res = ses.post(endpoint, json=req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 590,
in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 528,
in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 456,
in prepare_request
    p.prepare(
  File "/usr/lib/python3/dist-packages/requests/models.py", line 319, in
prepare
    self.prepare_body(data, files, json)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 469, in
prepare_body
    body = complexjson.dumps(json)
  File "/usr/lib/python3.10/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.10/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.10/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.10/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

Noralf.


  reply	other threads:[~2022-11-22 19:48 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 11:48 git send-email friendly smtp provider anyone? Noralf Trønnes
2022-11-21 11:48 ` Noralf Trønnes
2022-11-21 13:33 ` Simon Ser
2022-11-21 13:33   ` Simon Ser
2022-11-21 16:52   ` Noralf Trønnes
2022-11-21 16:52     ` Noralf Trønnes
2022-11-21 17:02     ` Simon Ser
2022-11-21 17:02       ` Simon Ser
2022-11-21 17:06       ` Simon Ser
2022-11-21 17:06         ` Simon Ser
2022-11-21 17:50         ` Noralf Trønnes
2022-11-21 17:50           ` Noralf Trønnes
2022-11-21 15:19 ` Maxime Ripard
2022-11-21 15:19   ` Maxime Ripard
2022-11-21 18:13   ` Noralf Trønnes
2022-11-21 18:13     ` Noralf Trønnes
2022-11-22 15:51     ` Konstantin Ryabitsev
2022-11-22 17:42       ` Noralf Trønnes
2022-11-22 17:42         ` Noralf Trønnes
2022-11-22 18:50         ` Konstantin Ryabitsev
2022-11-22 19:22           ` Noralf Trønnes
2022-11-22 19:22             ` Noralf Trønnes
2022-11-22 19:44             ` Error using b4 web endpoint (was Re: git send-email friendly smtp provider anyone?) Konstantin Ryabitsev
2022-11-22 19:48               ` Noralf Trønnes [this message]
2022-11-22 20:00                 ` Konstantin Ryabitsev
2022-11-22 20:10                   ` Noralf Trønnes
2022-11-22 20:20                     ` Konstantin Ryabitsev
2022-11-22 20:26                       ` Noralf Trønnes
2022-11-22 20:44                         ` Konstantin Ryabitsev
2022-11-22 21:03                           ` Noralf Trønnes
2022-11-22 21:14                             ` Konstantin Ryabitsev
2022-11-22 22:05                             ` Konstantin Ryabitsev
2022-11-30 16:17                             ` Noralf Trønnes
2022-11-30 16:55                               ` Konstantin Ryabitsev
2022-11-30 17:02                                 ` Noralf Trønnes
2022-11-30 19:17                                   ` Konstantin Ryabitsev
2022-11-30 19:34                                     ` Noralf Trønnes
2022-11-30 19:39                                       ` Konstantin Ryabitsev
2022-11-30 19:59                                         ` Noralf Trønnes
2022-12-01 14:42                                         ` Konstantin Ryabitsev
2022-11-22 21:10             ` git send-email friendly smtp provider anyone? Noralf Trønnes
2022-11-22 21:10               ` Noralf Trønnes
2022-11-22 21:26               ` Konstantin Ryabitsev
2022-11-22 21:26                 ` Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d2f9038-435f-f78e-31f4-59dbae587d18@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.