I would like to propose an extension mechanism which is orthogonal to the concept of interpreters. This mechanism has proven valuable (and simple) to implement certain kind of end-to-end functionalities across interpreters (e.g. enhanced security, auditing, resource and session management, ...). In order to do so it is necessary to hook into the Zeppelin frontend to backend communication.
I therefore propose the following:
- Introduce a mechanism to late-bind two hook functions upon website instanciation (e.g. try to <script /> a zepplin external resource (in a CORS compliant manner)). Lets call these functions window.hookOutgoing(..) and window.hookIncoming(..).
- Modify https://github.com/apache/zeppelin/blob/master/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
websocketCalls.ws.send(JSON.stringify(window.hookOutgoing(data))) // instead of websocketCalls.ws.send(JSON.stringify(data))
payload = angular.fromJson(window.hookIncoming(event.data)) // instead of payload = angular.fromJson(event.data)
I am aware of the fact that this exposes Zeppelin internal datastructures which may be subject to changes. I am looking for a late-bind option which does not make use of Angular's dependency injection mechanism.