The amqp_connection returns a bunch of information about connection itself, but in some cases there is the need to get even more information that is returned using info keys. Using the _infokey user for instance, it will return filtered information about the user:
i(user, #state{params = P}) -> P#amqp_params_direct.username;
The problem is that the direct connection returns much more info about the user, like Tags generated during authentication process. The idea is to create a way to allow user to access the entire content from connection state, with something like:
i(state, State) -> State;
The main use, on my case, is to allow mqtt plugin to execute check_topic_access without having to execute user_authentication multiple times.
The amqp_connection returns a bunch of information about connection itself, but in some cases there is the need to get even more information that is returned using info keys. Using the _infokey user for instance, it will return filtered information about the user:
i(user, #state{params = P}) -> P#amqp_params_direct.username;
The problem is that the direct connection returns much more info about the user, like Tags generated during authentication process. The idea is to create a way to allow user to access the entire content from connection state, with something like:
i(state, State) -> State;
The main use, on my case, is to allow mqtt plugin to execute
check_topic_access
without having to executeuser_authentication
multiple times.What do you guys think?