mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-14 04:07:46 +00:00
0.7.10 (#80)
* Add ability to disable replay protection. - This is useful for runs with multiple traefik replicas to avoid false positives and tokens re-creation. * Enhance the CI/CD pipelines * Increase test coverage. * Update vendored dependencies. * Update behaviour on forceHTTPS as per issue #82
This commit is contained in:
@@ -81,8 +81,8 @@ func (rp *RequestProcessor) WaitForInitialization(req *http.Request, initComplet
|
||||
case <-initComplete:
|
||||
return nil
|
||||
case <-req.Context().Done():
|
||||
rp.logger.Debug("Request cancelled while waiting for OIDC initialization")
|
||||
return fmt.Errorf("request cancelled")
|
||||
rp.logger.Debug("Request canceled while waiting for OIDC initialization")
|
||||
return fmt.Errorf("request canceled")
|
||||
case <-time.After(30 * time.Second):
|
||||
rp.logger.Error("Timeout waiting for OIDC initialization")
|
||||
return fmt.Errorf("timeout waiting for OIDC provider initialization")
|
||||
|
||||
@@ -383,7 +383,7 @@ func TestWaitForInitialization(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Request context cancelled", func(t *testing.T) {
|
||||
t.Run("Request context canceled", func(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
req := httptest.NewRequest("GET", "http://example.com/test", nil)
|
||||
req = req.WithContext(ctx)
|
||||
@@ -396,15 +396,15 @@ func TestWaitForInitialization(t *testing.T) {
|
||||
|
||||
err := processor.WaitForInitialization(req, initComplete)
|
||||
if err == nil {
|
||||
t.Error("Expected error when request context is cancelled")
|
||||
t.Error("Expected error when request context is canceled")
|
||||
}
|
||||
|
||||
if !strings.Contains(err.Error(), "request cancelled") {
|
||||
t.Errorf("Expected 'request cancelled' error, got: %v", err)
|
||||
if !strings.Contains(err.Error(), "request canceled") {
|
||||
t.Errorf("Expected 'request canceled' error, got: %v", err)
|
||||
}
|
||||
|
||||
if len(logger.DebugCalls) == 0 {
|
||||
t.Error("Expected debug log when request is cancelled")
|
||||
t.Error("Expected debug log when request is canceled")
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user