MCPcopy
hub / github.com/tinode/chat / initAuthRecords

Function initAuthRecords

server/db/common/test_data/test_data.go:104–123  ·  view source on GitHub ↗
(now time.Time, users []*types.User)

Source from the content-addressed store, hash-verified

102}
103
104func initAuthRecords(now time.Time, users []*types.User) []common.AuthRecord {
105 recs := make([]common.AuthRecord, 0, 2)
106 recs = append(recs, common.AuthRecord{
107 Unique: "basic:alice",
108 UserId: users[0].Id,
109 Scheme: "basic",
110 AuthLvl: auth.LevelAuth,
111 Secret: []byte{'a', 'l', 'i', 'c', 'e'},
112 Expires: now.Add(24 * time.Hour),
113 })
114 recs = append(recs, common.AuthRecord{
115 Unique: "basic:bob",
116 UserId: users[1].Id,
117 Scheme: "basic",
118 AuthLvl: auth.LevelAuth,
119 Secret: []byte{'b', 'o', 'b'},
120 Expires: now.Add(24 * time.Hour),
121 })
122 return recs
123}
124
125func initTopics(now time.Time, users []*types.User) []*types.Topic {
126 topics := make([]*types.Topic, 0, 5)

Callers 1

InitTestDataFunction · 0.85

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…