Skip to content

Commit

Permalink
[ADDED] Connection type "in process" (#221)
Browse files Browse the repository at this point in the history
Added `ConnectionTypeInProcess` to the `UserPermissionLimits.AllowedConnectionTypes`
list of possible types.

Signed-off-by: Ivan Kozlovic <[email protected]>
  • Loading branch information
kozlovic authored May 9, 2024
1 parent 1f3ff32 commit 41dad79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions v2/user_claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
ConnectionTypeLeafnodeWS = "LEAFNODE_WS"
ConnectionTypeMqtt = "MQTT"
ConnectionTypeMqttWS = "MQTT_WS"
ConnectionTypeInProcess = "IN_PROCESS"
)

type UserPermissionLimits struct {
Expand Down
2 changes: 2 additions & 0 deletions v2/user_claims_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand Down

0 comments on commit 41dad79

Please sign in to comment.