erlio / vmq_diversity

[OBSOLETE since VerneMQ 1.0.0rc1 - now part of the main repo] A VerneMQ Plugin Builder Toolkit
https://vernemq.com
26 stars 5 forks source link

auth_on_publish and auth_on_subscribe not be invoked #14

Closed TangMonk closed 7 years ago

TangMonk commented 8 years ago

function my_auth_on_register(reg)
    log.info('my_auth_on_register')
    return true
end

function my_auth_on_publish(pub)
    log.info('my_auth_on_publish')
    return false
end

function my_auth_on_subscribe(sub)
    log.info('my_auth_on_subscribe')
    return false
end

hooks = {
    auth_on_register = my_auth_on_register,
    auth_on_publish = my_auth_on_publish,
    auth_on_subscribe = my_auth_on_subscribe
}

I check the console.log, Only my_auth_on_register be invoked, auth_on_publish and auth_on_subscribe not invoke

ioolkos commented 8 years ago

Hello @TangMonk thanks! So your my_auth_on_publish isn't called at all if you publish a message, for example? @dergraf is any step or config missing here?

TangMonk commented 8 years ago

@ioolkos thanks for your reply, I try to publish and subscribe, not works

TangMonk commented 8 years ago

I record my operation to a video for better explain: http://recordit.co/nvS3zYMWzq

ioolkos commented 8 years ago

Great way to explain! Obviously both functions are not called as you are able to subscribe and publish. Hm... let's see what @dergraf or @larshesel say (still asleep?... :)

dergraf commented 8 years ago

My guess is that there are other plugins which are returning 'ok' before vmq_diversity is called. Can you check with vmq-admin plugin show and check that e.g. the default vmq_acl is disabled or the default acl rule # is removed in /etc/vernemq/vmq.acl.

larshesel commented 7 years ago

Hi @TangMonk did you resolve the issue? Otherwise let us know - closing this for now.