1{
2    "version": 2,
3    "workers": [
4        {
5            "type": "router",
6            "options": {
7                "pythonpath": ["../../twisted/wamp/rpc/authorize/"]
8            },
9            "realms": [
10                {
11                    "name": "crossbardemo",
12                    "store": {
13                        "type": "memory",
14                        "event-history": [
15                            {
16                                "uri": "com.example.history",
17                                "limit": 100
18                            }
19                        ]
20                    },
21                    "roles": [
22                        {
23                            "name": "anonymous",
24                            "permissions": [
25                                {
26                                    "uri": "",
27                                    "match": "prefix",
28                                    "allow": {
29                                        "call": true,
30                                        "register": true,
31                                        "publish": true,
32                                        "subscribe": true
33                                    },
34                                    "disclose": {
35                                        "caller": false,
36                                        "publisher": false
37                                    },
38                                    "cache": true
39                                }
40                            ]
41                        },
42                        {
43                            "name": "authenticated",
44                            "permissions": [
45                                {
46                                    "uri": "",
47                                    "match": "prefix",
48                                    "allow": {
49                                        "call": true,
50                                        "register": true,
51                                        "publish": true,
52                                        "subscribe": true
53                                    },
54                                    "disclose": {
55                                        "caller": false,
56                                        "publisher": false
57                                    },
58                                    "cache": true
59                                }
60                            ]
61                        },
62                        {
63                            "name": "approver",
64                            "permissions": [
65                                {
66                                    "uri": "com.example.authorize",
67                                    "allow": {
68                                        "register": true
69                                    }
70                                },
71                                {
72                                    "uri": "com.example.scram_auth",
73                                    "allow": {
74                                        "register": true
75                                    }
76                                }
77                            ]
78                        },
79                        {
80                            "name": "dynamic_authed",
81                            "authorizer": "com.example.authorize"
82                        }
83                    ]
84                }
85            ],
86            "transports": [
87                {
88                    "type": "mqtt",
89                    "endpoint": {
90                        "type": "tcp",
91                        "port": 1883
92                    },
93                    "options": {
94                        "realm": "crossbardemo",
95                        "role": "anonymous"
96                    }
97                },
98                {
99                    "type": "universal",
100                    "endpoint": {
101                        "type": "tcp",
102                        "port": 8080
103                    },
104                    "rawsocket": {
105                        "serializers": [
106                            "cbor", "msgpack", "ubjson", "json"
107                        ]
108                    },
109                    "websocket": {
110                        "ws": {
111                            "type": "websocket",
112                            "serializers": [
113                                "cbor", "msgpack", "ubjson", "json"
114                            ],
115                            "options": {
116                                "enable_webstatus": true,
117                                "max_frame_size": 1048576,
118                                "max_message_size": 1048576,
119                                "auto_fragment_size": 65536,
120                                "fail_by_drop": true,
121                                "open_handshake_timeout": 2500,
122                                "close_handshake_timeout": 1000,
123                                "auto_ping_interval": 10000,
124                                "auto_ping_timeout": 5000,
125                                "auto_ping_size": 4,
126                                "compression": {
127                                    "deflate": {
128                                        "request_no_context_takeover": false,
129                                        "request_max_window_bits": 13,
130                                        "no_context_takeover": false,
131                                        "max_window_bits": 13,
132                                        "memory_level": 5
133                                    }
134                                }
135                            }
136                        },
137                        "auth_ws": {
138                            "type": "websocket",
139                            "auth": {
140                                "wampcra": {
141                                    "type": "static",
142                                    "users": {
143                                        "username": {
144                                            "secret": "p4ssw0rd",
145                                            "role": "authenticated"
146                                        },
147                                        "bob": {
148                                            "secret": "p4ssw0rd",
149                                            "role": "dynamic_authed"
150                                        },
151                                        "salted": {
152                                            "secret": "zFXAAAqW5nlonWfP6JLMq4KGLRYZAd8OSXWknEbckCQ=",
153                                            "role": "authenticated",
154                                            "salt": "salt123",
155                                            "iterations": 100,
156                                            "keylen": 32
157                                        }
158                                    }
159                                },
160                                "scram": {
161                                    "type": "dynamic",
162                                    "authenticator": "com.example.scram_auth"
163                                },
164                                "anonymous": {
165                                    "type": "static",
166                                    "role": "anonymous"
167                                },
168                                "cryptosign": {
169                                    "type": "static",
170                                    "principals": {
171                                        "alice": {
172                                            "realm": "crossbardemo",
173                                            "role": "authenticated",
174                                            "authorized_keys": [
175                                                "020b13239ca0f10a1c65feaf26e8dfca6e84c81d2509a2b7b75a7e5ee5ce4b66"
176                                            ]
177                                        }
178                                    }
179                                }
180                            }
181                        }
182                    },
183                    "web": {
184                        "paths": {
185                            "/": {
186                                "type": "static",
187                                "directory": "../..",
188                                "options": {
189                                    "enable_directory_listing": true,
190                                    "mime_types": {
191                                        ".md": "text/plain",
192                                        ".py": "text/plain"
193                                    }
194                                }
195                            }
196                        }
197                    }
198                },
199                {
200                    "type": "websocket",
201                    "endpoint": {
202                        "type": "tcp",
203                        "port": 8083,
204                        "tls": {
205                            "key": "server.key",
206                            "certificate": "server.crt"
207                        }
208                    }
209                },
210                {
211                    "type": "websocket",
212                    "endpoint": {
213                        "type": "unix",
214                        "path": "unix_socket"
215                    }
216                }
217            ],
218            "components": [
219                {
220                    "type": "class",
221                    "classname": "authorizer.MyAuthorizer",
222                    "realm": "crossbardemo",
223                    "role": "approver"
224                }
225            ]
226        }
227    ]
228}
229