├── BTCUSD
└── index.html
├── ETHUSD
└── index.html
├── README.md
├── __init__.py
├── assets
├── Style.css
├── visualizer.js
└── volSurfaceStyle.css
├── autobahn
├── __init__.py
├── __main__.py
├── __pycache__
│ ├── __init__.cpython-36.pyc
│ ├── _version.cpython-36.pyc
│ └── util.cpython-36.pyc
├── _version.py
├── asyncio
│ ├── __init__.py
│ ├── component.py
│ ├── rawsocket.py
│ ├── test
│ │ ├── README
│ │ ├── test_asyncio_rawsocket.py
│ │ └── test_asyncio_websocket.py
│ ├── util.py
│ ├── wamp.py
│ └── websocket.py
├── nvx
│ ├── __init__.py
│ ├── _utf8validator.c
│ ├── _utf8validator.py
│ └── test
│ │ └── test_utf8validator.py
├── rawsocket
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-36.pyc
│ │ └── util.cpython-36.pyc
│ ├── test
│ │ ├── __init__.py
│ │ └── test_rawsocket_url.py
│ └── util.py
├── test
│ ├── __init__.py
│ └── test_util.py
├── twisted
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-36.pyc
│ │ ├── choosereactor.cpython-36.pyc
│ │ ├── rawsocket.cpython-36.pyc
│ │ ├── util.cpython-36.pyc
│ │ ├── wamp.cpython-36.pyc
│ │ └── websocket.cpython-36.pyc
│ ├── choosereactor.py
│ ├── component.py
│ ├── cryptosign.py
│ ├── forwarder.py
│ ├── rawsocket.py
│ ├── resource.py
│ ├── test
│ │ ├── __init__.py
│ │ ├── test_application_runner.py
│ │ ├── test_choosereactor.py
│ │ ├── test_component.py
│ │ ├── test_endpoint_plugins.py
│ │ ├── test_protocol.py
│ │ └── test_rawsocket.py
│ ├── util.py
│ ├── wamp.py
│ └── websocket.py
├── util.py
├── wamp
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-36.pyc
│ │ ├── auth.cpython-36.pyc
│ │ ├── exception.cpython-36.pyc
│ │ ├── interfaces.cpython-36.pyc
│ │ ├── message.cpython-36.pyc
│ │ ├── protocol.cpython-36.pyc
│ │ ├── request.cpython-36.pyc
│ │ ├── role.cpython-36.pyc
│ │ ├── types.cpython-36.pyc
│ │ ├── uri.cpython-36.pyc
│ │ └── websocket.cpython-36.pyc
│ ├── auth.py
│ ├── component.py
│ ├── cryptobox.py
│ ├── cryptosign.py
│ ├── exception.py
│ ├── flatbuffers
│ │ ├── auth.fbs
│ │ ├── pubsub.fbs
│ │ ├── roles.fbs
│ │ ├── rpc.fbs
│ │ ├── session.fbs
│ │ ├── types.fbs
│ │ └── wamp.fbs
│ ├── gen
│ │ ├── __init__.py
│ │ ├── schema
│ │ │ ├── auth.bfbs
│ │ │ ├── pubsub.bfbs
│ │ │ ├── roles.bfbs
│ │ │ ├── rpc.bfbs
│ │ │ ├── session.bfbs
│ │ │ ├── types.bfbs
│ │ │ └── wamp.bfbs
│ │ └── wamp
│ │ │ ├── Map.py
│ │ │ ├── Void.py
│ │ │ ├── __init__.py
│ │ │ └── proto
│ │ │ ├── Abort.py
│ │ │ ├── AnyMessage.py
│ │ │ ├── AuthCraChallenge.py
│ │ │ ├── AuthCraRequest.py
│ │ │ ├── AuthCraWelcome.py
│ │ │ ├── AuthCryptosignChallenge.py
│ │ │ ├── AuthCryptosignRequest.py
│ │ │ ├── AuthCryptosignWelcome.py
│ │ │ ├── AuthFactor.py
│ │ │ ├── AuthMethod.py
│ │ │ ├── AuthMode.py
│ │ │ ├── AuthScramChallenge.py
│ │ │ ├── AuthScramRequest.py
│ │ │ ├── AuthScramWelcome.py
│ │ │ ├── AuthTicketChallenge.py
│ │ │ ├── AuthTicketRequest.py
│ │ │ ├── AuthTicketWelcome.py
│ │ │ ├── Authenticate.py
│ │ │ ├── BrokerFeatures.py
│ │ │ ├── Call.py
│ │ │ ├── CalleeFeatures.py
│ │ │ ├── CallerFeatures.py
│ │ │ ├── Cancel.py
│ │ │ ├── CancelMode.py
│ │ │ ├── Challenge.py
│ │ │ ├── ChannelBinding.py
│ │ │ ├── ClientRoles.py
│ │ │ ├── DealerFeatures.py
│ │ │ ├── Error.py
│ │ │ ├── Event.py
│ │ │ ├── EventReceived.py
│ │ │ ├── Goodbye.py
│ │ │ ├── Hello.py
│ │ │ ├── HelloNew.py
│ │ │ ├── Interrupt.py
│ │ │ ├── Invocation.py
│ │ │ ├── InvocationPolicy.py
│ │ │ ├── Kdf.py
│ │ │ ├── Match.py
│ │ │ ├── Message.py
│ │ │ ├── MessageType.py
│ │ │ ├── Payload.py
│ │ │ ├── Principal.py
│ │ │ ├── Publish.py
│ │ │ ├── Published.py
│ │ │ ├── PublisherFeatures.py
│ │ │ ├── Register.py
│ │ │ ├── Registered.py
│ │ │ ├── Result.py
│ │ │ ├── RouterRoles.py
│ │ │ ├── Serializer.py
│ │ │ ├── Subscribe.py
│ │ │ ├── Subscribed.py
│ │ │ ├── SubscriberFeatures.py
│ │ │ ├── SubscriberReceived.py
│ │ │ ├── Unregister.py
│ │ │ ├── Unregistered.py
│ │ │ ├── Unsubscribe.py
│ │ │ ├── Unsubscribed.py
│ │ │ ├── Welcome.py
│ │ │ ├── Yield.py
│ │ │ └── __init__.py
│ ├── interfaces.py
│ ├── message.py
│ ├── message_fbs.py
│ ├── protocol.py
│ ├── request.py
│ ├── role.py
│ ├── serializer.py
│ ├── test
│ │ ├── __init__.py
│ │ ├── test_auth.py
│ │ ├── test_component.py
│ │ ├── test_component_aio.py
│ │ ├── test_cryptobox.py
│ │ ├── test_cryptosign.py
│ │ ├── test_exception.py
│ │ ├── test_message.py
│ │ ├── test_protocol.py
│ │ ├── test_protocol_peer.py
│ │ ├── test_runner.py
│ │ ├── test_serializer.py
│ │ ├── test_uri_pattern.py
│ │ ├── test_user_handler_errors.py
│ │ └── test_websocket.py
│ ├── types.py
│ ├── uri.py
│ └── websocket.py
└── websocket
│ ├── __init__.py
│ ├── __pycache__
│ ├── __init__.cpython-36.pyc
│ ├── compress.cpython-36.pyc
│ ├── compress_base.cpython-36.pyc
│ ├── compress_bzip2.cpython-36.pyc
│ ├── compress_deflate.cpython-36.pyc
│ ├── interfaces.cpython-36.pyc
│ ├── protocol.cpython-36.pyc
│ ├── types.cpython-36.pyc
│ ├── utf8validator.cpython-36.pyc
│ ├── util.cpython-36.pyc
│ └── xormasker.cpython-36.pyc
│ ├── compress.py
│ ├── compress_base.py
│ ├── compress_bzip2.py
│ ├── compress_deflate.py
│ ├── compress_snappy.py
│ ├── interfaces.py
│ ├── protocol.py
│ ├── test
│ ├── __init__.py
│ ├── test_protocol.py
│ ├── test_websocket.py
│ └── test_websocket_url.py
│ ├── types.py
│ ├── utf8validator.py
│ ├── util.py
│ └── xormasker.py
├── background.png
├── config.py
├── cryptopt
├── .gitignore
├── deribitREST.py
├── deribitWebsocket.py
├── option.py
├── optionsPricing.ipynb
├── requirements.txt
├── theoEngine.py
└── utils.py
├── databaseController.py
├── favicon.ico
├── httpServer.py
├── index.html
├── requirements.txt
├── screenshots
└── volsurface.PNG
├── server.py
└── setup.sh
/BTCUSD/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 0xhedge
4 |
5 |
6 |
7 |
8 |
9 |
BTC/USD Volatility Surface
10 |
11 |
78 |
79 |
80 |
81 | Calls
82 | |
83 |
84 |
85 |
86 |
89 | |
90 |
91 |
92 |
93 | Puts
94 | |
95 |
96 |
97 |
98 |
101 | |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/ETHUSD/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 0xhedge
4 |
5 |
6 |
7 |
8 |
9 |
ETH/USD Volatility Surface
10 |
11 |
78 |
79 |
80 |
81 | Calls
82 | |
83 |
84 |
85 |
86 |
89 | |
90 |
91 |
92 |
93 | Puts
94 | |
95 |
96 |
97 |
98 |
101 | |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This repository holds the client and server for the volatility surface visualizer at http://0xhedge.io. Implied volatility is calculated from mid-market Deribit data with naive Black-Scholes and plotted against delta/strike and time to expiration.
2 |
3 | ## What is a volatility surface?
4 |
5 | A volatility surface is a 3d plot of option implied volatility as a function of delta (or strike) and time to expiration. This allows us to visualize the market's outlook on volatility. We calculate implied volatility using the Black-Scholes formula, using the mid-market option price from deribit.
6 |
7 | ## Dependencies
8 |
9 | You will need:
10 |
11 | * `python3`
12 | * `python3-pip`
13 | * `npm`
14 | * `postgresql`
15 |
16 | On ubuntu, you can install dependencies with:
17 | ```
18 | ./setup.sh
19 | ```
20 | Then, you will need to create the vol surface database:
21 | ```
22 | sudo -u postgres psql
23 | > CREATE DATABASE volsurface;
24 | > CREATE USER "user" WITH ENCRYPTED PASSWORD 'password';
25 | > \q
26 | ```
27 |
28 | ## Getting Started
29 |
30 | To run the server, do `python3 server.py`.
31 |
32 | To run a websocket server for live data support, run `python3 liveData.py` once the server is running.
33 | You will need to add an `apis.py` file with your `key` and `secret`, since Deribit requires API authentication for accessing their websocket endpoints.
34 |
35 | ## Screenshots
36 |
37 | 
38 |
--------------------------------------------------------------------------------
/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/__init__.py
--------------------------------------------------------------------------------
/assets/Style.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #000000;
3 | font-family: Inconsolata, monospace;
4 | }
5 |
6 | #bg {
7 | position: fixed;
8 | top: 0;
9 | left: 0;
10 | min-width: 100%;
11 | min-height: 100%;
12 | }
13 |
14 | h1 {
15 | text-align: center;
16 | color: #ffffff;
17 | font-size: 72;
18 | position: absolute;
19 | top: 10%;
20 | left: 50%;
21 | transform: translate(-50%, -50%);
22 | }
23 |
24 | h2 {
25 | text-align: center;
26 | color: #ffffff;
27 | font-size: 40;
28 | }
29 |
30 | h3 {
31 | color: #ffffff;
32 | font-size: 10;
33 | position: absolute;
34 | top: 20%;
35 | left: 50%;
36 | transform: translate(-50%, -50%);
37 | }
38 |
39 | .description {
40 | position: absolute;
41 | top: 45%;
42 | left: 50%;
43 | transform: translate(-50%, -50%);
44 | }
45 |
46 | .vol-surface-link {
47 | position: absolute;
48 | top: 50%;
49 | left: 50%;
50 | transform: translate(-50%, -50%);
51 | }
52 |
53 | .blog-link {
54 | position: absolute;
55 | top: 75%;
56 | left: 50%;
57 | transform: translate(-50%, -50%);
58 | }
59 |
60 | a:visited {
61 | text-decoration: none;
62 | color: white;
63 | }
64 | a:hover {
65 | text-decoration: none;
66 | color: orange;
67 | }
68 |
--------------------------------------------------------------------------------
/assets/volSurfaceStyle.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #000000;
3 | font-family: Inconsolata, monospace;
4 | }
5 |
6 | h1 {
7 | text-align: center;
8 | color: #ffffff;
9 | font-size: 72;
10 | }
11 |
12 | h2 {
13 | text-align: center;
14 | color: #ffffff;
15 | font-size: 40;
16 | padding-top: 25px;
17 | }
18 |
19 | h3 {
20 | color: #ffffff;
21 | font-size: 10;
22 | }
23 |
24 | .plot {
25 | margin: auto;
26 | width: 55%;
27 | }
28 |
29 | .sidenav {
30 | margin-top: 25px;
31 | padding: 0;
32 | width: 20%;
33 | position: fixed;
34 | height: 100%;
35 | }
36 |
37 | .sidenav a {
38 | color: black;
39 | padding: 16px;
40 | text-decoration: none;
41 | }
42 |
43 | div.content {
44 | margin-left: 200px;
45 | padding: 1px 16px;
46 | height: 500px;
47 | }
48 |
49 | label {
50 | float: left;
51 | vertical-align: middle;
52 | }
53 |
54 | span {
55 | display: block;
56 | overflow: hidden;
57 | padding: 0 4px 0 6px;
58 | }
59 |
60 | input {
61 | vertical-align: middle;
62 | }
63 |
64 | form {
65 | border: none;
66 | }
67 |
68 | .limit {
69 | margin-left: 30px;
70 | }
71 |
72 | .switch {
73 | position: absolute;
74 | width: 30px;
75 | height: 17px;
76 | }
77 |
78 | .switch input {
79 | opacity: 0;
80 | width: 0;
81 | height: 0;
82 | }
83 |
84 | .slider {
85 | position: absolute;
86 | cursor: pointer;
87 | top: 0;
88 | left: 0;
89 | right: 0;
90 | bottom: 0;
91 | background-color: #ccc;
92 | -webkit-transition: 0.4s;
93 | transition: 0.4s;
94 | }
95 |
96 | .slider:before {
97 | position: absolute;
98 | content: "";
99 | height: 13px;
100 | width: 13px;
101 | left: 2px;
102 | bottom: 2px;
103 | background-color: white;
104 | -webkit-transition: 0.4s;
105 | transition: 0.4s;
106 | }
107 |
108 | input:checked + .slider {
109 | background-color: #2196f3;
110 | }
111 |
112 | input:focus + .slider {
113 | box-shadow: 0 0 1px #2196f3;
114 | }
115 |
116 | input:checked + .slider:before {
117 | -webkit-transform: translateX(13px);
118 | -ms-transform: translateX(13px);
119 | transform: translateX(13px);
120 | }
121 |
122 | /* Rounded sliders */
123 | .slider.round {
124 | border-radius: 17px;
125 | }
126 |
127 | .slider.round:before {
128 | border-radius: 50%;
129 | }
130 |
131 | a:visited {
132 | text-decoration: none;
133 | color: white;
134 | }
135 | a:hover {
136 | text-decoration: none;
137 | color: orange;
138 | }
139 |
140 | .container {
141 | position: relative;
142 | width: 100%;
143 | padding-top: 100%; /* 1:1 Aspect Ratio */
144 | }
145 |
--------------------------------------------------------------------------------
/autobahn/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | from autobahn._version import __version__
30 |
31 | version = __version__
32 |
--------------------------------------------------------------------------------
/autobahn/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/__pycache__/_version.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/__pycache__/_version.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/__pycache__/util.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/__pycache__/util.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/_version.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | __version__ = u'19.3.3'
28 |
--------------------------------------------------------------------------------
/autobahn/asyncio/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 |
28 | from __future__ import absolute_import
29 |
30 | import sys
31 | import platform
32 |
33 | import autobahn
34 |
35 | # WebSocket protocol support
36 | from autobahn.asyncio.websocket import \
37 | WebSocketServerProtocol, \
38 | WebSocketClientProtocol, \
39 | WebSocketServerFactory, \
40 | WebSocketClientFactory
41 |
42 | # WAMP support
43 | from autobahn.asyncio.wamp import ApplicationSession
44 |
45 |
46 | __all__ = (
47 | 'WebSocketServerProtocol',
48 | 'WebSocketClientProtocol',
49 | 'WebSocketServerFactory',
50 | 'WebSocketClientFactory',
51 | 'ApplicationSession',
52 | )
53 |
54 | __ident__ = u'Autobahn/{}-asyncio-{}/{}'.format(autobahn.__version__, platform.python_implementation(), '.'.join([str(x) for x in list(sys.version_info[:3])]))
55 | """
56 | AutobahnPython library implementation (eg. "Autobahn/0.13.0-asyncio-CPython/3.5.1")
57 | """
58 |
--------------------------------------------------------------------------------
/autobahn/asyncio/test/README:
--------------------------------------------------------------------------------
1 | **DO NOT ADD a __init__.py file in this directory**
2 |
3 | "Why not?" you ask; read on!
4 |
5 | 1. If we're running asyncio tests, we can't ever call txaio.use_twisted()
6 |
7 | 2. If we're running twisted tests, we can't ever call txaio.use_asycnio()...
8 |
9 | 3. ...and these are decided/called at import time
10 |
11 | 4. so: we can't *import* any of the autobahn.asyncio.* modules if we're
12 | running twisted tests (or vice versa)
13 |
14 | 5. ...but test-runners (py.test and trial) import things automagically
15 | (to "discover" tests)
16 |
17 | 6. We use py.test to run asyncio tests; see "setup.cfg" where we tell
18 | it "norecursedirs = autobahn/twisted/*" so it doesn't ipmort twisted
19 | stuff (and hence call txaio.use_twisted())
20 |
21 | 7. We use trial to run twisted tests; the lack of __init__ in here
22 | stops it from trying to import this (and hence the parent
23 | package). (The only files matching test_*.py are in this
24 | directory.)
25 |
26 | *Therefore*, we don't put a __init__ file in this directory.
--------------------------------------------------------------------------------
/autobahn/asyncio/test/test_asyncio_websocket.py:
--------------------------------------------------------------------------------
1 | import pytest
2 | import os
3 | import sys
4 |
5 | # because py.test tries to collect it as a test-case
6 | try:
7 | from unittest.mock import Mock
8 | except ImportError:
9 | from mock import Mock
10 |
11 | from autobahn.asyncio.websocket import WebSocketServerFactory
12 | from unittest import TestCase
13 | import txaio
14 |
15 |
16 | @pytest.mark.skipif(True, reason='pytest sucks')
17 | @pytest.mark.skipif(sys.version_info < (3, 3), reason="requires Python 3.3+")
18 | @pytest.mark.skipif(os.environ.get('USE_ASYNCIO', False) is False, reason="only for asyncio")
19 | @pytest.mark.usefixtures("event_loop") # ensure we have pytest_asyncio installed
20 | class Test(TestCase):
21 |
22 | @pytest.mark.asyncio(forbid_global_loop=True)
23 | def test_websocket_custom_loop(self, event_loop):
24 | factory = WebSocketServerFactory(loop=event_loop)
25 | server = factory()
26 | transport = Mock()
27 |
28 | server.connection_made(transport)
29 |
30 | # not sure when this last worked, tests haven't been running
31 | # properly under asyncio for a while it seems.
32 | @pytest.mark.xfail
33 | def test_async_on_connect_server(self):
34 | # see also issue 757
35 |
36 | # for python 3.5, this can be "async def foo"
37 | def foo(x):
38 | f = txaio.create_future()
39 | txaio.resolve(f, x * x)
40 | return f
41 |
42 | values = []
43 |
44 | def on_connect(req):
45 | f = txaio.create_future()
46 |
47 | def cb(x):
48 | f = foo(42)
49 | f.add_callbacks(f, lambda v: values.append(v), None)
50 | return f
51 | txaio.add_callbacks(f, cb, None)
52 | return f
53 |
54 | factory = WebSocketServerFactory()
55 | server = factory()
56 | server.onConnect = on_connect
57 | transport = Mock()
58 |
59 | server.connection_made(transport)
60 | # need/want to insert real-fake handshake data?
61 | server.data = b"\r\n".join([
62 | b'GET /ws HTTP/1.1',
63 | b'Host: www.example.com',
64 | b'Sec-WebSocket-Version: 13',
65 | b'Origin: http://www.example.com.malicious.com',
66 | b'Sec-WebSocket-Extensions: permessage-deflate',
67 | b'Sec-WebSocket-Key: tXAxWFUqnhi86Ajj7dRY5g==',
68 | b'Connection: keep-alive, Upgrade',
69 | b'Upgrade: websocket',
70 | b'\r\n', # last string doesn't get a \r\n from join()
71 | ])
72 | server.processHandshake()
73 |
74 | self.assertEqual(1, len(values))
75 | self.assertEqual(42 * 42, values[0])
76 |
--------------------------------------------------------------------------------
/autobahn/asyncio/util.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | __all = (
30 | 'sleep',
31 | 'peer2str',
32 | )
33 |
34 |
35 | def peer2str(peer):
36 | if isinstance(peer, tuple):
37 | ip_ver = 4 if len(peer) == 2 else 6
38 | return u"tcp{2}:{0}:{1}".format(peer[0], peer[1], ip_ver)
39 | elif isinstance(peer, str):
40 | return u"unix:{0}".format(peer)
41 | else:
42 | return u"?:{0}".format(peer)
43 |
44 |
45 | def get_serializers():
46 | from autobahn.wamp import serializer
47 |
48 | serializers = ['CBORSerializer', 'MsgPackSerializer', 'UBJSONSerializer', 'JsonSerializer']
49 | serializers = list(filter(lambda x: x, map(lambda s: getattr(serializer, s) if hasattr(serializer, s)
50 | else None, serializers)))
51 | return serializers
52 |
--------------------------------------------------------------------------------
/autobahn/nvx/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | from autobahn.nvx._utf8validator import Utf8Validator # noqa
30 |
31 | __all__ = ('Utf8Validator',)
32 |
--------------------------------------------------------------------------------
/autobahn/nvx/_utf8validator.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | import os
30 | from cffi import FFI
31 |
32 |
33 | ffi = FFI()
34 |
35 | ffi.cdef("""
36 | void* nvx_utf8vld_new ();
37 |
38 | void nvx_utf8vld_reset (void* utf8vld);
39 |
40 | int nvx_utf8vld_validate (void* utf8vld, const uint8_t* data, size_t length);
41 |
42 | void nvx_utf8vld_free (void* utf8vld);
43 |
44 | int nvx_utf8vld_set_impl(void* utf8vld, int impl);
45 |
46 | int nvx_utf8vld_get_impl(void* utf8vld);
47 | """)
48 |
49 | with open(os.path.join(os.path.dirname(__file__), '_utf8validator.c')) as fd:
50 | c_source = fd.read()
51 | ffi.set_source(
52 | "_nvx_utf8validator",
53 | c_source,
54 | libraries=[],
55 | extra_compile_args=['-std=c99', '-Wall', '-Wno-strict-prototypes', '-O3', '-march=native']
56 | )
57 |
58 |
59 | class Utf8Validator:
60 |
61 | def __init__(self):
62 | self.ffi = ffi
63 |
64 | from _nvx_utf8validator import lib
65 | self.lib = lib
66 |
67 | self._vld = self.ffi.gc(self.lib.nvx_utf8vld_new(), self.lib.nvx_utf8vld_free)
68 | print(self.lib.nvx_utf8vld_get_impl(self._vld))
69 |
70 | def reset(self):
71 | self.lib.nvx_utf8vld_reset(self._vld)
72 |
73 | def validate(self, ba):
74 | res = self.lib.nvx_utf8vld_validate(self._vld, ba, len(ba))
75 | return (res >= 0, res == 0, None, None)
76 |
77 |
78 | if __name__ == "__main__":
79 | ffi.compile()
80 |
--------------------------------------------------------------------------------
/autobahn/rawsocket/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
--------------------------------------------------------------------------------
/autobahn/rawsocket/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/rawsocket/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/rawsocket/__pycache__/util.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/rawsocket/__pycache__/util.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/rawsocket/test/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
--------------------------------------------------------------------------------
/autobahn/test/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import, print_function
28 |
29 |
30 | class FakeTransport(object):
31 | _written = b""
32 | _open = True
33 |
34 | def write(self, msg):
35 | if not self._open:
36 | raise Exception("Can't write to a closed connection")
37 | self._written = self._written + msg
38 |
39 | def loseConnection(self):
40 | self._open = False
41 |
42 | def registerProducer(self, producer, streaming):
43 | # https://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IConsumer.html
44 | raise NotImplementedError
45 |
46 | def unregisterProducer(self):
47 | # do nothing is correct! until we fake implement registerProducer ..;)
48 | pass
49 |
--------------------------------------------------------------------------------
/autobahn/test/test_util.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | import unittest
30 |
31 | from autobahn.util import IdGenerator
32 |
33 |
34 | class TestIdGenerator(unittest.TestCase):
35 | def test_idgenerator_is_generator(self):
36 | "IdGenerator follows the generator protocol"
37 | g = IdGenerator()
38 | self.assertEqual(1, next(g))
39 | self.assertEqual(2, next(g))
40 |
41 | def test_generator_wrap(self):
42 | g = IdGenerator()
43 | g._next = 2 ** 53 - 1 # cheat a little
44 |
45 | v = next(g)
46 | self.assertEqual(v, 2 ** 53)
47 | v = next(g)
48 | self.assertEqual(v, 1)
49 |
--------------------------------------------------------------------------------
/autobahn/twisted/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 |
28 | from __future__ import absolute_import
29 |
30 | import sys
31 | import platform
32 |
33 | import twisted
34 |
35 | import autobahn
36 |
37 | # Twisted specific utilities (these should really be in Twisted, but
38 | # they aren't, and we use these in example code, so it must be part of
39 | # the public API)
40 | from autobahn.twisted.util import sleep
41 | from autobahn.twisted.choosereactor import install_reactor
42 |
43 | # WebSocket protocol support
44 | from autobahn.twisted.websocket import \
45 | WebSocketServerProtocol, \
46 | WebSocketClientProtocol, \
47 | WebSocketServerFactory, \
48 | WebSocketClientFactory
49 |
50 | # support for running Twisted stream protocols over WebSocket
51 | from autobahn.twisted.websocket import WrappingWebSocketServerFactory, \
52 | WrappingWebSocketClientFactory
53 |
54 | # Twisted Web support - FIXME: these imports trigger import of Twisted reactor!
55 | # from autobahn.twisted.resource import WebSocketResource, WSGIRootResource
56 |
57 | # WAMP support
58 | from autobahn.twisted.wamp import ApplicationSession
59 |
60 |
61 | __all__ = (
62 | # this should really be in Twisted
63 | 'sleep',
64 | 'install_reactor',
65 |
66 | # WebSocket
67 | 'WebSocketServerProtocol',
68 | 'WebSocketClientProtocol',
69 | 'WebSocketServerFactory',
70 | 'WebSocketClientFactory',
71 |
72 | # wrapping stream protocols in WebSocket
73 | 'WrappingWebSocketServerFactory',
74 | 'WrappingWebSocketClientFactory',
75 |
76 | # Twisted Web - FIXME: see comment for import above
77 | # 'WebSocketResource',
78 |
79 | # this should really be in Twisted - FIXME: see comment for import above
80 | # 'WSGIRootResource',
81 |
82 | # WAMP support
83 | 'ApplicationSession',
84 | )
85 |
86 | __ident__ = u'Autobahn/{}-Twisted/{}-{}/{}'.format(autobahn.__version__, twisted.__version__, platform.python_implementation(), '.'.join([str(x) for x in list(sys.version_info[:3])]))
87 | """
88 | AutobahnPython library implementation (eg. "Autobahn/0.13.0-Twisted/15.5.0-CPython/3.5.1")
89 | """
90 |
--------------------------------------------------------------------------------
/autobahn/twisted/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/twisted/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/twisted/__pycache__/choosereactor.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/twisted/__pycache__/choosereactor.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/twisted/__pycache__/rawsocket.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/twisted/__pycache__/rawsocket.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/twisted/__pycache__/util.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/twisted/__pycache__/util.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/twisted/__pycache__/wamp.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/twisted/__pycache__/wamp.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/twisted/__pycache__/websocket.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/twisted/__pycache__/websocket.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/twisted/forwarder.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | import txaio
30 | txaio.use_twisted()
31 |
32 | from twisted.python import usage
33 | from twisted.internet.defer import inlineCallbacks
34 | from twisted.internet.protocol import Factory, Protocol
35 | from twisted.internet.endpoints import clientFromString, serverFromString
36 | from twisted.application import service
37 |
38 |
39 | class DestEndpointForwardingProtocol(Protocol):
40 |
41 | log = txaio.make_logger()
42 |
43 | def connectionMade(self):
44 | self.log.debug("DestEndpointForwardingProtocol.connectionMade")
45 | pass
46 |
47 | def dataReceived(self, data):
48 | self.log.debug(
49 | "DestEndpointForwardingProtocol.dataReceived: {data}",
50 | data=data,
51 | )
52 | if self.factory._sourceProtocol:
53 | self.factory._sourceProtocol.transport.write(data)
54 |
55 | def connectionLost(self, reason):
56 | self.log.debug("DestEndpointForwardingProtocol.connectionLost")
57 | if self.factory._sourceProtocol:
58 | self.factory._sourceProtocol.transport.loseConnection()
59 |
60 |
61 | class DestEndpointForwardingFactory(Factory):
62 |
63 | def __init__(self, sourceProtocol):
64 | self._sourceProtocol = sourceProtocol
65 | self._proto = None
66 |
67 | def buildProtocol(self, addr):
68 | self._proto = DestEndpointForwardingProtocol()
69 | self._proto.factory = self
70 | return self._proto
71 |
72 |
73 | class EndpointForwardingProtocol(Protocol):
74 |
75 | log = txaio.make_logger()
76 |
77 | @inlineCallbacks
78 | def connectionMade(self):
79 | self.log.debug("EndpointForwardingProtocol.connectionMade")
80 | self._destFactory = DestEndpointForwardingFactory(self)
81 | self._destEndpoint = clientFromString(self.factory.service._reactor,
82 | self.factory.service._destEndpointDescriptor)
83 | self._destEndpointPort = yield self._destEndpoint.connect(self._destFactory)
84 |
85 | def dataReceived(self, data):
86 | self.log.debug(
87 | "EndpointForwardingProtocol.dataReceived: {data}",
88 | data=data,
89 | )
90 | if self._destFactory._proto:
91 | self._destFactory._proto.transport.write(data)
92 |
93 | def connectionLost(self, reason):
94 | self.log.debug("EndpointForwardingProtocol.connectionLost")
95 | if self._destFactory._proto:
96 | self._destFactory._proto.transport.loseConnection()
97 |
98 |
99 | class EndpointForwardingService(service.Service):
100 |
101 | def __init__(self, endpointDescriptor, destEndpointDescriptor, reactor=None):
102 | if reactor is None:
103 | from twisted.internet import reactor
104 | self._reactor = reactor
105 | self._endpointDescriptor = endpointDescriptor
106 | self._destEndpointDescriptor = destEndpointDescriptor
107 |
108 | @inlineCallbacks
109 | def startService(self):
110 | factory = Factory.forProtocol(EndpointForwardingProtocol)
111 | factory.service = self
112 | self._endpoint = serverFromString(self._reactor, self._endpointDescriptor)
113 | self._endpointPort = yield self._endpoint.listen(factory)
114 |
115 | def stopService(self):
116 | return self._endpointPort.stopListening()
117 |
118 |
119 | class Options(usage.Options):
120 | synopsis = "[options]"
121 | longdesc = 'Endpoint Forwarder.'
122 | optParameters = [
123 | ["endpoint", "e", None, "Source endpoint."],
124 | ["dest_endpoint", "d", None, "Destination endpoint."]
125 | ]
126 |
127 |
128 | def makeService(config):
129 | service = EndpointForwardingService(config['endpoint'], config['dest_endpoint'])
130 | return service
131 |
--------------------------------------------------------------------------------
/autobahn/twisted/test/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
--------------------------------------------------------------------------------
/autobahn/twisted/test/test_endpoint_plugins.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | from twisted.trial.unittest import TestCase
30 | import six
31 |
32 |
33 | class PluginTests(TestCase):
34 | if six.PY3:
35 | skip = "Plugins don't work under Python3 yet"
36 |
37 | def test_import(self):
38 | from twisted.plugins import autobahn_endpoints
39 | self.assertTrue(hasattr(autobahn_endpoints, 'AutobahnClientParser'))
40 |
41 | def test_parse_client_basic(self):
42 | from twisted.plugins import autobahn_endpoints
43 | self.assertTrue(hasattr(autobahn_endpoints, 'AutobahnClientParser'))
44 | from twisted.internet.endpoints import clientFromString, quoteStringArgument
45 | from twisted.internet import reactor
46 |
47 | ep_string = "autobahn:{0}:url={1}".format(
48 | quoteStringArgument('tcp:localhost:9000'),
49 | quoteStringArgument('ws://localhost:9000'),
50 | )
51 | # we're just testing that this doesn't fail entirely
52 | clientFromString(reactor, ep_string)
53 |
--------------------------------------------------------------------------------
/autobahn/twisted/test/test_rawsocket.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import, print_function
28 |
29 | import unittest
30 |
31 | from autobahn.twisted.rawsocket import (WampRawSocketServerFactory,
32 | WampRawSocketServerProtocol,
33 | WampRawSocketClientFactory,
34 | WampRawSocketClientProtocol)
35 | from autobahn.test import FakeTransport
36 | from mock import Mock
37 |
38 |
39 | class RawSocketHandshakeTests(unittest.TestCase):
40 |
41 | def test_handshake_succeeds(self):
42 | """
43 | A client can connect to a server.
44 | """
45 | session_mock = Mock()
46 | t = FakeTransport()
47 | f = WampRawSocketClientFactory(lambda: session_mock)
48 | p = WampRawSocketClientProtocol()
49 | p.transport = t
50 | p.factory = f
51 |
52 | server_session_mock = Mock()
53 | st = FakeTransport()
54 | sf = WampRawSocketServerFactory(lambda: server_session_mock)
55 | sp = WampRawSocketServerProtocol()
56 | sp.transport = st
57 | sp.factory = sf
58 |
59 | sp.connectionMade()
60 | p.connectionMade()
61 |
62 | # Send the server the client handshake
63 | sp.dataReceived(t._written[0:1])
64 | sp.dataReceived(t._written[1:4])
65 |
66 | # Send the client the server handshake
67 | p.dataReceived(st._written)
68 |
69 | # The handshake succeeds, a session on each end is created
70 | # onOpen is called on the session
71 | session_mock.onOpen.assert_called_once_with(p)
72 | server_session_mock.onOpen.assert_called_once_with(sp)
73 |
--------------------------------------------------------------------------------
/autobahn/wamp/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | from autobahn.wamp.types import \
30 | ComponentConfig, \
31 | SessionDetails, \
32 | CloseDetails, \
33 | RegisterOptions, \
34 | CallOptions, \
35 | CallDetails, \
36 | CallResult, \
37 | SubscribeOptions, \
38 | PublishOptions, \
39 | EventDetails
40 |
41 | from autobahn.wamp.exception import \
42 | Error, \
43 | SessionNotReady, \
44 | SerializationError, \
45 | ProtocolError, \
46 | TransportLost, \
47 | ApplicationError, \
48 | InvalidUri
49 |
50 | from autobahn.wamp.interfaces import ISession
51 |
52 | from autobahn.wamp.uri import \
53 | error, \
54 | register, \
55 | subscribe
56 |
57 |
58 | __all__ = (
59 | 'ComponentConfig',
60 | 'SessionDetails',
61 | 'CloseDetails',
62 | 'RegisterOptions',
63 | 'CallOptions',
64 | 'CallDetails',
65 | 'CallResult',
66 | 'SubscribeOptions',
67 | 'PublishOptions',
68 | 'EventDetails',
69 |
70 | 'Error',
71 | 'SessionNotReady',
72 | 'SerializationError',
73 | 'ProtocolError',
74 | 'TransportLost',
75 | 'ApplicationError',
76 | 'InvalidUri',
77 |
78 | 'ISession',
79 |
80 | 'error',
81 | 'register',
82 | 'subscribe',
83 | )
84 |
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/auth.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/auth.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/exception.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/exception.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/interfaces.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/interfaces.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/message.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/message.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/protocol.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/protocol.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/request.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/request.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/role.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/role.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/types.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/types.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/uri.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/uri.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/__pycache__/websocket.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/__pycache__/websocket.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/wamp/flatbuffers/roles.fbs:
--------------------------------------------------------------------------------
1 |
2 | //////////////////////////////////////////////////////////////////////////////
3 | //
4 | // FlatBuffers schema for WAMP v2 messages
5 | // Copyright (c) Crossbar.io Technologies GmbH and contributors
6 | // Licensed under the MIT License (MIT)
7 | //
8 | //////////////////////////////////////////////////////////////////////////////
9 |
10 | include "types.fbs";
11 |
12 | namespace wamp.proto;
13 |
14 |
15 | // Features from the WAMP advanced profile a **Broker** might support.
16 | table BrokerFeatures
17 | {
18 | publisher_identification: bool;
19 | publisher_exclusion: bool;
20 | subscriber_blackwhite_listing: bool;
21 | pattern_based_subscription: bool;
22 | publication_trustlevels: bool;
23 | subscription_revocation: bool;
24 | session_meta_api: bool;
25 | subscription_meta_api: bool;
26 | event_retention: bool;
27 | event_history: bool;
28 | acknowledge_event_received: bool;
29 | acknowledge_subscriber_received: bool;
30 | payload_transparency: bool;
31 | payload_encryption_cryptobox: bool;
32 | }
33 |
34 |
35 | // Features from the WAMP advanced profile a **Publisher** might support.
36 | // Note: this is a subset of the feature brokers can support.
37 | table PublisherFeatures
38 | {
39 | publisher_identification: bool;
40 | publisher_exclusion: bool;
41 | subscriber_blackwhite_listing: bool;
42 | acknowledge_event_received: bool;
43 | payload_transparency: bool;
44 | payload_encryption_cryptobox: bool;
45 | }
46 |
47 |
48 | // Features from the WAMP advanced profile a **Subscriber** might support.
49 | // Note: this is a subset of the feature brokers can support.
50 | table SubscriberFeatures
51 | {
52 | publisher_identification: bool;
53 | pattern_based_subscription: bool;
54 | publication_trustlevels: bool;
55 | subscription_revocation: bool;
56 | event_history: bool;
57 | acknowledge_subscriber_received: bool;
58 | payload_transparency: bool;
59 | payload_encryption_cryptobox: bool;
60 | }
61 |
62 |
63 | // Features from the WAMP advanced profile a **Dealer** might support.
64 | table DealerFeatures
65 | {
66 | caller_identification: bool;
67 | call_trustlevels: bool;
68 | call_timeout: bool;
69 | call_canceling: bool;
70 | progressive_call_results: bool;
71 | registration_revocation: bool;
72 | pattern_based_registration: bool;
73 | shared_registration: bool;
74 | session_meta_api: bool;
75 | registration_meta_api: bool;
76 | testament_meta_api: bool;
77 | payload_transparency: bool;
78 | payload_encryption_cryptobox: bool;
79 | }
80 |
81 |
82 | // Features from the WAMP advanced profile a **Caller** might support.
83 | // Note: this is a subset of the feature dealers can support.
84 | table CallerFeatures
85 | {
86 | caller_identification: bool;
87 | call_timeout: bool;
88 | call_canceling: bool;
89 | progressive_call_results: bool;
90 | payload_transparency: bool;
91 | payload_encryption_cryptobox : bool;
92 | }
93 |
94 |
95 | // Features from the WAMP advanced profile a **Callee** might support.
96 | // Note: this is a subset of the feature dealers can support.
97 | table CalleeFeatures
98 | {
99 | caller_identification: bool;
100 | call_trustlevels: bool;
101 | call_timeout: bool;
102 | call_canceling: bool;
103 | progressive_call_results: bool;
104 | registration_revocation: bool;
105 | pattern_based_registration: bool;
106 | shared_registration: bool;
107 | payload_transparency: bool;
108 | payload_encryption_cryptobox: bool;
109 | }
110 |
111 |
112 | // WAMP roles a **Client** might support (it must support at least one).
113 | table ClientRoles
114 | {
115 | publisher: PublisherFeatures;
116 | subscriber: SubscriberFeatures;
117 | caller: CallerFeatures;
118 | callee: CalleeFeatures;
119 | }
120 |
121 |
122 | // WAMP roles a **Router** might support (it must support at least one).
123 | table RouterRoles
124 | {
125 | broker: BrokerFeatures;
126 | dealer: DealerFeatures;
127 | }
128 |
--------------------------------------------------------------------------------
/autobahn/wamp/flatbuffers/wamp.fbs:
--------------------------------------------------------------------------------
1 |
2 | //////////////////////////////////////////////////////////////////////////////
3 | //
4 | // FlatBuffers schema for WAMP v2 messages
5 | // Copyright (c) Crossbar.io Technologies GmbH and contributors
6 | // Licensed under the MIT License (MIT)
7 | //
8 | //////////////////////////////////////////////////////////////////////////////
9 |
10 | include "types.fbs";
11 | include "roles.fbs";
12 | include "auth.fbs";
13 | include "session.fbs";
14 | include "pubsub.fbs";
15 | include "rpc.fbs";
16 |
17 |
18 | // Web Application Message Protocol (WAMP) namespace.
19 | //
20 | // WAMP at the application level exposes 4 roles:
21 | //
22 | // - Caller and Callee
23 | // - Publisher and Subscriber
24 | //
25 | // To decouple each pair of roles (or actors), WAMP uses an intermediary
26 | // that may implement two additional roles:
27 | //
28 | // - Dealer, to forward calls from Callers to Callees
29 | // - Broker, to dispatch events from Publishers to Subscribers
30 | //
31 | // WAMP is then defined in terms of message flow between those 6 roles.
32 | // There 26 WAMP messages at the wire level, and these are defined
33 | // (structurally) using FlatBuffers in this namespace.
34 | namespace wamp.proto;
35 |
36 |
37 | // A WAMP message is of exactly one of the following 26 concrete message types.
38 | union AnyMessage
39 | {
40 | // Session
41 | Hello,
42 | Welcome,
43 | Abort,
44 | Challenge,
45 | Authenticate,
46 | Goodbye,
47 |
48 | // Common
49 | Error,
50 |
51 | // PubSub
52 | Publish,
53 | Published,
54 | SubscriberReceived, // NEW
55 | Subscribe,
56 | Subscribed,
57 | Unsubscribe,
58 | Unsubscribed,
59 | Event,
60 | EventReceived, // NEW
61 |
62 | // RPC
63 | Call,
64 | Cancel,
65 | Result,
66 | Register,
67 | Registered,
68 | Unregister,
69 | Unregistered,
70 | Invocation,
71 | Interrupt,
72 | Yield
73 | }
74 |
75 |
76 | // A WAMP message container.
77 | table Message
78 | {
79 | // The WAMP message, one of the 26 different message types.
80 | msg: AnyMessage (required);
81 | }
82 |
83 |
84 | // The FlatBuffers root type is our WAMP message container type.
85 | root_type Message;
86 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/schema/auth.bfbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/schema/auth.bfbs
--------------------------------------------------------------------------------
/autobahn/wamp/gen/schema/pubsub.bfbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/schema/pubsub.bfbs
--------------------------------------------------------------------------------
/autobahn/wamp/gen/schema/roles.bfbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/schema/roles.bfbs
--------------------------------------------------------------------------------
/autobahn/wamp/gen/schema/rpc.bfbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/schema/rpc.bfbs
--------------------------------------------------------------------------------
/autobahn/wamp/gen/schema/session.bfbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/schema/session.bfbs
--------------------------------------------------------------------------------
/autobahn/wamp/gen/schema/types.bfbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/schema/types.bfbs
--------------------------------------------------------------------------------
/autobahn/wamp/gen/schema/wamp.bfbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/schema/wamp.bfbs
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/Map.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: wamp
4 |
5 | import flatbuffers
6 |
7 | class Map(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsMap(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Map()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Map
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Map
22 | def Key(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | # Map
29 | def Value(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | def MapStart(builder): builder.StartObject(2)
36 | def MapAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0)
37 | def MapAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0)
38 | def MapEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/Void.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: wamp
4 |
5 | import flatbuffers
6 |
7 | class Void(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsVoid(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Void()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Void
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | def VoidStart(builder): builder.StartObject(0)
22 | def VoidEnd(builder): return builder.EndObject()
23 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/wamp/__init__.py
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Abort.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Abort(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAbort(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Abort()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Abort
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Abort
22 | def Reason(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | # Abort
29 | def Message(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | def AbortStart(builder): builder.StartObject(2)
36 | def AbortAddReason(builder, reason): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(reason), 0)
37 | def AbortAddMessage(builder, message): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(message), 0)
38 | def AbortEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AnyMessage.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class AnyMessage(object):
6 | NONE = 0
7 | Hello = 1
8 | Welcome = 2
9 | Abort = 3
10 | Challenge = 4
11 | Authenticate = 5
12 | Goodbye = 6
13 | Error = 7
14 | Publish = 8
15 | Published = 9
16 | SubscriberReceived = 10
17 | Subscribe = 11
18 | Subscribed = 12
19 | Unsubscribe = 13
20 | Unsubscribed = 14
21 | Event = 15
22 | EventReceived = 16
23 | Call = 17
24 | Cancel = 18
25 | Result = 19
26 | Register = 20
27 | Registered = 21
28 | Unregister = 22
29 | Unregistered = 23
30 | Invocation = 24
31 | Interrupt = 25
32 | Yield = 26
33 |
34 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthCraChallenge.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthCraChallenge(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthCraChallenge(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthCraChallenge()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthCraChallenge
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # AuthCraChallenge
22 | def Challenge(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | # AuthCraChallenge
29 | def Salt(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | # AuthCraChallenge
36 | def Iterations(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
40 | return 1000
41 |
42 | # AuthCraChallenge
43 | def Keylen(self):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
47 | return 32
48 |
49 | def AuthCraChallengeStart(builder): builder.StartObject(4)
50 | def AuthCraChallengeAddChallenge(builder, challenge): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(challenge), 0)
51 | def AuthCraChallengeAddSalt(builder, salt): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(salt), 0)
52 | def AuthCraChallengeAddIterations(builder, iterations): builder.PrependUint32Slot(2, iterations, 1000)
53 | def AuthCraChallengeAddKeylen(builder, keylen): builder.PrependUint8Slot(3, keylen, 32)
54 | def AuthCraChallengeEnd(builder): return builder.EndObject()
55 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthCraRequest.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthCraRequest(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthCraRequest(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthCraRequest()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthCraRequest
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | def AuthCraRequestStart(builder): builder.StartObject(0)
22 | def AuthCraRequestEnd(builder): return builder.EndObject()
23 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthCraWelcome.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthCraWelcome(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthCraWelcome(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthCraWelcome()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthCraWelcome
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | def AuthCraWelcomeStart(builder): builder.StartObject(0)
22 | def AuthCraWelcomeEnd(builder): return builder.EndObject()
23 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthCryptosignChallenge.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthCryptosignChallenge(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthCryptosignChallenge(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthCryptosignChallenge()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthCryptosignChallenge
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # AuthCryptosignChallenge
22 | def ChannelBinding(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | def AuthCryptosignChallengeStart(builder): builder.StartObject(1)
29 | def AuthCryptosignChallengeAddChannelBinding(builder, channelBinding): builder.PrependUint8Slot(0, channelBinding, 0)
30 | def AuthCryptosignChallengeEnd(builder): return builder.EndObject()
31 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthCryptosignRequest.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthCryptosignRequest(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthCryptosignRequest(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthCryptosignRequest()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthCryptosignRequest
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # AuthCryptosignRequest
22 | def Pubkey(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | # AuthCryptosignRequest
29 | def ChannelBinding(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | def AuthCryptosignRequestStart(builder): builder.StartObject(2)
36 | def AuthCryptosignRequestAddPubkey(builder, pubkey): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(pubkey), 0)
37 | def AuthCryptosignRequestAddChannelBinding(builder, channelBinding): builder.PrependUint8Slot(1, channelBinding, 0)
38 | def AuthCryptosignRequestEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthCryptosignWelcome.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthCryptosignWelcome(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthCryptosignWelcome(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthCryptosignWelcome()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthCryptosignWelcome
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | def AuthCryptosignWelcomeStart(builder): builder.StartObject(0)
22 | def AuthCryptosignWelcomeEnd(builder): return builder.EndObject()
23 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthFactor.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class AuthFactor(object):
6 | NONE = 0
7 | AuthTicketRequest = 1
8 | AuthCraRequest = 2
9 | AuthScramRequest = 3
10 | AuthCryptosignRequest = 4
11 |
12 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthMethod.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class AuthMethod(object):
6 | ANONYMOUS = 0
7 | COOKIE = 1
8 | TLS = 2
9 | TICKET = 3
10 | CRA = 4
11 | SCRAM = 5
12 | CRYPTOSIGN = 6
13 |
14 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthMode.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class AuthMode(object):
6 | FIRST = 0
7 | MULTIFACTOR = 1
8 |
9 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthScramChallenge.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthScramChallenge(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthScramChallenge(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthScramChallenge()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthScramChallenge
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # AuthScramChallenge
22 | def Nonce(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | # AuthScramChallenge
29 | def Salt(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | # AuthScramChallenge
36 | def Kdf(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
40 | return 2
41 |
42 | # AuthScramChallenge
43 | def Iterations(self):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
47 | return 0
48 |
49 | # AuthScramChallenge
50 | def Memory(self):
51 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
52 | if o != 0:
53 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
54 | return 0
55 |
56 | # AuthScramChallenge
57 | def ChannelBinding(self):
58 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
59 | if o != 0:
60 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
61 | return 0
62 |
63 | def AuthScramChallengeStart(builder): builder.StartObject(6)
64 | def AuthScramChallengeAddNonce(builder, nonce): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nonce), 0)
65 | def AuthScramChallengeAddSalt(builder, salt): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(salt), 0)
66 | def AuthScramChallengeAddKdf(builder, kdf): builder.PrependUint8Slot(2, kdf, 2)
67 | def AuthScramChallengeAddIterations(builder, iterations): builder.PrependUint32Slot(3, iterations, 0)
68 | def AuthScramChallengeAddMemory(builder, memory): builder.PrependUint32Slot(4, memory, 0)
69 | def AuthScramChallengeAddChannelBinding(builder, channelBinding): builder.PrependUint8Slot(5, channelBinding, 0)
70 | def AuthScramChallengeEnd(builder): return builder.EndObject()
71 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthScramRequest.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthScramRequest(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthScramRequest(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthScramRequest()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthScramRequest
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # AuthScramRequest
22 | def Nonce(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | # AuthScramRequest
29 | def ChannelBinding(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | def AuthScramRequestStart(builder): builder.StartObject(2)
36 | def AuthScramRequestAddNonce(builder, nonce): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nonce), 0)
37 | def AuthScramRequestAddChannelBinding(builder, channelBinding): builder.PrependUint8Slot(1, channelBinding, 0)
38 | def AuthScramRequestEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthScramWelcome.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthScramWelcome(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthScramWelcome(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthScramWelcome()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthScramWelcome
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # AuthScramWelcome
22 | def Verifier(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | def AuthScramWelcomeStart(builder): builder.StartObject(1)
29 | def AuthScramWelcomeAddVerifier(builder, verifier): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(verifier), 0)
30 | def AuthScramWelcomeEnd(builder): return builder.EndObject()
31 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthTicketChallenge.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthTicketChallenge(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthTicketChallenge(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthTicketChallenge()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthTicketChallenge
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | def AuthTicketChallengeStart(builder): builder.StartObject(0)
22 | def AuthTicketChallengeEnd(builder): return builder.EndObject()
23 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthTicketRequest.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthTicketRequest(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthTicketRequest(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthTicketRequest()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthTicketRequest
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | def AuthTicketRequestStart(builder): builder.StartObject(0)
22 | def AuthTicketRequestEnd(builder): return builder.EndObject()
23 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/AuthTicketWelcome.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class AuthTicketWelcome(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthTicketWelcome(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = AuthTicketWelcome()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # AuthTicketWelcome
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | def AuthTicketWelcomeStart(builder): builder.StartObject(0)
22 | def AuthTicketWelcomeEnd(builder): return builder.EndObject()
23 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Authenticate.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Authenticate(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsAuthenticate(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Authenticate()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Authenticate
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Authenticate
22 | def Signature(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | # Authenticate
29 | def Extra(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | x = self._tab.Indirect(o + self._tab.Pos)
33 | from .Map import Map
34 | obj = Map()
35 | obj.Init(self._tab.Bytes, x)
36 | return obj
37 | return None
38 |
39 | def AuthenticateStart(builder): builder.StartObject(2)
40 | def AuthenticateAddSignature(builder, signature): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(signature), 0)
41 | def AuthenticateAddExtra(builder, extra): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(extra), 0)
42 | def AuthenticateEnd(builder): return builder.EndObject()
43 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Call.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Call(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsCall(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Call()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Call
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Call
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Call
29 | def Procedure(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | # Call
36 | def Payload(self, j):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | a = self._tab.Vector(o)
40 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
41 | return 0
42 |
43 | # Call
44 | def PayloadAsNumpy(self):
45 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
46 | if o != 0:
47 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
48 | return 0
49 |
50 | # Call
51 | def PayloadLength(self):
52 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
53 | if o != 0:
54 | return self._tab.VectorLen(o)
55 | return 0
56 |
57 | # Call
58 | def EncAlgo(self):
59 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
60 | if o != 0:
61 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
62 | return 0
63 |
64 | # Call
65 | def EncSerializer(self):
66 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
67 | if o != 0:
68 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
69 | return 0
70 |
71 | # Call
72 | def EncKey(self, j):
73 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
74 | if o != 0:
75 | a = self._tab.Vector(o)
76 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
77 | return 0
78 |
79 | # Call
80 | def EncKeyAsNumpy(self):
81 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
82 | if o != 0:
83 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
84 | return 0
85 |
86 | # Call
87 | def EncKeyLength(self):
88 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
89 | if o != 0:
90 | return self._tab.VectorLen(o)
91 | return 0
92 |
93 | # Call
94 | def Timeout(self):
95 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
96 | if o != 0:
97 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
98 | return 0
99 |
100 | # Call
101 | def ReceiveProgress(self):
102 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
103 | if o != 0:
104 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
105 | return False
106 |
107 | def CallStart(builder): builder.StartObject(8)
108 | def CallAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
109 | def CallAddProcedure(builder, procedure): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(procedure), 0)
110 | def CallAddPayload(builder, payload): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(payload), 0)
111 | def CallStartPayloadVector(builder, numElems): return builder.StartVector(1, numElems, 1)
112 | def CallAddEncAlgo(builder, encAlgo): builder.PrependUint8Slot(3, encAlgo, 0)
113 | def CallAddEncSerializer(builder, encSerializer): builder.PrependUint8Slot(4, encSerializer, 0)
114 | def CallAddEncKey(builder, encKey): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(encKey), 0)
115 | def CallStartEncKeyVector(builder, numElems): return builder.StartVector(1, numElems, 1)
116 | def CallAddTimeout(builder, timeout): builder.PrependUint32Slot(6, timeout, 0)
117 | def CallAddReceiveProgress(builder, receiveProgress): builder.PrependBoolSlot(7, receiveProgress, 0)
118 | def CallEnd(builder): return builder.EndObject()
119 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/CalleeFeatures.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class CalleeFeatures(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsCalleeFeatures(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = CalleeFeatures()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # CalleeFeatures
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # CalleeFeatures
22 | def CallerIdentification(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
26 | return False
27 |
28 | # CalleeFeatures
29 | def CallTrustlevels(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
33 | return False
34 |
35 | # CalleeFeatures
36 | def CallTimeout(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
40 | return False
41 |
42 | # CalleeFeatures
43 | def CallCanceling(self):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
47 | return False
48 |
49 | # CalleeFeatures
50 | def ProgressiveCallResults(self):
51 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
52 | if o != 0:
53 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
54 | return False
55 |
56 | # CalleeFeatures
57 | def RegistrationRevocation(self):
58 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
59 | if o != 0:
60 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
61 | return False
62 |
63 | # CalleeFeatures
64 | def PatternBasedRegistration(self):
65 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
66 | if o != 0:
67 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
68 | return False
69 |
70 | # CalleeFeatures
71 | def SharedRegistration(self):
72 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
73 | if o != 0:
74 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
75 | return False
76 |
77 | # CalleeFeatures
78 | def PayloadTransparency(self):
79 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
80 | if o != 0:
81 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
82 | return False
83 |
84 | # CalleeFeatures
85 | def PayloadEncryptionCryptobox(self):
86 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
87 | if o != 0:
88 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
89 | return False
90 |
91 | def CalleeFeaturesStart(builder): builder.StartObject(10)
92 | def CalleeFeaturesAddCallerIdentification(builder, callerIdentification): builder.PrependBoolSlot(0, callerIdentification, 0)
93 | def CalleeFeaturesAddCallTrustlevels(builder, callTrustlevels): builder.PrependBoolSlot(1, callTrustlevels, 0)
94 | def CalleeFeaturesAddCallTimeout(builder, callTimeout): builder.PrependBoolSlot(2, callTimeout, 0)
95 | def CalleeFeaturesAddCallCanceling(builder, callCanceling): builder.PrependBoolSlot(3, callCanceling, 0)
96 | def CalleeFeaturesAddProgressiveCallResults(builder, progressiveCallResults): builder.PrependBoolSlot(4, progressiveCallResults, 0)
97 | def CalleeFeaturesAddRegistrationRevocation(builder, registrationRevocation): builder.PrependBoolSlot(5, registrationRevocation, 0)
98 | def CalleeFeaturesAddPatternBasedRegistration(builder, patternBasedRegistration): builder.PrependBoolSlot(6, patternBasedRegistration, 0)
99 | def CalleeFeaturesAddSharedRegistration(builder, sharedRegistration): builder.PrependBoolSlot(7, sharedRegistration, 0)
100 | def CalleeFeaturesAddPayloadTransparency(builder, payloadTransparency): builder.PrependBoolSlot(8, payloadTransparency, 0)
101 | def CalleeFeaturesAddPayloadEncryptionCryptobox(builder, payloadEncryptionCryptobox): builder.PrependBoolSlot(9, payloadEncryptionCryptobox, 0)
102 | def CalleeFeaturesEnd(builder): return builder.EndObject()
103 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/CallerFeatures.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class CallerFeatures(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsCallerFeatures(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = CallerFeatures()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # CallerFeatures
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # CallerFeatures
22 | def CallerIdentification(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
26 | return False
27 |
28 | # CallerFeatures
29 | def CallTimeout(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
33 | return False
34 |
35 | # CallerFeatures
36 | def CallCanceling(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
40 | return False
41 |
42 | # CallerFeatures
43 | def ProgressiveCallResults(self):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
47 | return False
48 |
49 | # CallerFeatures
50 | def PayloadTransparency(self):
51 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
52 | if o != 0:
53 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
54 | return False
55 |
56 | # CallerFeatures
57 | def PayloadEncryptionCryptobox(self):
58 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
59 | if o != 0:
60 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
61 | return False
62 |
63 | def CallerFeaturesStart(builder): builder.StartObject(6)
64 | def CallerFeaturesAddCallerIdentification(builder, callerIdentification): builder.PrependBoolSlot(0, callerIdentification, 0)
65 | def CallerFeaturesAddCallTimeout(builder, callTimeout): builder.PrependBoolSlot(1, callTimeout, 0)
66 | def CallerFeaturesAddCallCanceling(builder, callCanceling): builder.PrependBoolSlot(2, callCanceling, 0)
67 | def CallerFeaturesAddProgressiveCallResults(builder, progressiveCallResults): builder.PrependBoolSlot(3, progressiveCallResults, 0)
68 | def CallerFeaturesAddPayloadTransparency(builder, payloadTransparency): builder.PrependBoolSlot(4, payloadTransparency, 0)
69 | def CallerFeaturesAddPayloadEncryptionCryptobox(builder, payloadEncryptionCryptobox): builder.PrependBoolSlot(5, payloadEncryptionCryptobox, 0)
70 | def CallerFeaturesEnd(builder): return builder.EndObject()
71 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Cancel.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Cancel(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsCancel(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Cancel()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Cancel
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Cancel
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Cancel
29 | def Mode(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | def CancelStart(builder): builder.StartObject(2)
36 | def CancelAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
37 | def CancelAddMode(builder, mode): builder.PrependUint8Slot(1, mode, 0)
38 | def CancelEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/CancelMode.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class CancelMode(object):
6 | SKIP = 0
7 | ABORT = 1
8 | KILL = 2
9 |
10 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Challenge.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Challenge(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsChallenge(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Challenge()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Challenge
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Challenge
22 | def Method(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Challenge
29 | def Extra(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | x = self._tab.Indirect(o + self._tab.Pos)
33 | from .Map import Map
34 | obj = Map()
35 | obj.Init(self._tab.Bytes, x)
36 | return obj
37 | return None
38 |
39 | def ChallengeStart(builder): builder.StartObject(2)
40 | def ChallengeAddMethod(builder, method): builder.PrependUint8Slot(0, method, 0)
41 | def ChallengeAddExtra(builder, extra): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(extra), 0)
42 | def ChallengeEnd(builder): return builder.EndObject()
43 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/ChannelBinding.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class ChannelBinding(object):
6 | NONE = 0
7 | TLS_UNIQUE = 1
8 |
9 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/ClientRoles.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class ClientRoles(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsClientRoles(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = ClientRoles()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # ClientRoles
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # ClientRoles
22 | def Publisher(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | x = self._tab.Indirect(o + self._tab.Pos)
26 | from .PublisherFeatures import PublisherFeatures
27 | obj = PublisherFeatures()
28 | obj.Init(self._tab.Bytes, x)
29 | return obj
30 | return None
31 |
32 | # ClientRoles
33 | def Subscriber(self):
34 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
35 | if o != 0:
36 | x = self._tab.Indirect(o + self._tab.Pos)
37 | from .SubscriberFeatures import SubscriberFeatures
38 | obj = SubscriberFeatures()
39 | obj.Init(self._tab.Bytes, x)
40 | return obj
41 | return None
42 |
43 | # ClientRoles
44 | def Caller(self):
45 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
46 | if o != 0:
47 | x = self._tab.Indirect(o + self._tab.Pos)
48 | from .CallerFeatures import CallerFeatures
49 | obj = CallerFeatures()
50 | obj.Init(self._tab.Bytes, x)
51 | return obj
52 | return None
53 |
54 | # ClientRoles
55 | def Callee(self):
56 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
57 | if o != 0:
58 | x = self._tab.Indirect(o + self._tab.Pos)
59 | from .CalleeFeatures import CalleeFeatures
60 | obj = CalleeFeatures()
61 | obj.Init(self._tab.Bytes, x)
62 | return obj
63 | return None
64 |
65 | def ClientRolesStart(builder): builder.StartObject(4)
66 | def ClientRolesAddPublisher(builder, publisher): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(publisher), 0)
67 | def ClientRolesAddSubscriber(builder, subscriber): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(subscriber), 0)
68 | def ClientRolesAddCaller(builder, caller): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(caller), 0)
69 | def ClientRolesAddCallee(builder, callee): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(callee), 0)
70 | def ClientRolesEnd(builder): return builder.EndObject()
71 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Error.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Error(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsError(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Error()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Error
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Error
22 | def RequestType(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Error
29 | def Request(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | # Error
36 | def Error(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return self._tab.String(o + self._tab.Pos)
40 | return None
41 |
42 | # Error
43 | def Payload(self, j):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | a = self._tab.Vector(o)
47 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
48 | return 0
49 |
50 | # Error
51 | def PayloadAsNumpy(self):
52 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
53 | if o != 0:
54 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
55 | return 0
56 |
57 | # Error
58 | def PayloadLength(self):
59 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
60 | if o != 0:
61 | return self._tab.VectorLen(o)
62 | return 0
63 |
64 | # Error
65 | def EncAlgo(self):
66 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
67 | if o != 0:
68 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
69 | return 0
70 |
71 | # Error
72 | def EncSerializer(self):
73 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
74 | if o != 0:
75 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
76 | return 0
77 |
78 | # Error
79 | def EncKey(self, j):
80 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
81 | if o != 0:
82 | a = self._tab.Vector(o)
83 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
84 | return 0
85 |
86 | # Error
87 | def EncKeyAsNumpy(self):
88 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
89 | if o != 0:
90 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
91 | return 0
92 |
93 | # Error
94 | def EncKeyLength(self):
95 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
96 | if o != 0:
97 | return self._tab.VectorLen(o)
98 | return 0
99 |
100 | def ErrorStart(builder): builder.StartObject(7)
101 | def ErrorAddRequestType(builder, requestType): builder.PrependUint16Slot(0, requestType, 0)
102 | def ErrorAddRequest(builder, request): builder.PrependUint64Slot(1, request, 0)
103 | def ErrorAddError(builder, error): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(error), 0)
104 | def ErrorAddPayload(builder, payload): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(payload), 0)
105 | def ErrorStartPayloadVector(builder, numElems): return builder.StartVector(1, numElems, 1)
106 | def ErrorAddEncAlgo(builder, encAlgo): builder.PrependUint8Slot(4, encAlgo, 0)
107 | def ErrorAddEncSerializer(builder, encSerializer): builder.PrependUint8Slot(5, encSerializer, 0)
108 | def ErrorAddEncKey(builder, encKey): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(encKey), 0)
109 | def ErrorStartEncKeyVector(builder, numElems): return builder.StartVector(1, numElems, 1)
110 | def ErrorEnd(builder): return builder.EndObject()
111 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/EventReceived.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class EventReceived(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsEventReceived(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = EventReceived()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # EventReceived
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # EventReceived
22 | def Publication(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # EventReceived
29 | def Payload(self, j):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | a = self._tab.Vector(o)
33 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
34 | return 0
35 |
36 | # EventReceived
37 | def PayloadAsNumpy(self):
38 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
39 | if o != 0:
40 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
41 | return 0
42 |
43 | # EventReceived
44 | def PayloadLength(self):
45 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
46 | if o != 0:
47 | return self._tab.VectorLen(o)
48 | return 0
49 |
50 | # EventReceived
51 | def EncAlgo(self):
52 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
53 | if o != 0:
54 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
55 | return 0
56 |
57 | # EventReceived
58 | def EncSerializer(self):
59 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
60 | if o != 0:
61 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
62 | return 0
63 |
64 | # EventReceived
65 | def EncKey(self, j):
66 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
67 | if o != 0:
68 | a = self._tab.Vector(o)
69 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
70 | return 0
71 |
72 | # EventReceived
73 | def EncKeyAsNumpy(self):
74 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
75 | if o != 0:
76 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
77 | return 0
78 |
79 | # EventReceived
80 | def EncKeyLength(self):
81 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
82 | if o != 0:
83 | return self._tab.VectorLen(o)
84 | return 0
85 |
86 | def EventReceivedStart(builder): builder.StartObject(5)
87 | def EventReceivedAddPublication(builder, publication): builder.PrependUint64Slot(0, publication, 0)
88 | def EventReceivedAddPayload(builder, payload): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(payload), 0)
89 | def EventReceivedStartPayloadVector(builder, numElems): return builder.StartVector(1, numElems, 1)
90 | def EventReceivedAddEncAlgo(builder, encAlgo): builder.PrependUint8Slot(2, encAlgo, 0)
91 | def EventReceivedAddEncSerializer(builder, encSerializer): builder.PrependUint8Slot(3, encSerializer, 0)
92 | def EventReceivedAddEncKey(builder, encKey): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(encKey), 0)
93 | def EventReceivedStartEncKeyVector(builder, numElems): return builder.StartVector(1, numElems, 1)
94 | def EventReceivedEnd(builder): return builder.EndObject()
95 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Goodbye.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Goodbye(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsGoodbye(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Goodbye()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Goodbye
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Goodbye
22 | def Reason(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.String(o + self._tab.Pos)
26 | return None
27 |
28 | # Goodbye
29 | def Message(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | # Goodbye
36 | def Resumable(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
40 | return False
41 |
42 | def GoodbyeStart(builder): builder.StartObject(3)
43 | def GoodbyeAddReason(builder, reason): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(reason), 0)
44 | def GoodbyeAddMessage(builder, message): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(message), 0)
45 | def GoodbyeAddResumable(builder, resumable): builder.PrependBoolSlot(2, resumable, 0)
46 | def GoodbyeEnd(builder): return builder.EndObject()
47 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Hello.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Hello(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsHello(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Hello()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Hello
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Hello
22 | def Roles(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | x = self._tab.Indirect(o + self._tab.Pos)
26 | from .ClientRoles import ClientRoles
27 | obj = ClientRoles()
28 | obj.Init(self._tab.Bytes, x)
29 | return obj
30 | return None
31 |
32 | # Hello
33 | def Realm(self):
34 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
35 | if o != 0:
36 | return self._tab.String(o + self._tab.Pos)
37 | return None
38 |
39 | # Hello
40 | def Authmethods(self, j):
41 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
42 | if o != 0:
43 | a = self._tab.Vector(o)
44 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
45 | return 0
46 |
47 | # Hello
48 | def AuthmethodsAsNumpy(self):
49 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
50 | if o != 0:
51 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
52 | return 0
53 |
54 | # Hello
55 | def AuthmethodsLength(self):
56 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
57 | if o != 0:
58 | return self._tab.VectorLen(o)
59 | return 0
60 |
61 | # Hello
62 | def Authid(self):
63 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
64 | if o != 0:
65 | return self._tab.String(o + self._tab.Pos)
66 | return None
67 |
68 | # Hello
69 | def Authrole(self):
70 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
71 | if o != 0:
72 | return self._tab.String(o + self._tab.Pos)
73 | return None
74 |
75 | # Hello
76 | def Authextra(self):
77 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
78 | if o != 0:
79 | x = self._tab.Indirect(o + self._tab.Pos)
80 | from .Map import Map
81 | obj = Map()
82 | obj.Init(self._tab.Bytes, x)
83 | return obj
84 | return None
85 |
86 | # Hello
87 | def Resumable(self):
88 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
89 | if o != 0:
90 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
91 | return False
92 |
93 | # Hello
94 | def ResumeSession(self):
95 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
96 | if o != 0:
97 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
98 | return 0
99 |
100 | # Hello
101 | def ResumeToken(self):
102 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
103 | if o != 0:
104 | return self._tab.String(o + self._tab.Pos)
105 | return None
106 |
107 | def HelloStart(builder): builder.StartObject(9)
108 | def HelloAddRoles(builder, roles): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(roles), 0)
109 | def HelloAddRealm(builder, realm): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(realm), 0)
110 | def HelloAddAuthmethods(builder, authmethods): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(authmethods), 0)
111 | def HelloStartAuthmethodsVector(builder, numElems): return builder.StartVector(1, numElems, 1)
112 | def HelloAddAuthid(builder, authid): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(authid), 0)
113 | def HelloAddAuthrole(builder, authrole): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(authrole), 0)
114 | def HelloAddAuthextra(builder, authextra): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(authextra), 0)
115 | def HelloAddResumable(builder, resumable): builder.PrependBoolSlot(6, resumable, 0)
116 | def HelloAddResumeSession(builder, resumeSession): builder.PrependUint64Slot(7, resumeSession, 0)
117 | def HelloAddResumeToken(builder, resumeToken): builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(resumeToken), 0)
118 | def HelloEnd(builder): return builder.EndObject()
119 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Interrupt.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Interrupt(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsInterrupt(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Interrupt()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Interrupt
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Interrupt
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Interrupt
29 | def Mode(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
33 | return 1
34 |
35 | def InterruptStart(builder): builder.StartObject(2)
36 | def InterruptAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
37 | def InterruptAddMode(builder, mode): builder.PrependUint8Slot(1, mode, 1)
38 | def InterruptEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/InvocationPolicy.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class InvocationPolicy(object):
6 | SINGLE = 0
7 | FIRST = 1
8 | LAST = 2
9 | ROUNDROBIN = 3
10 | RANDOM = 4
11 |
12 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Kdf.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class Kdf(object):
6 | NONE = 0
7 | PBKDF2 = 1
8 | ARGON2 = 2
9 |
10 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Match.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class Match(object):
6 | EXACT = 0
7 | PREFIX = 1
8 | WILDCARD = 2
9 |
10 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Message.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Message(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsMessage(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Message()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Message
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Message
22 | def MsgType(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Message
29 | def Msg(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | from flatbuffers.table import Table
33 | obj = Table(bytearray(), 0)
34 | self._tab.Union(obj, o)
35 | return obj
36 | return None
37 |
38 | def MessageStart(builder): builder.StartObject(2)
39 | def MessageAddMsgType(builder, msgType): builder.PrependUint8Slot(0, msgType, 0)
40 | def MessageAddMsg(builder, msg): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(msg), 0)
41 | def MessageEnd(builder): return builder.EndObject()
42 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/MessageType.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class MessageType(object):
6 | NULL = 0
7 | HELLO = 1
8 | WELCOME = 2
9 | ABORT = 3
10 | CHALLENGE = 4
11 | AUTHENTICATE = 5
12 | GOODBYE = 6
13 | ERROR = 8
14 | PUBLISH = 16
15 | PUBLISHED = 17
16 | SUBSCRIBER_RECEIVED = 18
17 | SUBSCRIBE = 32
18 | SUBSCRIBED = 33
19 | UNSUBSCRIBE = 34
20 | UNSUBSCRIBED = 35
21 | EVENT = 36
22 | EVENT_RECEIVED = 37
23 | CALL = 48
24 | CANCEL = 49
25 | RESULT = 50
26 | REGISTER = 64
27 | REGISTERED = 65
28 | UNREGISTER = 66
29 | UNREGISTERED = 67
30 | INVOCATION = 68
31 | INTERRUPT = 69
32 | YIELD = 70
33 |
34 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Payload.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class Payload(object):
6 | PLAIN = 0
7 | CRYPTOBOX = 1
8 | OPAQUE = 2
9 |
10 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Principal.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Principal(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsPrincipal(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Principal()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Principal
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Principal
22 | def Session(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Principal
29 | def Authid(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | # Principal
36 | def Authrole(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return self._tab.String(o + self._tab.Pos)
40 | return None
41 |
42 | def PrincipalStart(builder): builder.StartObject(3)
43 | def PrincipalAddSession(builder, session): builder.PrependUint64Slot(0, session, 0)
44 | def PrincipalAddAuthid(builder, authid): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(authid), 0)
45 | def PrincipalAddAuthrole(builder, authrole): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(authrole), 0)
46 | def PrincipalEnd(builder): return builder.EndObject()
47 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Published.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Published(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsPublished(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Published()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Published
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Published
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Published
29 | def Publication(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | def PublishedStart(builder): builder.StartObject(2)
36 | def PublishedAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
37 | def PublishedAddPublication(builder, publication): builder.PrependUint64Slot(1, publication, 0)
38 | def PublishedEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/PublisherFeatures.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class PublisherFeatures(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsPublisherFeatures(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = PublisherFeatures()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # PublisherFeatures
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # PublisherFeatures
22 | def PublisherIdentification(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
26 | return False
27 |
28 | # PublisherFeatures
29 | def PublisherExclusion(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
33 | return False
34 |
35 | # PublisherFeatures
36 | def SubscriberBlackwhiteListing(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
40 | return False
41 |
42 | # PublisherFeatures
43 | def AcknowledgeEventReceived(self):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
47 | return False
48 |
49 | # PublisherFeatures
50 | def PayloadTransparency(self):
51 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
52 | if o != 0:
53 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
54 | return False
55 |
56 | # PublisherFeatures
57 | def PayloadEncryptionCryptobox(self):
58 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
59 | if o != 0:
60 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
61 | return False
62 |
63 | def PublisherFeaturesStart(builder): builder.StartObject(6)
64 | def PublisherFeaturesAddPublisherIdentification(builder, publisherIdentification): builder.PrependBoolSlot(0, publisherIdentification, 0)
65 | def PublisherFeaturesAddPublisherExclusion(builder, publisherExclusion): builder.PrependBoolSlot(1, publisherExclusion, 0)
66 | def PublisherFeaturesAddSubscriberBlackwhiteListing(builder, subscriberBlackwhiteListing): builder.PrependBoolSlot(2, subscriberBlackwhiteListing, 0)
67 | def PublisherFeaturesAddAcknowledgeEventReceived(builder, acknowledgeEventReceived): builder.PrependBoolSlot(3, acknowledgeEventReceived, 0)
68 | def PublisherFeaturesAddPayloadTransparency(builder, payloadTransparency): builder.PrependBoolSlot(4, payloadTransparency, 0)
69 | def PublisherFeaturesAddPayloadEncryptionCryptobox(builder, payloadEncryptionCryptobox): builder.PrependBoolSlot(5, payloadEncryptionCryptobox, 0)
70 | def PublisherFeaturesEnd(builder): return builder.EndObject()
71 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Register.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Register(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsRegister(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Register()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Register
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Register
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Register
29 | def Procedure(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | # Register
36 | def Match(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
40 | return 0
41 |
42 | # Register
43 | def Invoke(self):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
47 | return 0
48 |
49 | # Register
50 | def Concurrency(self):
51 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
52 | if o != 0:
53 | return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
54 | return 0
55 |
56 | # Register
57 | def ForceReregister(self):
58 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
59 | if o != 0:
60 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
61 | return False
62 |
63 | def RegisterStart(builder): builder.StartObject(6)
64 | def RegisterAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
65 | def RegisterAddProcedure(builder, procedure): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(procedure), 0)
66 | def RegisterAddMatch(builder, match): builder.PrependUint8Slot(2, match, 0)
67 | def RegisterAddInvoke(builder, invoke): builder.PrependUint8Slot(3, invoke, 0)
68 | def RegisterAddConcurrency(builder, concurrency): builder.PrependUint16Slot(4, concurrency, 0)
69 | def RegisterAddForceReregister(builder, forceReregister): builder.PrependBoolSlot(5, forceReregister, 0)
70 | def RegisterEnd(builder): return builder.EndObject()
71 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Registered.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Registered(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsRegistered(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Registered()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Registered
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Registered
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Registered
29 | def Registration(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | def RegisteredStart(builder): builder.StartObject(2)
36 | def RegisteredAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
37 | def RegisteredAddRegistration(builder, registration): builder.PrependUint64Slot(1, registration, 0)
38 | def RegisteredEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Result.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Result(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsResult(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Result()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Result
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Result
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Result
29 | def Payload(self, j):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | a = self._tab.Vector(o)
33 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
34 | return 0
35 |
36 | # Result
37 | def PayloadAsNumpy(self):
38 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
39 | if o != 0:
40 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
41 | return 0
42 |
43 | # Result
44 | def PayloadLength(self):
45 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
46 | if o != 0:
47 | return self._tab.VectorLen(o)
48 | return 0
49 |
50 | # Result
51 | def EncAlgo(self):
52 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
53 | if o != 0:
54 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
55 | return 0
56 |
57 | # Result
58 | def EncSerializer(self):
59 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
60 | if o != 0:
61 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
62 | return 0
63 |
64 | # Result
65 | def EncKey(self, j):
66 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
67 | if o != 0:
68 | a = self._tab.Vector(o)
69 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
70 | return 0
71 |
72 | # Result
73 | def EncKeyAsNumpy(self):
74 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
75 | if o != 0:
76 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
77 | return 0
78 |
79 | # Result
80 | def EncKeyLength(self):
81 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
82 | if o != 0:
83 | return self._tab.VectorLen(o)
84 | return 0
85 |
86 | # Result
87 | def Progress(self):
88 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
89 | if o != 0:
90 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
91 | return False
92 |
93 | def ResultStart(builder): builder.StartObject(6)
94 | def ResultAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
95 | def ResultAddPayload(builder, payload): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(payload), 0)
96 | def ResultStartPayloadVector(builder, numElems): return builder.StartVector(1, numElems, 1)
97 | def ResultAddEncAlgo(builder, encAlgo): builder.PrependUint8Slot(2, encAlgo, 0)
98 | def ResultAddEncSerializer(builder, encSerializer): builder.PrependUint8Slot(3, encSerializer, 0)
99 | def ResultAddEncKey(builder, encKey): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(encKey), 0)
100 | def ResultStartEncKeyVector(builder, numElems): return builder.StartVector(1, numElems, 1)
101 | def ResultAddProgress(builder, progress): builder.PrependBoolSlot(5, progress, 0)
102 | def ResultEnd(builder): return builder.EndObject()
103 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/RouterRoles.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class RouterRoles(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsRouterRoles(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = RouterRoles()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # RouterRoles
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # RouterRoles
22 | def Broker(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | x = self._tab.Indirect(o + self._tab.Pos)
26 | from .BrokerFeatures import BrokerFeatures
27 | obj = BrokerFeatures()
28 | obj.Init(self._tab.Bytes, x)
29 | return obj
30 | return None
31 |
32 | # RouterRoles
33 | def Dealer(self):
34 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
35 | if o != 0:
36 | x = self._tab.Indirect(o + self._tab.Pos)
37 | from .DealerFeatures import DealerFeatures
38 | obj = DealerFeatures()
39 | obj.Init(self._tab.Bytes, x)
40 | return obj
41 | return None
42 |
43 | def RouterRolesStart(builder): builder.StartObject(2)
44 | def RouterRolesAddBroker(builder, broker): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(broker), 0)
45 | def RouterRolesAddDealer(builder, dealer): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(dealer), 0)
46 | def RouterRolesEnd(builder): return builder.EndObject()
47 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Serializer.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | class Serializer(object):
6 | TRANSPORT = 0
7 | JSON = 1
8 | MSGPACK = 2
9 | CBOR = 3
10 | UBJSON = 4
11 | OPAQUE = 5
12 | FLATBUFFERS = 6
13 |
14 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Subscribe.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Subscribe(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsSubscribe(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Subscribe()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Subscribe
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Subscribe
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Subscribe
29 | def Topic(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.String(o + self._tab.Pos)
33 | return None
34 |
35 | # Subscribe
36 | def Match(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
40 | return 0
41 |
42 | # Subscribe
43 | def GetRetained(self):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
47 | return False
48 |
49 | def SubscribeStart(builder): builder.StartObject(4)
50 | def SubscribeAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
51 | def SubscribeAddTopic(builder, topic): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(topic), 0)
52 | def SubscribeAddMatch(builder, match): builder.PrependUint8Slot(2, match, 0)
53 | def SubscribeAddGetRetained(builder, getRetained): builder.PrependBoolSlot(3, getRetained, 0)
54 | def SubscribeEnd(builder): return builder.EndObject()
55 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Subscribed.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Subscribed(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsSubscribed(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Subscribed()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Subscribed
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Subscribed
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Subscribed
29 | def Subscription(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | def SubscribedStart(builder): builder.StartObject(2)
36 | def SubscribedAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
37 | def SubscribedAddSubscription(builder, subscription): builder.PrependUint64Slot(1, subscription, 0)
38 | def SubscribedEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/SubscriberFeatures.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class SubscriberFeatures(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsSubscriberFeatures(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = SubscriberFeatures()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # SubscriberFeatures
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # SubscriberFeatures
22 | def PublisherIdentification(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
26 | return False
27 |
28 | # SubscriberFeatures
29 | def PatternBasedSubscription(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
33 | return False
34 |
35 | # SubscriberFeatures
36 | def PublicationTrustlevels(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
40 | return False
41 |
42 | # SubscriberFeatures
43 | def SubscriptionRevocation(self):
44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
45 | if o != 0:
46 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
47 | return False
48 |
49 | # SubscriberFeatures
50 | def EventHistory(self):
51 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
52 | if o != 0:
53 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
54 | return False
55 |
56 | # SubscriberFeatures
57 | def AcknowledgeSubscriberReceived(self):
58 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
59 | if o != 0:
60 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
61 | return False
62 |
63 | # SubscriberFeatures
64 | def PayloadTransparency(self):
65 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
66 | if o != 0:
67 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
68 | return False
69 |
70 | # SubscriberFeatures
71 | def PayloadEncryptionCryptobox(self):
72 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
73 | if o != 0:
74 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
75 | return False
76 |
77 | def SubscriberFeaturesStart(builder): builder.StartObject(8)
78 | def SubscriberFeaturesAddPublisherIdentification(builder, publisherIdentification): builder.PrependBoolSlot(0, publisherIdentification, 0)
79 | def SubscriberFeaturesAddPatternBasedSubscription(builder, patternBasedSubscription): builder.PrependBoolSlot(1, patternBasedSubscription, 0)
80 | def SubscriberFeaturesAddPublicationTrustlevels(builder, publicationTrustlevels): builder.PrependBoolSlot(2, publicationTrustlevels, 0)
81 | def SubscriberFeaturesAddSubscriptionRevocation(builder, subscriptionRevocation): builder.PrependBoolSlot(3, subscriptionRevocation, 0)
82 | def SubscriberFeaturesAddEventHistory(builder, eventHistory): builder.PrependBoolSlot(4, eventHistory, 0)
83 | def SubscriberFeaturesAddAcknowledgeSubscriberReceived(builder, acknowledgeSubscriberReceived): builder.PrependBoolSlot(5, acknowledgeSubscriberReceived, 0)
84 | def SubscriberFeaturesAddPayloadTransparency(builder, payloadTransparency): builder.PrependBoolSlot(6, payloadTransparency, 0)
85 | def SubscriberFeaturesAddPayloadEncryptionCryptobox(builder, payloadEncryptionCryptobox): builder.PrependBoolSlot(7, payloadEncryptionCryptobox, 0)
86 | def SubscriberFeaturesEnd(builder): return builder.EndObject()
87 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Unregister.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Unregister(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsUnregister(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Unregister()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Unregister
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Unregister
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Unregister
29 | def Registration(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | def UnregisterStart(builder): builder.StartObject(2)
36 | def UnregisterAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
37 | def UnregisterAddRegistration(builder, registration): builder.PrependUint64Slot(1, registration, 0)
38 | def UnregisterEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Unregistered.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Unregistered(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsUnregistered(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Unregistered()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Unregistered
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Unregistered
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Unregistered
29 | def Registration(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | # Unregistered
36 | def Reason(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return self._tab.String(o + self._tab.Pos)
40 | return None
41 |
42 | def UnregisteredStart(builder): builder.StartObject(3)
43 | def UnregisteredAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
44 | def UnregisteredAddRegistration(builder, registration): builder.PrependUint64Slot(1, registration, 0)
45 | def UnregisteredAddReason(builder, reason): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(reason), 0)
46 | def UnregisteredEnd(builder): return builder.EndObject()
47 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Unsubscribe.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Unsubscribe(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsUnsubscribe(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Unsubscribe()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Unsubscribe
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Unsubscribe
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Unsubscribe
29 | def Subscription(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | def UnsubscribeStart(builder): builder.StartObject(2)
36 | def UnsubscribeAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
37 | def UnsubscribeAddSubscription(builder, subscription): builder.PrependUint64Slot(1, subscription, 0)
38 | def UnsubscribeEnd(builder): return builder.EndObject()
39 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Unsubscribed.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Unsubscribed(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsUnsubscribed(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Unsubscribed()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Unsubscribed
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Unsubscribed
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Unsubscribed
29 | def Subscription(self):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
33 | return 0
34 |
35 | # Unsubscribed
36 | def Reason(self):
37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
38 | if o != 0:
39 | return self._tab.String(o + self._tab.Pos)
40 | return None
41 |
42 | def UnsubscribedStart(builder): builder.StartObject(3)
43 | def UnsubscribedAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
44 | def UnsubscribedAddSubscription(builder, subscription): builder.PrependUint64Slot(1, subscription, 0)
45 | def UnsubscribedAddReason(builder, reason): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(reason), 0)
46 | def UnsubscribedEnd(builder): return builder.EndObject()
47 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Welcome.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Welcome(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsWelcome(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Welcome()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Welcome
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Welcome
22 | def Roles(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | x = self._tab.Indirect(o + self._tab.Pos)
26 | from .RouterRoles import RouterRoles
27 | obj = RouterRoles()
28 | obj.Init(self._tab.Bytes, x)
29 | return obj
30 | return None
31 |
32 | # Welcome
33 | def Session(self):
34 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
35 | if o != 0:
36 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
37 | return 0
38 |
39 | # Welcome
40 | def Realm(self):
41 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
42 | if o != 0:
43 | return self._tab.String(o + self._tab.Pos)
44 | return None
45 |
46 | # Welcome
47 | def Authid(self):
48 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
49 | if o != 0:
50 | return self._tab.String(o + self._tab.Pos)
51 | return None
52 |
53 | # Welcome
54 | def Authrole(self):
55 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
56 | if o != 0:
57 | return self._tab.String(o + self._tab.Pos)
58 | return None
59 |
60 | # Welcome
61 | def Authmethod(self):
62 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
63 | if o != 0:
64 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
65 | return 0
66 |
67 | # Welcome
68 | def Authprovider(self):
69 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
70 | if o != 0:
71 | return self._tab.String(o + self._tab.Pos)
72 | return None
73 |
74 | # Welcome
75 | def Authextra(self):
76 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
77 | if o != 0:
78 | x = self._tab.Indirect(o + self._tab.Pos)
79 | from .Map import Map
80 | obj = Map()
81 | obj.Init(self._tab.Bytes, x)
82 | return obj
83 | return None
84 |
85 | # Welcome
86 | def Resumed(self):
87 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
88 | if o != 0:
89 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
90 | return False
91 |
92 | # Welcome
93 | def Resumable(self):
94 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
95 | if o != 0:
96 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
97 | return False
98 |
99 | # Welcome
100 | def ResumeToken(self):
101 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
102 | if o != 0:
103 | return self._tab.String(o + self._tab.Pos)
104 | return None
105 |
106 | def WelcomeStart(builder): builder.StartObject(11)
107 | def WelcomeAddRoles(builder, roles): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(roles), 0)
108 | def WelcomeAddSession(builder, session): builder.PrependUint64Slot(1, session, 0)
109 | def WelcomeAddRealm(builder, realm): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(realm), 0)
110 | def WelcomeAddAuthid(builder, authid): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(authid), 0)
111 | def WelcomeAddAuthrole(builder, authrole): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(authrole), 0)
112 | def WelcomeAddAuthmethod(builder, authmethod): builder.PrependUint8Slot(5, authmethod, 0)
113 | def WelcomeAddAuthprovider(builder, authprovider): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(authprovider), 0)
114 | def WelcomeAddAuthextra(builder, authextra): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(authextra), 0)
115 | def WelcomeAddResumed(builder, resumed): builder.PrependBoolSlot(8, resumed, 0)
116 | def WelcomeAddResumable(builder, resumable): builder.PrependBoolSlot(9, resumable, 0)
117 | def WelcomeAddResumeToken(builder, resumeToken): builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(resumeToken), 0)
118 | def WelcomeEnd(builder): return builder.EndObject()
119 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/Yield.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: proto
4 |
5 | import flatbuffers
6 |
7 | class Yield(object):
8 | __slots__ = ['_tab']
9 |
10 | @classmethod
11 | def GetRootAsYield(cls, buf, offset):
12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 | x = Yield()
14 | x.Init(buf, n + offset)
15 | return x
16 |
17 | # Yield
18 | def Init(self, buf, pos):
19 | self._tab = flatbuffers.table.Table(buf, pos)
20 |
21 | # Yield
22 | def Request(self):
23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 | if o != 0:
25 | return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
26 | return 0
27 |
28 | # Yield
29 | def Payload(self, j):
30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
31 | if o != 0:
32 | a = self._tab.Vector(o)
33 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
34 | return 0
35 |
36 | # Yield
37 | def PayloadAsNumpy(self):
38 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
39 | if o != 0:
40 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
41 | return 0
42 |
43 | # Yield
44 | def PayloadLength(self):
45 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
46 | if o != 0:
47 | return self._tab.VectorLen(o)
48 | return 0
49 |
50 | # Yield
51 | def EncAlgo(self):
52 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
53 | if o != 0:
54 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
55 | return 0
56 |
57 | # Yield
58 | def EncSerializer(self):
59 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
60 | if o != 0:
61 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
62 | return 0
63 |
64 | # Yield
65 | def EncKey(self, j):
66 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
67 | if o != 0:
68 | a = self._tab.Vector(o)
69 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
70 | return 0
71 |
72 | # Yield
73 | def EncKeyAsNumpy(self):
74 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
75 | if o != 0:
76 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
77 | return 0
78 |
79 | # Yield
80 | def EncKeyLength(self):
81 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
82 | if o != 0:
83 | return self._tab.VectorLen(o)
84 | return 0
85 |
86 | def YieldStart(builder): builder.StartObject(5)
87 | def YieldAddRequest(builder, request): builder.PrependUint64Slot(0, request, 0)
88 | def YieldAddPayload(builder, payload): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(payload), 0)
89 | def YieldStartPayloadVector(builder, numElems): return builder.StartVector(1, numElems, 1)
90 | def YieldAddEncAlgo(builder, encAlgo): builder.PrependUint8Slot(2, encAlgo, 0)
91 | def YieldAddEncSerializer(builder, encSerializer): builder.PrependUint8Slot(3, encSerializer, 0)
92 | def YieldAddEncKey(builder, encKey): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(encKey), 0)
93 | def YieldStartEncKeyVector(builder, numElems): return builder.StartVector(1, numElems, 1)
94 | def YieldEnd(builder): return builder.EndObject()
95 |
--------------------------------------------------------------------------------
/autobahn/wamp/gen/wamp/proto/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/wamp/gen/wamp/proto/__init__.py
--------------------------------------------------------------------------------
/autobahn/wamp/message_fbs.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | import flatbuffers
30 | from autobahn.wamp.gen.wamp.proto import Event as EventGen
31 | from autobahn.wamp.gen.wamp.proto import Publish as PublishGen
32 |
33 | from autobahn.wamp.gen.wamp.proto import Message
34 | from autobahn.wamp.gen.wamp.proto.MessageType import MessageType
35 |
36 | __all__ = (
37 | 'Event',
38 | 'Message',
39 | 'MessageType',
40 | )
41 |
42 |
43 | class Event(EventGen.Event):
44 |
45 | @classmethod
46 | def GetRootAsEvent(cls, buf, offset):
47 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
48 | x = Event()
49 | x.Init(buf, n + offset)
50 | return x
51 |
52 | def Init(self, buf, pos):
53 | self._tab = flatbuffers.table.Table(buf, pos)
54 |
55 | def ArgsAsBytes(self):
56 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
57 | if o != 0:
58 | _off = self._tab.Vector(o)
59 | _len = self._tab.VectorLen(o)
60 | return memoryview(self._tab.Bytes)[_off:_off+_len]
61 | return None
62 |
63 | def KwargsAsBytes(self):
64 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
65 | if o != 0:
66 | _off = self._tab.Vector(o)
67 | _len = self._tab.VectorLen(o)
68 | return memoryview(self._tab.Bytes)[_off:_off+_len]
69 | return None
70 |
71 | def PayloadAsBytes(self):
72 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
73 | if o != 0:
74 | _off = self._tab.Vector(o)
75 | _len = self._tab.VectorLen(o)
76 | return memoryview(self._tab.Bytes)[_off:_off+_len]
77 | return None
78 |
79 | def EncKeyAsBytes(self):
80 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
81 | if o != 0:
82 | _off = self._tab.Vector(o)
83 | _len = self._tab.VectorLen(o)
84 | return memoryview(self._tab.Bytes)[_off:_off+_len]
85 | return None
86 |
87 |
88 | class Publish(PublishGen.Publish):
89 |
90 | @classmethod
91 | def GetRootAsEvent(cls, buf, offset):
92 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
93 | x = Event()
94 | x.Init(buf, n + offset)
95 | return x
96 |
97 | def Init(self, buf, pos):
98 | self._tab = flatbuffers.table.Table(buf, pos)
99 |
100 | def ArgsAsBytes(self):
101 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
102 | if o != 0:
103 | _off = self._tab.Vector(o)
104 | _len = self._tab.VectorLen(o)
105 | return memoryview(self._tab.Bytes)[_off:_off+_len]
106 | return None
107 |
108 | def KwargsAsBytes(self):
109 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
110 | if o != 0:
111 | _off = self._tab.Vector(o)
112 | _len = self._tab.VectorLen(o)
113 | return memoryview(self._tab.Bytes)[_off:_off+_len]
114 | return None
115 |
116 | def PayloadAsBytes(self):
117 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
118 | if o != 0:
119 | _off = self._tab.Vector(o)
120 | _len = self._tab.VectorLen(o)
121 | return memoryview(self._tab.Bytes)[_off:_off+_len]
122 | return None
123 |
124 | def EncKeyAsBytes(self):
125 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
126 | if o != 0:
127 | _off = self._tab.Vector(o)
128 | _len = self._tab.VectorLen(o)
129 | return memoryview(self._tab.Bytes)[_off:_off+_len]
130 | return None
131 |
132 |
--------------------------------------------------------------------------------
/autobahn/wamp/test/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
--------------------------------------------------------------------------------
/autobahn/wamp/test/test_cryptobox.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | from autobahn.wamp import cryptobox
30 |
31 | import unittest
32 |
33 |
34 | @unittest.skipIf(not cryptobox.HAS_CRYPTOBOX, 'no cryptobox support present')
35 | class TestCryptoBox(unittest.TestCase):
36 |
37 | def test_create_keyring(self):
38 | kr = cryptobox.KeyRing()
39 | assert kr
40 |
--------------------------------------------------------------------------------
/autobahn/wamp/test/test_exception.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from unittest import TestCase
28 | from six import PY3
29 |
30 | from autobahn.wamp.exception import ApplicationError
31 |
32 |
33 | class ApplicationErrorTestCase(TestCase):
34 |
35 | def test_unicode_str(self):
36 | """
37 | Unicode arguments in ApplicationError will not raise an exception when
38 | str()'d.
39 | """
40 | error = ApplicationError(u"some.url", u"\u2603")
41 | if PY3:
42 | self.assertIn(u"\u2603", str(error))
43 | else:
44 | self.assertIn("\\u2603", str(error))
45 |
46 | def test_unicode_errormessage(self):
47 | """
48 | Unicode arguments in ApplicationError will not raise an exception when
49 | the error_message method is called.
50 | """
51 | error = ApplicationError(u"some.url", u"\u2603")
52 | if PY3:
53 | # on py27-tw189: exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u2603' in position 10: ordinal not in
54 | print(error.error_message())
55 | self.assertIn(u"\u2603", error.error_message())
56 |
--------------------------------------------------------------------------------
/autobahn/wamp/test/test_protocol_peer.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 | import os
29 |
30 | # we need to select a txaio subsystem because we're importing the base
31 | # protocol classes here for testing purposes. "normally" you'd import
32 | # from autobahn.twisted.wamp or autobahn.asyncio.wamp explicitly.
33 | import txaio
34 | if os.environ.get('USE_TWISTED', False):
35 | txaio.use_twisted()
36 | else:
37 | txaio.use_asyncio()
38 |
39 | from autobahn import wamp
40 | from autobahn.wamp import message
41 | from autobahn.wamp import exception
42 | from autobahn.wamp import protocol
43 |
44 | import unittest
45 |
46 |
47 | class TestPeerExceptions(unittest.TestCase):
48 |
49 | def test_exception_from_message(self):
50 | session = protocol.BaseSession()
51 |
52 | @wamp.error(u"com.myapp.error1")
53 | class AppError1(Exception):
54 | pass
55 |
56 | @wamp.error(u"com.myapp.error2")
57 | class AppError2(Exception):
58 | pass
59 |
60 | session.define(AppError1)
61 | session.define(AppError2)
62 |
63 | # map defined errors to user exceptions
64 | emsg = message.Error(message.Call.MESSAGE_TYPE, 123456, u'com.myapp.error1')
65 | exc = session._exception_from_message(emsg)
66 | self.assertIsInstance(exc, AppError1)
67 | self.assertEqual(exc.args, ())
68 |
69 | emsg = message.Error(message.Call.MESSAGE_TYPE, 123456, u'com.myapp.error2')
70 | exc = session._exception_from_message(emsg)
71 | self.assertIsInstance(exc, AppError2)
72 | self.assertEqual(exc.args, ())
73 |
74 | # map undefined error to (generic) exception
75 | emsg = message.Error(message.Call.MESSAGE_TYPE, 123456, u'com.myapp.error3')
76 | exc = session._exception_from_message(emsg)
77 | self.assertIsInstance(exc, exception.ApplicationError)
78 | self.assertEqual(exc.error, u'com.myapp.error3')
79 | self.assertEqual(exc.args, ())
80 | self.assertEqual(exc.kwargs, {})
81 |
82 | emsg = message.Error(message.Call.MESSAGE_TYPE, 123456, u'com.myapp.error3', args=[1, 2, u'hello'])
83 | exc = session._exception_from_message(emsg)
84 | self.assertIsInstance(exc, exception.ApplicationError)
85 | self.assertEqual(exc.error, u'com.myapp.error3')
86 | self.assertEqual(exc.args, (1, 2, u'hello'))
87 | self.assertEqual(exc.kwargs, {})
88 |
89 | emsg = message.Error(message.Call.MESSAGE_TYPE, 123456, u'com.myapp.error3', args=[1, 2, u'hello'], kwargs={u'foo': 23, u'bar': u'baz'})
90 | exc = session._exception_from_message(emsg)
91 | self.assertIsInstance(exc, exception.ApplicationError)
92 | self.assertEqual(exc.error, u'com.myapp.error3')
93 | self.assertEqual(exc.args, (1, 2, u'hello'))
94 | self.assertEqual(exc.kwargs, {u'foo': 23, u'bar': u'baz'})
95 |
96 | def test_message_from_exception(self):
97 | session = protocol.BaseSession()
98 |
99 | @wamp.error(u"com.myapp.error1")
100 | class AppError1(Exception):
101 | pass
102 |
103 | @wamp.error(u"com.myapp.error2")
104 | class AppError2(Exception):
105 | pass
106 |
107 | session.define(AppError1)
108 | session.define(AppError2)
109 |
110 | exc = AppError1()
111 | msg = session._message_from_exception(message.Call.MESSAGE_TYPE, 123456, exc)
112 |
113 | self.assertEqual(msg.marshal(), [message.Error.MESSAGE_TYPE, message.Call.MESSAGE_TYPE, 123456, {}, "com.myapp.error1"])
114 |
--------------------------------------------------------------------------------
/autobahn/wamp/test/test_websocket.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | import os
30 |
31 | if os.environ.get('USE_TWISTED', False):
32 | from twisted.trial import unittest
33 |
34 | from autobahn.wamp.websocket import WampWebSocketProtocol
35 |
36 | class TestWebsocketProtocol(unittest.TestCase):
37 | def setUp(self):
38 | self.protocol = WampWebSocketProtocol()
39 |
40 | def test_close_before_open(self):
41 | # just checking this doesn't throw an exception...
42 | self.protocol.onClose(True, 1, "just testing")
43 |
--------------------------------------------------------------------------------
/autobahn/websocket/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 |
28 | from __future__ import absolute_import
29 |
30 | from autobahn.websocket.types import ConnectionRequest, ConnectionResponse, \
31 | ConnectionAccept, ConnectionDeny, Message, IncomingMessage, OutgoingMessage
32 | from autobahn.websocket.interfaces import IWebSocketChannel
33 |
34 | __all__ = (
35 | 'IWebSocketChannel',
36 | 'Message',
37 | 'IncomingMessage',
38 | 'OutgoingMessage',
39 | 'ConnectionRequest',
40 | 'ConnectionResponse',
41 | 'ConnectionAccept',
42 | 'ConnectionDeny',
43 | )
44 |
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/compress.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/compress.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/compress_base.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/compress_base.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/compress_bzip2.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/compress_bzip2.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/compress_deflate.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/compress_deflate.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/interfaces.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/interfaces.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/protocol.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/protocol.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/types.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/types.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/utf8validator.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/utf8validator.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/util.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/util.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/__pycache__/xormasker.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/autobahn/websocket/__pycache__/xormasker.cpython-36.pyc
--------------------------------------------------------------------------------
/autobahn/websocket/compress.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | from __future__ import absolute_import
28 |
29 | from autobahn.websocket.compress_base import \
30 | PerMessageCompressOffer, \
31 | PerMessageCompressOfferAccept, \
32 | PerMessageCompressResponse, \
33 | PerMessageCompressResponseAccept, \
34 | PerMessageCompress
35 |
36 | from autobahn.websocket.compress_deflate import \
37 | PerMessageDeflateMixin, \
38 | PerMessageDeflateOffer, \
39 | PerMessageDeflateOfferAccept, \
40 | PerMessageDeflateResponse, \
41 | PerMessageDeflateResponseAccept, \
42 | PerMessageDeflate
43 |
44 | # this must be a list (not tuple), since we dynamically
45 | # extend it ..
46 | __all__ = [
47 | 'PerMessageCompressOffer',
48 | 'PerMessageCompressOfferAccept',
49 | 'PerMessageCompressResponse',
50 | 'PerMessageCompressResponseAccept',
51 | 'PerMessageCompress',
52 | 'PerMessageDeflateOffer',
53 | 'PerMessageDeflateOfferAccept',
54 | 'PerMessageDeflateResponse',
55 | 'PerMessageDeflateResponseAccept',
56 | 'PerMessageDeflate',
57 | 'PERMESSAGE_COMPRESSION_EXTENSION'
58 | ]
59 |
60 | # map of available compression extensions
61 | PERMESSAGE_COMPRESSION_EXTENSION = {
62 | # class for 'permessage-deflate' is always available
63 | PerMessageDeflateMixin.EXTENSION_NAME: {
64 | 'Offer': PerMessageDeflateOffer,
65 | 'OfferAccept': PerMessageDeflateOfferAccept,
66 | 'Response': PerMessageDeflateResponse,
67 | 'ResponseAccept': PerMessageDeflateResponseAccept,
68 | 'PMCE': PerMessageDeflate
69 | }
70 | }
71 |
72 |
73 | # include 'permessage-bzip2' classes if bzip2 is available
74 | try:
75 | import bz2
76 | except ImportError:
77 | bz2 = None
78 | else:
79 | from autobahn.websocket.compress_bzip2 import \
80 | PerMessageBzip2Mixin, \
81 | PerMessageBzip2Offer, \
82 | PerMessageBzip2OfferAccept, \
83 | PerMessageBzip2Response, \
84 | PerMessageBzip2ResponseAccept, \
85 | PerMessageBzip2
86 |
87 | PMCE = {
88 | 'Offer': PerMessageBzip2Offer,
89 | 'OfferAccept': PerMessageBzip2OfferAccept,
90 | 'Response': PerMessageBzip2Response,
91 | 'ResponseAccept': PerMessageBzip2ResponseAccept,
92 | 'PMCE': PerMessageBzip2
93 | }
94 | PERMESSAGE_COMPRESSION_EXTENSION[PerMessageBzip2Mixin.EXTENSION_NAME] = PMCE
95 |
96 | __all__.extend(['PerMessageBzip2Offer',
97 | 'PerMessageBzip2OfferAccept',
98 | 'PerMessageBzip2Response',
99 | 'PerMessageBzip2ResponseAccept',
100 | 'PerMessageBzip2'])
101 |
102 |
103 | # include 'permessage-snappy' classes if Snappy is available
104 | try:
105 | # noinspection PyPackageRequirements
106 | import snappy
107 | except ImportError:
108 | snappy = None
109 | else:
110 | from autobahn.websocket.compress_snappy import \
111 | PerMessageSnappyMixin, \
112 | PerMessageSnappyOffer, \
113 | PerMessageSnappyOfferAccept, \
114 | PerMessageSnappyResponse, \
115 | PerMessageSnappyResponseAccept, \
116 | PerMessageSnappy
117 |
118 | PMCE = {
119 | 'Offer': PerMessageSnappyOffer,
120 | 'OfferAccept': PerMessageSnappyOfferAccept,
121 | 'Response': PerMessageSnappyResponse,
122 | 'ResponseAccept': PerMessageSnappyResponseAccept,
123 | 'PMCE': PerMessageSnappy
124 | }
125 | PERMESSAGE_COMPRESSION_EXTENSION[PerMessageSnappyMixin.EXTENSION_NAME] = PMCE
126 |
127 | __all__.extend(['PerMessageSnappyOffer',
128 | 'PerMessageSnappyOfferAccept',
129 | 'PerMessageSnappyResponse',
130 | 'PerMessageSnappyResponseAccept',
131 | 'PerMessageSnappy'])
132 |
--------------------------------------------------------------------------------
/autobahn/websocket/compress_base.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | __all__ = (
28 | 'PerMessageCompressOffer',
29 | 'PerMessageCompressOfferAccept',
30 | 'PerMessageCompressResponse',
31 | 'PerMessageCompressResponseAccept',
32 | 'PerMessageCompress',
33 | )
34 |
35 |
36 | class PerMessageCompressOffer(object):
37 | """
38 | Base class for WebSocket compression parameter client offers.
39 | """
40 |
41 |
42 | class PerMessageCompressOfferAccept(object):
43 | """
44 | Base class for WebSocket compression parameter client offer accepts by the server.
45 | """
46 |
47 |
48 | class PerMessageCompressResponse(object):
49 | """
50 | Base class for WebSocket compression parameter server responses.
51 | """
52 |
53 |
54 | class PerMessageCompressResponseAccept(object):
55 | """
56 | Base class for WebSocket compression parameter server response accepts by client.
57 | """
58 |
59 |
60 | class PerMessageCompress(object):
61 | """
62 | Base class for WebSocket compression negotiated parameters.
63 | """
64 |
--------------------------------------------------------------------------------
/autobahn/websocket/test/__init__.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
--------------------------------------------------------------------------------
/autobahn/websocket/xormasker.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | #
3 | # The MIT License (MIT)
4 | #
5 | # Copyright (c) Crossbar.io Technologies GmbH
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in
15 | # all copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | # THE SOFTWARE.
24 | #
25 | ###############################################################################
26 |
27 | import six
28 |
29 | try:
30 | # use Cython implementation of XorMasker validator if available
31 |
32 | from wsaccel.xormask import XorMaskerNull
33 | # noinspection PyUnresolvedReferences
34 | from wsaccel.xormask import createXorMasker
35 | create_xor_masker = createXorMasker
36 |
37 | except ImportError:
38 |
39 | # fallback to pure Python implementation (this is faster on PyPy than above!)
40 |
41 | # http://stackoverflow.com/questions/15014310/python3-xrange-lack-hurts
42 | try:
43 | # noinspection PyUnresolvedReferences
44 | xrange
45 | except NameError:
46 | # Python 3
47 | # noinspection PyShadowingBuiltins
48 | xrange = range
49 |
50 | from array import array
51 |
52 | class XorMaskerNull(object):
53 |
54 | __slots__ = ('_ptr',)
55 |
56 | # noinspection PyUnusedLocal
57 | def __init__(self, mask=None):
58 | self._ptr = 0
59 |
60 | def pointer(self):
61 | return self._ptr
62 |
63 | def reset(self):
64 | self._ptr = 0
65 |
66 | def process(self, data):
67 | self._ptr += len(data)
68 | return data
69 |
70 | class XorMaskerSimple(object):
71 |
72 | __slots__ = ('_ptr', '_msk')
73 |
74 | def __init__(self, mask):
75 | assert len(mask) == 4
76 | self._ptr = 0
77 | self._msk = array('B', mask)
78 |
79 | def pointer(self):
80 | return self._ptr
81 |
82 | def reset(self):
83 | self._ptr = 0
84 |
85 | def process(self, data):
86 | dlen = len(data)
87 | payload = array('B', data)
88 | for k in xrange(dlen):
89 | payload[k] ^= self._msk[self._ptr & 3]
90 | self._ptr += 1
91 | if six.PY3:
92 | return payload.tobytes()
93 | else:
94 | return payload.tostring()
95 |
96 | class XorMaskerShifted1(object):
97 |
98 | __slots__ = ('_ptr', '_mskarray')
99 |
100 | def __init__(self, mask):
101 | assert len(mask) == 4
102 | self._ptr = 0
103 | self._mskarray = [array('B'), array('B'), array('B'), array('B')]
104 | if six.PY3:
105 | for j in xrange(4):
106 | self._mskarray[0].append(mask[j & 3])
107 | self._mskarray[1].append(mask[(j + 1) & 3])
108 | self._mskarray[2].append(mask[(j + 2) & 3])
109 | self._mskarray[3].append(mask[(j + 3) & 3])
110 | else:
111 | for j in xrange(4):
112 | self._mskarray[0].append(ord(mask[j & 3]))
113 | self._mskarray[1].append(ord(mask[(j + 1) & 3]))
114 | self._mskarray[2].append(ord(mask[(j + 2) & 3]))
115 | self._mskarray[3].append(ord(mask[(j + 3) & 3]))
116 |
117 | def pointer(self):
118 | return self._ptr
119 |
120 | def reset(self):
121 | self._ptr = 0
122 |
123 | def process(self, data):
124 | dlen = len(data)
125 | payload = array('B', data)
126 | msk = self._mskarray[self._ptr & 3]
127 | for k in xrange(dlen):
128 | payload[k] ^= msk[k & 3]
129 | self._ptr += dlen
130 | if six.PY3:
131 | return payload.tobytes()
132 | else:
133 | return payload.tostring()
134 |
135 | def create_xor_masker(mask, length=None):
136 | if length is None or length < 128:
137 | return XorMaskerSimple(mask)
138 | else:
139 | return XorMaskerShifted1(mask)
140 |
--------------------------------------------------------------------------------
/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/background.png
--------------------------------------------------------------------------------
/config.py:
--------------------------------------------------------------------------------
1 | import os
2 | import logging
3 | import time
4 |
5 | log_file = "volSurface.log"
6 | with open(log_file, 'w+') as file:
7 | pass
8 | logging.basicConfig(filename=log_file, level=logging.DEBUG)
9 | logging.disable(logging.DEBUG)
10 | logging.info("Starting log at " + time.ctime() + "...")
11 |
12 | delimiter = '/'
13 | data_path = os.getcwd() + delimiter + 'optionData' + delimiter
14 |
15 | # db
16 | user = "user"
17 | password = "password"
18 | database = "volsurface"
19 |
20 | pairs = ["BTC/USD", "ETH/USD"]
21 | data_pull_freq = 60
22 | load_data = False
23 | num_decimals = 3
24 | port = 8000
25 | ip = "127.0.0.1"
26 |
--------------------------------------------------------------------------------
/cryptopt/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/*
2 | .ipynb_checkpoints/*
3 | __pycache__/*
4 |
--------------------------------------------------------------------------------
/cryptopt/deribitWebsocket.py:
--------------------------------------------------------------------------------
1 | from cryptopt.deribitREST import DeribitREST
2 | import websocket
3 | import json
4 | import time
5 | import logging
6 | import apis
7 |
8 |
9 | class DeribitWebsocket:
10 | def __init__(self, on_message, currency=["BTC"], instruments=["options"], events=["order_book"], depth=["1"]):
11 | self.on_message = on_message
12 | self.client = DeribitREST(apis.key, apis.secret)
13 | self.currency = currency
14 | self.instruments = instruments
15 | self.events = events
16 | self.depth = depth
17 | self.ws = None
18 |
19 | def on_error(self, error):
20 | msg = time.ctime() + ": Deribit websocket error: " + str(error)
21 | print(msg)
22 | logging.info(msg)
23 |
24 | def on_close(self):
25 | msg = time.ctime() + ": Deribit websocket closed"
26 | print(msg)
27 | logging.info(msg)
28 | print("Restarting...")
29 |
30 | def on_open(self):
31 | data = {
32 | "id": 5533,
33 | "action": "/api/v1/private/subscribe",
34 | "arguments": {
35 | "instrument": self.instruments,
36 | "event": self.events,
37 | "depth": self.depth,
38 | "currency": self.currency
39 | }
40 | }
41 | data['sig'] = self.client.generate_signature(data['action'], data['arguments'])
42 | self.ws.send(json.dumps(data))
43 | msg = time.ctime() + ": Deribit websocket opened"
44 | print(msg)
45 | logging.info(msg)
46 |
47 | def start(self):
48 | websocket.enableTrace(True)
49 | self.ws = websocket.WebSocketApp("wss://www.deribit.com/ws/api/v1/",
50 | on_error=self.on_error,
51 | on_close=self.on_close)
52 | self.ws.on_open = self.on_open
53 | self.ws.on_message = lambda ws, msg: self.on_message(msg)
54 | while True:
55 | self.ws.run_forever()
56 |
--------------------------------------------------------------------------------
/cryptopt/requirements.txt:
--------------------------------------------------------------------------------
1 | certifi==2018.11.29
2 | chardet==3.0.4
3 | decorator==4.3.2
4 | idna==2.8
5 | ipython-genutils==0.2.0
6 | jsonschema==2.6.0
7 | jupyter-core==4.4.0
8 | nbformat==4.4.0
9 | numpy==1.16.1
10 | pandas==0.24.1
11 | plotly==3.6.1
12 | python-dateutil==2.8.0
13 | pytz==2018.9
14 | requests==2.21.0
15 | retrying==1.3.3
16 | scipy==1.2.1
17 | six==1.12.0
18 | traitlets==4.3.2
19 | urllib3==1.24.1
20 |
--------------------------------------------------------------------------------
/cryptopt/utils.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | import pytz
3 |
4 |
5 | def get_current_time():
6 | return datetime.datetime.utcnow().replace(tzinfo=pytz.utc)
7 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/favicon.ico
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 0xhedge
4 |
5 |
6 |
7 |

8 |
9 |
10 |
11 |
Welcome to 0xhedge
12 |
13 |
14 |
15 |
16 | On a long enough timeline the survival rate for every fiat currency
17 | drops to zero.
18 |
19 |
20 |
21 |
22 |
Volatility Surface Visualizers
23 |
25 |
29 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | attrs==19.1.0
2 | Automat==0.7.0
3 | certifi==2019.6.16
4 | chardet==3.0.4
5 | constantly==15.1.0
6 | hyperlink==19.0.0
7 | idna==2.8
8 | incremental==17.5.0
9 | numpy==1.17.2
10 | psycopg2==2.8.3
11 | PyHamcrest==1.9.0
12 | pytz==2019.2
13 | requests==2.22.0
14 | scipy==1.3.1
15 | six==1.12.0
16 | Twisted==19.7.0
17 | txaio==18.8.1
18 | urllib3==1.25.3
19 | websocket-client==0.56.0
20 | zope.interface==4.6.0
21 |
--------------------------------------------------------------------------------
/screenshots/volsurface.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwasse/vol-surface-visualizer/e48f2a250c26234f2ca02e3e63706ae5a56e641b/screenshots/volsurface.PNG
--------------------------------------------------------------------------------
/setup.sh:
--------------------------------------------------------------------------------
1 | sudo apt-get update
2 | sudo apt-get -y install npm
3 | sudo apt-get -y install python3.6
4 | sudo npm install
5 | sudo apt-get -y install postgresql
6 | sudo apt-get -y install python-psycopg2
7 | sudo apt-get -y install libpq-dev
8 | sudo apt-get -y install python3-pip
9 | pip3 install -r requirements.txt
10 | service postgresql start
11 |
--------------------------------------------------------------------------------