Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-2643

Adding functionality to hook into WebSocket traffic

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.7.2
    • Fix Version/s: None
    • Component/s: front-end
    • Labels:

      Description

      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:

      1. 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(..).
      2. Modify https://github.com/apache/zeppelin/blob/master/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
        ```javascript
        websocketCalls.ws.send(JSON.stringify(window.hookOutgoing(data))) // instead of websocketCalls.ws.send(JSON.stringify(data))
        ```
        and
        ```javascript
        payload = angular.fromJson(window.hookIncoming(event.data)) // instead of payload = angular.fromJson(event.data)
        ```
        Remarks:
        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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stergiotis stergiotis
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: