Please check https://github.com/nbd-wtf/go-nostr and see how the signature is done 🐢🐾🫑

Reply to this note

Please Login to reply.

Discussion

Yes, I fixed small bug. Now I get 200 status via delete. But image does not deleted.

Which image? URL? 🐢🐾🫑

Also note that if you upload duplicate, we will only delete associations as per spec:

Deletion

DELETE $api_url/(.ext)

AUTH required

Note that the / part is from the original file, not from the transformed file if the uploaded file went through any server transformation.

The extension is optional as the file hash is the only needed file identification.

The server should reject deletes from users other than the original uploader with the appropriate http response code (403 Forbidden).

It should be noted that more than one user may have uploaded the same file (with the same hash). In this case, a delete must not really delete the file but just remove the user's pubkey from the file owners list (considering the server keeps just one copy of the same file, because multiple uploads of the same file results in the same file hash).

The successful response is a 200 OK one with just basic JSON fields:

{

status: "success",

message: "File deleted."

}

🐢🐾🫑

Ah!!! probaby, I tried many tries with same images. (it should be failed once before)

I'm guessing this is right JSON.

What about this?

https://gist.github.com/mattn/48754d7ac306f00aba75cb6989427daa

No idea. Try it and see if it works πŸΆπŸΎπŸ€·β€β™‚οΈ

I can't debut because verify API does not what is wrong. πŸ€·β€β™‚οΈ

Are you using correct URL? It must match perfectly, so is method, should be uppercase 🐢🐾🫑

I already said that this is not right! 🐢🐾🫑

; PHP message: Invalid url tag: https://nostr.build/api/v2/upload/files != https://nostr.build/api/v2/account/verify

SignedNostrEvent Object

(

[pubkey] => 2c7cc62a697ea3a7826521f3fd34f0cb273693cbe5e9310f35449f43622a5cdc

[id] => 8ace7829068e2b7b8d645f94bbc520fc1b672adff1da7d29a350a5defb42573b

[sig] => 41e318ec82e808fd4d41b7f8b5243947a225f7511f101501834c829b3f1b8e3708a63bd7cb206af09ffcd203e74a99c339b03c0128e6c2ab5dc377577a9245a4

[kind] => NostrEventKind Enum:int

(

[name] => HttpAuth

[value] => 27235

)

[content] =>

[tags] => Array

(

[0] => Array

(

[0] => u

[1] => https://nostr.build/api/v2/upload/files

)

[1] => Array

(

[0] => method

[1] => POST

)

)

[created_at] => 1720171338

)

Great! Make sure that tags always match the url. 🐢🐾🫑

Yes, it should be same because I copyed & pasted from the code.

Now I could delete image which posted via my lib.

Great! I still see some errors with mismatched signatures but probably not you πŸΆπŸΎπŸ€·β€β™‚οΈ

Actually it was you 🐢🐾🀣😭😭😭

2c7cc62a697ea3a7826521f3fd34f0cb273693cbe5e9310f35449f43622a5cdc

Also I could delete from my lib. Thanks.

Good job! πŸΆπŸΎπŸ«‚πŸŽ‰πŸŽ‰πŸŽ‰πŸ™πŸ»

Confirming from the results, it appears that I had used an image that I had already posted once, anonymously.

; PHP message: Invalid url tag: https://nostr.build/api/v2/upload/files != https://nostr.build/api/v2/account/verify

Not sure if it’s you or someone else, but fyi 🐢🐾🫑