Skip to content

Commit 41dad79

Browse files
authored
[ADDED] Connection type "in process" (#221)
Added `ConnectionTypeInProcess` to the `UserPermissionLimits.AllowedConnectionTypes` list of possible types. Signed-off-by: Ivan Kozlovic <[email protected]>
1 parent 1f3ff32 commit 41dad79

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

v2/user_claims.go

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const (
2929
ConnectionTypeLeafnodeWS = "LEAFNODE_WS"
3030
ConnectionTypeMqtt = "MQTT"
3131
ConnectionTypeMqttWS = "MQTT_WS"
32+
ConnectionTypeInProcess = "IN_PROCESS"
3233
)
3334

3435
type UserPermissionLimits struct {

v2/user_claims_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ func TestUserAllowedConnectionTypes(t *testing.T) {
361361
uc.AllowedConnectionTypes.Add(ConnectionTypeLeafnodeWS)
362362
uc.AllowedConnectionTypes.Add(ConnectionTypeMqtt)
363363
uc.AllowedConnectionTypes.Add(ConnectionTypeMqttWS)
364+
uc.AllowedConnectionTypes.Add(ConnectionTypeInProcess)
364365
uJwt := encode(uc, akp, t)
365366

366367
uc2, err := DecodeUserClaims(uJwt)
@@ -373,6 +374,7 @@ func TestUserAllowedConnectionTypes(t *testing.T) {
373374
AssertTrue(uc2.AllowedConnectionTypes.Contains(ConnectionTypeLeafnodeWS), t)
374375
AssertTrue(uc2.AllowedConnectionTypes.Contains(ConnectionTypeMqtt), t)
375376
AssertTrue(uc2.AllowedConnectionTypes.Contains(ConnectionTypeMqttWS), t)
377+
AssertTrue(uc2.AllowedConnectionTypes.Contains(ConnectionTypeInProcess), t)
376378
}
377379

378380
func TestUserClaimRevocation(t *testing.T) {

0 commit comments

Comments
 (0)