Home / Function/ Test_Store_Get() — fiber Function Reference

Test_Store_Get() — fiber Function Reference

Architecture documentation for the Test_Store_Get() function in store_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  089ddb3f_4341_f0c0_d127_432d81be02a8["Test_Store_Get()"]
  9bbf348a_f496_e909_6f62_6ea1938bfec4["store_test.go"]
  089ddb3f_4341_f0c0_d127_432d81be02a8 -->|defined in| 9bbf348a_f496_e909_6f62_6ea1938bfec4
  style 089ddb3f_4341_f0c0_d127_432d81be02a8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/session/store_test.go lines 72–94

func Test_Store_Get(t *testing.T) {
	// Regression: https://github.com/gofiber/fiber/security/advisories/GHSA-98j2-3j3p-fw2v
	t.Parallel()
	unexpectedID := "test-session-id"
	// fiber instance
	app := fiber.New()
	t.Run("session should be re-generated if it is invalid", func(t *testing.T) {
		t.Parallel()
		// session store
		store := NewStore()
		// fiber context
		ctx := app.AcquireCtx(&fasthttp.RequestCtx{})
		defer app.ReleaseCtx(ctx)

		// set cookie
		ctx.Request().Header.SetCookie(store.Extractor.Key, unexpectedID)

		acquiredSession, err := store.Get(ctx)
		require.NoError(t, err)

		require.NotEqual(t, unexpectedID, acquiredSession.ID())
	})
}

Subdomains

Frequently Asked Questions

What does Test_Store_Get() do?
Test_Store_Get() is a function in the fiber codebase, defined in middleware/session/store_test.go.
Where is Test_Store_Get() defined?
Test_Store_Get() is defined in middleware/session/store_test.go at line 72.

Analyze Your Own Codebase

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

Try Supermodel Free