R4SAS
zzz2: does Token works correctly in itoopie?
R4SAS
I see that i2pd responses to Authenticate reqest with "Token": "<<token>>" field, but when itoopie sends requests later, "Token" field is somehow is empty...
R4SAS
I2PControl: RouterInfo Token invalid: null
R4SAS
token itself is string
zzz
R4SAS, yes it works
zzz
it shouldn't "forget"
zzz
do you respond with an error?
R4SAS
zzz: currently token was ignored fully (no checks at all), but I'm adding checks now
zzz
R4SAS, ok, I have some logs of how the authentication works, you want them?
R4SAS
I think I understand it correclty, like this:
R4SAS
Authenticate
R4SAS
token returned
zzz
right
R4SAS
and it is used for further requests
zzz
R4SAS, if you require password, respond:
zzz
12/17 06:38:01.926 Response: {"id":-270359807,"error":{"code":-32002,"message":"No authentication token presented."},"jsonrpc":"2.0"}
zzz
and then:
R4SAS
btw, how that requirement must be sent?
zzz
12/17 06:38:02.166 Request: {"method":"Authenticate","id":-270359802,"params":{"API":1,"Token":null,"Password":"itoopie"},"jsonrpc":"2.0"}
zzz
12/17 06:38:02.166 Response: {"result":{"Token":"n4~vVeh1mq3TXDyv0j9XWXTHgg8kqtsnIWNAWtptWM0=","API":1},"id":-270359802,"jsonrpc":"2.0"}
R4SAS
when itoopie sends RouterInfo request I must reject it and it will authenticate automatically?
zzz
right
R4SAS
I think that's reason that our code is not sending -32002
zzz
12/17 06:38:01.926 Request: {"method":"RouterInfo","id":-270359807,"params":{"i2p.router.net.bw.inbound.1s":null,"Token":null},"jsonrpc":"2.0"}
zzz
12/17 06:38:01.926 Response: {"id":-270359807,"error":{"code":-32002,"message":"No authentication token presented."},"jsonrpc":"2.0"}
R4SAS
so that's why itoopie didn't try to send Token, or sends it as empty string
zzz
yes, I'm not an expert, but I think that's correct. It can't send a token until you send it one
R4SAS
yup
R4SAS
"params":{"API":1,"Token":null,"Password":"itoopie"} <<< null
zzz
and it won't try to authenticate until you send the error
zzz
we probably should not send a null Token, I don't know why it does
zzz
R4SAS, i2p-projekt.i2p/en/docs/api/i2pcontrol has all the error codes at the bottom
R4SAS
I saw them
zzz
:)
R4SAS
I can tell that our current i2pcontrol code is pretty terrible.
zzz
R4SAS, one other thing you should fix:
zzz
change i2p.router.status to send a string instead of a number
zzz
Response: {"result":{"i2p.router.status":"Rejecting tunnels: Starting up","i2p.router.uptime":39821,"i2p.router.net.status":1,"i2p.router.version":"2.0.0-9"},"id":-395860300,"jsonrpc":"2.0"}
R4SAS
yup, I seen that too
zzz
that's why you have "Status: 1" on itoopie
R4SAS
first time, when I seen "1" I thought: "wtf is this?"
zzz
send a translated string if you can
R4SAS
hm... like "Ready"?
zzz
we use it for the tunnel status, like accepting or rejecting, but you can do whatever you want with it
zzz
Status: Saving the world
R4SAS
)))
zzz
fixing itoopie is a lot more fun than tearing your hair out on SSU2 bugs ))
R4SAS
it is more interesting to be at the forefront with the inclusion of new features)))