mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
[FIXED/CHANGED] Add leafnode websocket connection type
This was missing since WEBSOCKET allowed connection type is really used for client connections. If one wants to limit a configured user to leafnode connections, including if the connection is over websocket, but does not want an application to connect over websocket using this user, this would have been impossible to configure. The JWT library has been updated to add LEAFNODE_WS and MQTT_WS for future work. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -1104,7 +1104,9 @@ func validateAllowedConnectionTypes(m map[string]struct{}) error {
|
||||
for ct := range m {
|
||||
ctuc := strings.ToUpper(ct)
|
||||
switch ctuc {
|
||||
case jwt.ConnectionTypeStandard, jwt.ConnectionTypeWebsocket, jwt.ConnectionTypeLeafnode, jwt.ConnectionTypeMqtt:
|
||||
case jwt.ConnectionTypeStandard, jwt.ConnectionTypeWebsocket,
|
||||
jwt.ConnectionTypeLeafnode, jwt.ConnectionTypeLeafnodeWS,
|
||||
jwt.ConnectionTypeMqtt:
|
||||
default:
|
||||
return fmt.Errorf("unknown connection type %q", ct)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user