File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ func NewApp(params AppParams) (*cli.App, error) {
2828 EnableDebugLogsFlag ,
2929 },
3030 }
31- app .Commands = params .Commands
31+ for _ , c := range params .Commands {
32+ if ! IsFeatureEnabled (APIKeyFeatureFlag ) && c .Name == "apikey" {
33+ continue
34+ }
35+ app .Commands = append (app .Commands , c )
36+ }
3237 return app , nil
3338}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
1313
1414var (
1515 ExportFeatureFlag = "enable-export"
16+ APIKeyFeatureFlag = "enable-apikey"
1617 featureflagFileName = "feature.json"
1718)
1819
@@ -108,6 +109,14 @@ func NewFeatureCommand() (CommandOut, error) {
108109 return toggleFeature (ExportFeatureFlag )
109110 },
110111 },
112+ {
113+ Name : "toggle-apikey" ,
114+ Aliases : []string {"tak" },
115+ Usage : "switch api keys on/off" ,
116+ Action : func (c * cli.Context ) error {
117+ return toggleFeature (APIKeyFeatureFlag )
118+ },
119+ },
111120 {
112121 Name : "get" ,
113122 Aliases : []string {"g" },
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ func fxOptions() fx.Option {
2222 app .NewLoginCommand ,
2323 app .NewLogoutCommand ,
2424 app .NewCertificatesCommand ,
25+ app .NewAPIKeyCommand ,
2526 app .NewFeatureCommand ,
2627 func () app.GetNamespaceClientFn {
2728 return app .GetNamespaceClient
You can’t perform that action at this time.
0 commit comments