diff --git a/cmd/rekor-server/app/root.go b/cmd/rekor-server/app/root.go index a09b31b29..e258c2aa5 100644 --- a/cmd/rekor-server/app/root.go +++ b/cmd/rekor-server/app/root.go @@ -95,7 +95,7 @@ Memory and file-based signers should only be used for testing.`) rootCmd.PersistentFlags().Uint16("port", 3000, "Port to bind to") rootCmd.PersistentFlags().Bool("enable_retrieve_api", true, "enables Redis-based index API endpoint") - rootCmd.PersistentFlags().MarkDeprecated("enable_retrieve_api", "this flag is deprecated in favor of enabled_api_endpoints (searchIndex)") + _ = rootCmd.PersistentFlags().MarkDeprecated("enable_retrieve_api", "this flag is deprecated in favor of enabled_api_endpoints (searchIndex)") rootCmd.PersistentFlags().String("redis_server.address", "127.0.0.1", "Redis server address") rootCmd.PersistentFlags().Uint16("redis_server.port", 6379, "Redis server port") diff --git a/go.mod b/go.mod index efb0c5a72..1f3fb05f5 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,6 @@ require ( github.com/tent/canonical-json-go v0.0.0-20130607151641-96e4ba3a7613 github.com/theupdateframework/go-tuf v0.5.1-0.20220920170306-f237d7ca5b42 github.com/transparency-dev/merkle v0.0.1 - github.com/urfave/negroni v1.0.0 github.com/veraison/go-cose v1.0.0-rc.1 github.com/zalando/go-keyring v0.1.1 // indirect go.uber.org/goleak v1.2.0 diff --git a/go.sum b/go.sum index f3a62ac38..75623063c 100644 --- a/go.sum +++ b/go.sum @@ -780,8 +780,6 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/veraison/go-cose v1.0.0-rc.1 h1:4qA7dbFJGvt7gcqv5MCIyCQvN+NpHFPkW7do3EeDLb8= github.com/veraison/go-cose v1.0.0-rc.1/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= diff --git a/pkg/generated/restapi/configure_rekor_server.go b/pkg/generated/restapi/configure_rekor_server.go index c9d9dc6b9..30342fe30 100644 --- a/pkg/generated/restapi/configure_rekor_server.go +++ b/pkg/generated/restapi/configure_rekor_server.go @@ -93,14 +93,14 @@ func configureAPI(api *operations.RekorServerAPI) http.Handler { api.PubkeyGetPublicKeyHandler = pubkey.GetPublicKeyHandlerFunc(pkgapi.GetPublicKeyNotImplementedHandler) api.TlogGetLogProofHandler = tlog.GetLogProofHandlerFunc(pkgapi.GetLogProofNotImplementedHandler) - enabled_api_endpoints := viper.GetStringSlice("enabled_api_endpoints") - if !slices.Contains(enabled_api_endpoints, "searchIndex") && viper.GetBool("enable_retrieve_api") { - enabled_api_endpoints = append(enabled_api_endpoints, "searchIndex") + enabledAPIEndpoints := viper.GetStringSlice("enabled_api_endpoints") + if !slices.Contains(enabledAPIEndpoints, "searchIndex") && viper.GetBool("enable_retrieve_api") { + enabledAPIEndpoints = append(enabledAPIEndpoints, "searchIndex") } - for _, enabled_api := range enabled_api_endpoints { - log.Logger.Infof("Enabling API endpoint: %s", enabled_api) - switch enabled_api { + for _, enabledAPI := range enabledAPIEndpoints { + log.Logger.Infof("Enabling API endpoint: %s", enabledAPI) + switch enabledAPI { case "searchIndex": api.IndexSearchIndexHandler = index.SearchIndexHandlerFunc(pkgapi.SearchIndexHandler) case "getLogInfo": @@ -118,13 +118,13 @@ func configureAPI(api *operations.RekorServerAPI) http.Handler { case "searchLogQuery": api.EntriesSearchLogQueryHandler = entries.SearchLogQueryHandlerFunc(pkgapi.SearchLogQueryHandler) default: - log.Logger.Panicf("Unknown API endpoint requested: %s", enabled_api) + log.Logger.Panicf("Unknown API endpoint requested: %s", enabledAPI) } } // all handlers need to be set before a call to api.AddMiddlewareFor - for _, enabled_api := range enabled_api_endpoints { - switch enabled_api { + for _, enabledAPI := range enabledAPIEndpoints { + switch enabledAPI { case "searchIndex": recordMetricsForAPI(api, "POST", "/api/v1/index/retrieve") // add metrics case "getLogInfo":