mleku on Nostr: send ["OK",false,"auth-required: blah"] should be enough, i forget exactly, but the ...
send ["OK",false,"auth-required: blah"] should be enough, i forget exactly, but the client has to expect that and queue the request to send it out after doing the auth and getting the OK true
i forget how the CLOSE envelope plays into it, but i do know that replicatr does it correctly, lemme dig it up...
no, it's CLOSED envelope:
https://github.com/Hubmakerlabs/replicatr/blob/main/app/auth.goand then after that you send the AUTH envelope with the challenge to the client
and here is my client side code, this shoud help the client devs a bit at least:
this is a simple auth tester:
https://github.com/Hubmakerlabs/replicatr/blob/main/cmd/authr/authr.gothis shows how it's used in a client (this one can auth to two relays and pull from one and push to the other):
https://github.com/Hubmakerlabs/replicatr/blob/main/cmd/ingestr/app/ingest.goof course nobody pays attention to me, but i've actually written both sides of it, fiatjaf wrote some fragments of parts of it but i wasn't able to find anything that actually demonstrated how to string it together
yes, this works with coracle btw on the client side
hell, replicatr works perfectly as a relay except after about 24 hours it has some weird resource leak that eats CPU that's why it isn't in production
Published at
2024-07-09 21:13:08Event JSON
{
"id": "2c907f92b7862112105442cc3456480a9246e3cae10883cafc2600d0b27f85de",
"pubkey": "4c800257a588a82849d049817c2bdaad984b25a45ad9f6dad66e47d3b47e3b2f",
"created_at": 1720559588,
"kind": 1,
"tags": [
[
"e",
"000006f12dea48ce1bf760ea2c2df37808e41b2e4ae10ff64207b4243f515e30",
"",
"root"
],
[
"e",
"e01e8872ebc86f3f1a24bf84061523f9bdfbaa3fcc55ae19df1c4361efa76639",
"",
"reply"
],
[
"p",
"7cc328a08ddb2afdf9f9be77beff4c83489ff979721827d628a542f32a247c0e",
"",
"mention"
]
],
"content": "send [\"OK\",false,\"auth-required: blah\"] should be enough, i forget exactly, but the client has to expect that and queue the request to send it out after doing the auth and getting the OK true\n\ni forget how the CLOSE envelope plays into it, but i do know that replicatr does it correctly, lemme dig it up...\n\nno, it's CLOSED envelope:\n\nhttps://github.com/Hubmakerlabs/replicatr/blob/main/app/auth.go\n\nand then after that you send the AUTH envelope with the challenge to the client\n\nand here is my client side code, this shoud help the client devs a bit at least:\n\nthis is a simple auth tester:\n\nhttps://github.com/Hubmakerlabs/replicatr/blob/main/cmd/authr/authr.go\n\nthis shows how it's used in a client (this one can auth to two relays and pull from one and push to the other):\n\nhttps://github.com/Hubmakerlabs/replicatr/blob/main/cmd/ingestr/app/ingest.go\n\nof course nobody pays attention to me, but i've actually written both sides of it, fiatjaf wrote some fragments of parts of it but i wasn't able to find anything that actually demonstrated how to string it together\n\nyes, this works with coracle btw on the client side\n\nhell, replicatr works perfectly as a relay except after about 24 hours it has some weird resource leak that eats CPU that's why it isn't in production",
"sig": "d8cacda568d4657a233a11028d1e9b62e22c998a9837ded180bb0522b32a3149dc909745655fd41887754cdde74bec04b6c9e5ff72671bf93264d1e94d6b226c"
}