Skip to content

Commit

Permalink
CLI: add security token to admin add search attribute (#2773)
Browse files Browse the repository at this point in the history
  • Loading branch information
vancexu authored Nov 6, 2019
1 parent 6120c99 commit ca0897b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions tools/cli/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,10 @@ func newAdminClusterCommands() []cli.Command {
Value: -1,
Usage: "Search Attribute value type. [0:String, 1:Keyword, 2:Int, 3:Double, 4:Bool, 5:Datetime]",
},
cli.StringFlag{
Name: FlagSecurityTokenWithAlias,
Usage: "Optional token for security check",
},
},
Action: func(c *cli.Context) {
AdminAddSearchAttribute(c)
Expand Down
5 changes: 3 additions & 2 deletions tools/cli/adminClusterCommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
"strings"

"github.com/fatih/color"
"github.com/urfave/cli"

"github.com/uber/cadence/.gen/go/admin"
"github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/urfave/cli"
)

// AdminAddSearchAttribute to whitelist search attribute
Expand Down Expand Up @@ -58,6 +58,7 @@ func AdminAddSearchAttribute(c *cli.Context) {
SearchAttribute: map[string]shared.IndexedValueType{
key: shared.IndexedValueType(valType),
},
SecurityToken: common.StringPtr(c.String(FlagSecurityToken)),
}

err := adminClient.AddSearchAttribute(ctx, request)
Expand Down
4 changes: 2 additions & 2 deletions tools/cli/domainUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var (
},
cli.StringFlag{
Name: FlagSecurityTokenWithAlias,
Usage: "Security token with permission",
Usage: "Optional token for security check",
},
cli.StringFlag{
Name: FlagHistoryArchivalStatusWithAlias,
Expand Down Expand Up @@ -140,7 +140,7 @@ var (
},
cli.StringFlag{
Name: FlagSecurityTokenWithAlias,
Usage: "Security token with permission ",
Usage: "Optional token for security check",
},
cli.StringFlag{
Name: FlagHistoryArchivalStatusWithAlias,
Expand Down

0 comments on commit ca0897b

Please sign in to comment.