Home / Function/ TestBasicAuth() — gin Function Reference

TestBasicAuth() — gin Function Reference

Architecture documentation for the TestBasicAuth() function in auth_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  9feb4f76_9800_2e76_78df_96c746c56c36["TestBasicAuth()"]
  8de69f2f_ba6f_8b4b_b264_a61861b36bb6["auth_test.go"]
  9feb4f76_9800_2e76_78df_96c746c56c36 -->|defined in| 8de69f2f_ba6f_8b4b_b264_a61861b36bb6
  style 9feb4f76_9800_2e76_78df_96c746c56c36 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

auth_test.go lines 16–36

func TestBasicAuth(t *testing.T) {
	pairs := processAccounts(Accounts{
		"admin": "password",
		"foo":   "bar",
		"bar":   "foo",
	})

	assert.Len(t, pairs, 3)
	assert.Contains(t, pairs, authPair{
		user:  "bar",
		value: "Basic YmFyOmZvbw==",
	})
	assert.Contains(t, pairs, authPair{
		user:  "foo",
		value: "Basic Zm9vOmJhcg==",
	})
	assert.Contains(t, pairs, authPair{
		user:  "admin",
		value: "Basic YWRtaW46cGFzc3dvcmQ=",
	})
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does TestBasicAuth() do?
TestBasicAuth() is a function in the gin codebase, defined in auth_test.go.
Where is TestBasicAuth() defined?
TestBasicAuth() is defined in auth_test.go at line 16.

Analyze Your Own Codebase

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

Try Supermodel Free