amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
18.06k stars 1.16k forks source link

SEA Certificate with Blacklist make put silently fail, and callback not called #1143

Open yokowasis opened 2 years ago

yokowasis commented 2 years ago

Code

const Gun = require("gun");
require('gun/sea');

const gun = Gun();

(async()=>{
    const user1Pair = await Gun.SEA.pair();
    const user2Pair = await Gun.SEA.pair();

    const cert = await Gun.SEA.certify("*",{"*" : "chat-with"},user1Pair,null,{
        blacklist : 'blacklist' //if you delete this line, it works fine. 
    });

    gun.user().auth(user2Pair,cb=>{
        gun.get(`~${user1Pair.pub}`).get("chat-with").put({
            "hello" : "world"
        },ack=>{
            console.log (ack);
        },{
            opt : {
                cert : cert
            }
        })    
    })
})()
abow commented 2 years ago

This is most likely due to blaclist being renamed to block.

https://github.com/amark/gun/commit/63b0043076e4d49a49279fdd245b2df300cdbea2

abow commented 2 years ago

I also just noticed that block is currently not working.

That commit has tbe note: The "block" (former "blacklist") feature is not working yet (due to a bug in gun)

amark commented 2 years ago

@mimiza is this waiting for me?

(heads up: I'm gonna be gone the next 2 weeks, just FYI to people)

mimiza commented 2 years ago

@amark Yes. It's waiting for you.

This issue has been reported at #1137

amark commented 2 years ago

Oh thank you! Apologies, I just saw that and though "d'oh!", thank you.

davay42 commented 2 years ago

@mimiza @amark should we correct the docs to use 'block' instead of 'blacklist' already? Or do we need the fix to be published to NPM first?

mimiza commented 2 years ago

@mimiza @amark should we correct the docs to use 'block' instead of 'blacklist' already? Or do we need the fix to be published to NPM first?

Hi. Some weeks ago, Mark and I discussed about this feature and we think it should be deprecated. So there will be no such feature in the future. Davay I think you could add something like "TO BE DEPRECATED" to the doc.

davay42 commented 2 years ago

Yeah, I got the idea on removing non-O(1) requests from the chain. I'll take my time to remove the blacklist from examples.