Skip to content

Commit

Permalink
Change roles to dict in Welcome
Browse files Browse the repository at this point in the history
  • Loading branch information
muzzammilshahid committed Jul 4, 2024
1 parent 728d660 commit 61ea24c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/wampproto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func parseCmd(args []string) (*cmd, error) {
Welcome: &Welcome{
welcome: welcomeCommand,
sessionID: welcomeCommand.Arg("session-id", "WAMP session ID.").Required().Int64(),
welcomeRoles: welcomeCommand.Flag("roles", "Client roles.").Strings(),
welcomeRoles: welcomeCommand.Flag("roles", "Client roles.").StringMap(),
welcomeAuthid: welcomeCommand.Flag("authid", "Client authid.").String(),
welcomeAuthRole: welcomeCommand.Flag("authrole", "Client authrole.").String(),
welcomeAuthMethod: welcomeCommand.Flag("authmethod", "Client authmethod.").String(),
Expand Down Expand Up @@ -498,7 +498,7 @@ func Run(args []string) (string, error) {

case c.welcome.FullCommand():
var (
roles = wampprotocli.StringsToTypedList(*c.welcomeRoles)
roles = wampprotocli.StringMapToTypedMap(*c.welcomeRoles)
authextra = wampprotocli.StringMapToTypedMap(*c.welcomeAuthExtra)
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/wampproto/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func TestHelloMessage(t *testing.T) {
}

func TestWelcomeMessage(t *testing.T) {
var command = "wampproto message welcome 1 --roles callee --roles caller --authid foo " +
var command = "wampproto message welcome 1 --roles callee=true --roles caller=true --authid foo " +
"--authmethod anonymous --authextra ticket=test"

testMessageCommand(t, command)
Expand Down
2 changes: 1 addition & 1 deletion cmd/wampproto/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Hello struct {
type Welcome struct {
welcome *kingpin.CmdClause
sessionID *int64
welcomeRoles *[]string
welcomeRoles *map[string]string
welcomeAuthid *string
welcomeAuthRole *string
welcomeAuthMethod *string
Expand Down

0 comments on commit 61ea24c

Please sign in to comment.