Home / Function/ TestLimiterFixedStorageGetErrorDisableRedaction() — fiber Function Reference

TestLimiterFixedStorageGetErrorDisableRedaction() — fiber Function Reference

Architecture documentation for the TestLimiterFixedStorageGetErrorDisableRedaction() function in limiter_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  fb86b2ed_7a9e_59ef_623b_50cc923957f2["TestLimiterFixedStorageGetErrorDisableRedaction()"]
  0509da96_221e_0d0d_fe2e_f2e2e3695b6f["limiter_test.go"]
  fb86b2ed_7a9e_59ef_623b_50cc923957f2 -->|defined in| 0509da96_221e_0d0d_fe2e_f2e2e3695b6f
  7ddb57c0_b979_4c6c_5a2c_454e23b18dd2["newFailingLimiterStorage()"]
  fb86b2ed_7a9e_59ef_623b_50cc923957f2 -->|calls| 7ddb57c0_b979_4c6c_5a2c_454e23b18dd2
  style fb86b2ed_7a9e_59ef_623b_50cc923957f2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/limiter/limiter_test.go lines 320–345

func TestLimiterFixedStorageGetErrorDisableRedaction(t *testing.T) {
	t.Parallel()

	storage := newFailingLimiterStorage()
	storage.errs["get|"+testLimiterClientKey] = errors.New("boom")

	var captured error
	app := fiber.New(fiber.Config{
		ErrorHandler: func(c fiber.Ctx, err error) error {
			captured = err
			return c.Status(fiber.StatusInternalServerError).SendString("storage failure")
		},
	})

	app.Use(New(Config{DisableValueRedaction: true, Storage: storage, Max: 1, Expiration: time.Second, KeyGenerator: func(fiber.Ctx) string { return testLimiterClientKey }}))
	app.Get("/", func(c fiber.Ctx) error {
		return c.SendString("ok")
	})

	resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
	require.NoError(t, err)
	require.Equal(t, fiber.StatusInternalServerError, resp.StatusCode)
	require.Error(t, captured)
	require.ErrorContains(t, captured, testLimiterClientKey)
	require.NotContains(t, captured.Error(), "[redacted]")
}

Subdomains

Frequently Asked Questions

What does TestLimiterFixedStorageGetErrorDisableRedaction() do?
TestLimiterFixedStorageGetErrorDisableRedaction() is a function in the fiber codebase, defined in middleware/limiter/limiter_test.go.
Where is TestLimiterFixedStorageGetErrorDisableRedaction() defined?
TestLimiterFixedStorageGetErrorDisableRedaction() is defined in middleware/limiter/limiter_test.go at line 320.
What does TestLimiterFixedStorageGetErrorDisableRedaction() call?
TestLimiterFixedStorageGetErrorDisableRedaction() calls 1 function(s): newFailingLimiterStorage.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free