Skip to content

Commit a9fa4eb

Browse files
Merge branch 'main' into jsonlogic-rules
2 parents 24d3688 + 7d94c06 commit a9fa4eb

File tree

4 files changed

+0
-34
lines changed

4 files changed

+0
-34
lines changed

cmd/relayproxy/api/server.go

-16
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"net/http"
88
"strings"
9-
"time"
109

1110
"github.com/aws/aws-lambda-go/lambda"
1211
"github.com/labstack/echo-contrib/echoprometheus"
@@ -55,21 +54,6 @@ func (s *Server) initRoutes() {
5554
s.apiEcho.HidePort = true
5655
s.apiEcho.Debug = s.config.IsDebugEnabled()
5756
s.apiEcho.Use(otelecho.Middleware("go-feature-flag"))
58-
// Timeout middleware has to be the first middleware in the list
59-
// (see: https://github.com/labstack/echo/blob/3b017855b4d331002e2b8b28e903679b875ae3e9/middleware/timeout.go#L17)
60-
s.apiEcho.Use(middleware.TimeoutWithConfig(
61-
middleware.TimeoutConfig{
62-
Skipper: func(c echo.Context) bool {
63-
// ignore websocket in the timeout
64-
return strings.HasPrefix(c.Request().URL.String(), "/ws")
65-
},
66-
Timeout: time.Duration(s.config.RestAPITimeout) * time.Millisecond,
67-
OnTimeoutRouteErrorHandler: func(err error, c echo.Context) {
68-
s.zapLog.Error("Timeout on route", zap.String("route", c.Path()), zap.Error(err))
69-
},
70-
ErrorMessage: `Timeout on the server, please retry later`,
71-
}),
72-
)
7357
s.apiEcho.Use(custommiddleware.ZapLogger(s.zapLog, s.config))
7458
s.apiEcho.Use(middleware.BodyDumpWithConfig(middleware.BodyDumpConfig{
7559
Skipper: func(c echo.Context) bool {

cmd/relayproxy/config/config.go

-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ func New(flagSet *pflag.FlagSet, log *zap.Logger, version string) (*Config, erro
6666
"listen": "1031",
6767
"host": "localhost",
6868
"fileFormat": "yaml",
69-
"restApiTimeout": 5000,
7069
"pollingInterval": 60000,
7170
"logLevel": DefaultLogLevel,
7271
}, "."), nil)
@@ -260,9 +259,6 @@ type Config struct {
260259
// Notifiers is the configuration on where to notify a flag change
261260
Notifiers []NotifierConf `mapstructure:"notifier" koanf:"notifier"`
262261

263-
// RestAPITimeout is the timeout on the API.
264-
RestAPITimeout int `mapstructure:"restApiTimeout" koanf:"restapitimeout"`
265-
266262
// Version is the version of the relay-proxy
267263
Version string `mapstructure:"version" koanf:"version"`
268264

cmd/relayproxy/config/config_test.go

-13
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ func TestParseConfig_fileFromPflag(t *testing.T) {
3737
Kind: "log",
3838
},
3939
StartWithRetrieverError: false,
40-
RestAPITimeout: 5000,
4140
Version: "1.X.X",
4241
EnableSwagger: true,
4342
AuthorizedKeys: config.APIKeys{
@@ -75,7 +74,6 @@ func TestParseConfig_fileFromPflag(t *testing.T) {
7574
},
7675
},
7776
StartWithRetrieverError: false,
78-
RestAPITimeout: 5000,
7977
Version: "1.X.X",
8078
EnableSwagger: true,
8179
AuthorizedKeys: config.APIKeys{
@@ -105,7 +103,6 @@ func TestParseConfig_fileFromPflag(t *testing.T) {
105103
Kind: "log",
106104
},
107105
StartWithRetrieverError: false,
108-
RestAPITimeout: 5000,
109106
Version: "1.X.X",
110107
EnableSwagger: true,
111108
APIKeys: []string{
@@ -133,7 +130,6 @@ func TestParseConfig_fileFromPflag(t *testing.T) {
133130
Kind: "log",
134131
},
135132
StartWithRetrieverError: false,
136-
RestAPITimeout: 5000,
137133
Version: "1.X.X",
138134
EnableSwagger: true,
139135
APIKeys: []string{
@@ -153,7 +149,6 @@ func TestParseConfig_fileFromPflag(t *testing.T) {
153149
FileFormat: "yaml",
154150
Host: "localhost",
155151
StartWithRetrieverError: false,
156-
RestAPITimeout: 5000,
157152
Version: "1.X.X",
158153
LogLevel: config.DefaultLogLevel,
159154
},
@@ -172,7 +167,6 @@ func TestParseConfig_fileFromPflag(t *testing.T) {
172167
PollingInterval: 60000,
173168
FileFormat: "yaml",
174169
Host: "localhost",
175-
RestAPITimeout: 5000,
176170
LogLevel: config.DefaultLogLevel,
177171
Version: "1.X.X",
178172
Retrievers: &[]config.RetrieverConf{
@@ -238,7 +232,6 @@ func TestParseConfig_fileFromFolder(t *testing.T) {
238232
Kind: "log",
239233
},
240234
StartWithRetrieverError: false,
241-
RestAPITimeout: 5000,
242235
Version: "1.X.X",
243236
EnableSwagger: true,
244237
AuthorizedKeys: config.APIKeys{
@@ -263,7 +256,6 @@ func TestParseConfig_fileFromFolder(t *testing.T) {
263256
FileFormat: "yaml",
264257
Host: "localhost",
265258
StartWithRetrieverError: false,
266-
RestAPITimeout: 5000,
267259
Version: "1.X.X",
268260
LogLevel: config.DefaultLogLevel,
269261
},
@@ -284,7 +276,6 @@ func TestParseConfig_fileFromFolder(t *testing.T) {
284276
FileFormat: "yaml",
285277
Host: "localhost",
286278
StartWithRetrieverError: false,
287-
RestAPITimeout: 5000,
288279
Version: "1.X.X",
289280
LogLevel: config.DefaultLogLevel,
290281
},
@@ -299,7 +290,6 @@ func TestParseConfig_fileFromFolder(t *testing.T) {
299290
FileFormat: "yaml",
300291
Host: "localhost",
301292
StartWithRetrieverError: false,
302-
RestAPITimeout: 5000,
303293
Version: "1.X.X",
304294
LogLevel: config.DefaultLogLevel,
305295
},
@@ -314,7 +304,6 @@ func TestParseConfig_fileFromFolder(t *testing.T) {
314304
FileFormat: "yaml",
315305
Host: "localhost",
316306
StartWithRetrieverError: false,
317-
RestAPITimeout: 5000,
318307
Version: "1.X.X",
319308
LogLevel: config.DefaultLogLevel,
320309
},
@@ -837,7 +826,6 @@ func TestMergeConfig_FromOSEnv(t *testing.T) {
837826
Kind: "log",
838827
},
839828
StartWithRetrieverError: false,
840-
RestAPITimeout: 5000,
841829
Version: "1.X.X",
842830
EnableSwagger: true,
843831
AuthorizedKeys: config.APIKeys{
@@ -870,7 +858,6 @@ func TestMergeConfig_FromOSEnv(t *testing.T) {
870858
PollingInterval: 60000,
871859
FileFormat: "yaml",
872860
Host: "localhost",
873-
RestAPITimeout: 5000,
874861
LogLevel: config.DefaultLogLevel,
875862
Version: "1.X.X",
876863
Retrievers: &[]config.RetrieverConf{

website/docs/relay_proxy/configure_relay_proxy.md

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ ex: `AUTHORIZEDKEYS_EVALUATION=my-first-key,my-second-key`)_.
4242
| `hideBanner` | boolean | `false` | Should we display the beautiful **go-feature-flag** banner when starting the relay proxy |
4343
| `enableSwagger` | boolean | `false` | Enables Swagger for testing the APIs directly. If you are enabling Swagger you will have to provide the `host` configuration and the Swagger UI will be available at `http://<host>:<listen>/swagger/`. |
4444
| `host` | string | `localhost` | This is the DNS you will use to access the relay proxy. This field is used by Swagger to query the API at the right place. |
45-
| `restApiTimeout` | int | `5000` | Timeout in milliseconds for API calls. |
4645
| `logLevel` | string | `info` | The log level to use for the relay proxy.<br/> Available values are `ERROR`, `WARN`, `INFO`, `DEBUG`. |
4746
| `logFormat` | string | `json` | The format to use for structured logs from the relay proxy.<br/>Valid values are `json` and `logfmt`. |
4847
| `fileFormat` | string | `yaml` | This is the format of your `go-feature-flag` configuration file. Acceptable values are `yaml`, `json`, `toml`. |

0 commit comments

Comments
 (0)