From 41dad79143e9cff55e4bde8af4df7a40ad49786c Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Thu, 9 May 2024 10:08:51 -0600 Subject: [PATCH] [ADDED] Connection type "in process" (#221) Added `ConnectionTypeInProcess` to the `UserPermissionLimits.AllowedConnectionTypes` list of possible types. Signed-off-by: Ivan Kozlovic --- v2/user_claims.go | 1 + v2/user_claims_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/v2/user_claims.go b/v2/user_claims.go index 0b38af6..53b781d 100644 --- a/v2/user_claims.go +++ b/v2/user_claims.go @@ -29,6 +29,7 @@ const ( ConnectionTypeLeafnodeWS = "LEAFNODE_WS" ConnectionTypeMqtt = "MQTT" ConnectionTypeMqttWS = "MQTT_WS" + ConnectionTypeInProcess = "IN_PROCESS" ) type UserPermissionLimits struct { diff --git a/v2/user_claims_test.go b/v2/user_claims_test.go index fed0660..2abd028 100644 --- a/v2/user_claims_test.go +++ b/v2/user_claims_test.go @@ -361,6 +361,7 @@ func TestUserAllowedConnectionTypes(t *testing.T) { uc.AllowedConnectionTypes.Add(ConnectionTypeLeafnodeWS) uc.AllowedConnectionTypes.Add(ConnectionTypeMqtt) uc.AllowedConnectionTypes.Add(ConnectionTypeMqttWS) + uc.AllowedConnectionTypes.Add(ConnectionTypeInProcess) uJwt := encode(uc, akp, t) uc2, err := DecodeUserClaims(uJwt) @@ -373,6 +374,7 @@ func TestUserAllowedConnectionTypes(t *testing.T) { AssertTrue(uc2.AllowedConnectionTypes.Contains(ConnectionTypeLeafnodeWS), t) AssertTrue(uc2.AllowedConnectionTypes.Contains(ConnectionTypeMqtt), t) AssertTrue(uc2.AllowedConnectionTypes.Contains(ConnectionTypeMqttWS), t) + AssertTrue(uc2.AllowedConnectionTypes.Contains(ConnectionTypeInProcess), t) } func TestUserClaimRevocation(t *testing.T) {