Skip to content

Commit

Permalink
test case for session admin without account
Browse files Browse the repository at this point in the history
  • Loading branch information
david-littlefarmer committed Oct 23, 2024
1 parent fc5febd commit 1d43745
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func TestSession(t *testing.T) {
{Session: proto.SessionType_User},
{Session: proto.SessionType_User, Admin: true},
{Session: proto.SessionType_Admin},
{Session: proto.SessionType_Admin, Admin: true},
{Session: proto.SessionType_Admin, AccessKey: AccessKey},
{Session: proto.SessionType_Service},
{Session: proto.SessionType_Service, AccessKey: AccessKey},
Expand All @@ -128,6 +129,9 @@ func TestSession(t *testing.T) {
claims = map[string]any{"account": address}
case proto.SessionType_Admin:
claims = map[string]any{"account": WalletAddress, "admin": true}
if tc.Admin {
claims = map[string]any{"admin": true}
}
case proto.SessionType_Service:
claims = map[string]any{"service": ServiceName}
}
Expand Down

0 comments on commit 1d43745

Please sign in to comment.