Not that easy to implement, I know:)
The server events system is great and I am automatizing lots of actions with it.
However we are always restricted to what variable is provided to the event.
In an ideal world, I would be able to send from the client some additional custom data to the events.
For example with the onBind event, the client could add in the request a small json string containing additional information available only to the client:
vhclient -t "USE,server1.123,custom_data={'foo': 'bar', 'version': 3, .... }"
Then received by the event in a $CUSTOM_DATA$ variable.
.
Is this for any command, or just the USE?
Specifically for the
USE
command - there is an optional 3rd field to supply a password.However the
$PASSWORD$
field itself can be split into two separate fields with a backslash delimiter. The first part is the client id and is not MD5 encoded e.g<Client ID>\<md5 password>
You can can insert your custom data into the Client ID field then backslash then any single character e.g 0.
You will receive the custom data as the
$CLIENT_ID$
field in the ClientAuthorization script exactly how you specify it.E.g
"USE,abcd.1234,custom_data={'foo': 'bar', 'version': 3, .... }\0"
In the script the
$CLIENT_ID$
equalscustom_data={'foo': 'bar', 'version': 3, .... }
Not sure if that suits your usecase, but for the general case for any event it would be difficult to make a change to the syntax and make it forward and backward compatible with existing scripts.
.
Actually my use case is on the "STOP USING", so the "onUnbind" event :)
But this workaround with the password is an interesting trick I will keep in mind!