Painless now supports adding annotations to whitelist objects (https://github.com/elastic/elasticsearch/pull/43239). However, there is currently no way to access useful information from the annotations within either the Painless scripting engine or in plugins. A callback mechanism needs to be added to the PainlessLookup to inform potential listeners when a whitelisted object with an annotation is compiled or bound.
Painless now supports adding annotations to whitelist objects (https://github.com/elastic/elasticsearch/pull/43239). However, there is currently no way to access useful information from the annotations within either the Painless scripting engine or in plugins. A callback mechanism needs to be added to the PainlessLookup to inform potential listeners when a whitelisted object with an annotation is compiled or bound.