MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / create

Method create

apps/server/internal/httpserver/security.go:95–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93}
94
95func (s *sessionStore) create() (string, time.Time, error) {
96 buf := make([]byte, 32)
97 if _, err := rand.Read(buf); err != nil {
98 return "", time.Time{}, err
99 }
100 token := hex.EncodeToString(buf)
101 expiresAt := time.Now().Add(sessionTTL)
102 s.mu.Lock()
103 s.sessions[token] = expiresAt
104 s.persistLocked()
105 s.mu.Unlock()
106 return token, expiresAt, nil
107}
108
109func (s *sessionStore) isValid(token string) bool {
110 if strings.TrimSpace(token) == "" {

Callers 15

makeViewFunction · 0.80
EditorPaneFunction · 0.80
PinnedReferencePaneFunction · 0.80
FloatingNoteAppFunction · 0.80
TemplateEditorModalFunction · 0.80
QuickCaptureAppFunction · 0.80
ExternalFileAppFunction · 0.80
mountEditorFunction · 0.80
mountFunction · 0.80
mountEditorFunction · 0.80
completionResultFunction · 0.80

Calls 1

persistLockedMethod · 0.95

Tested by 15

makeViewFunction · 0.64
mountEditorFunction · 0.64
mountFunction · 0.64
mountEditorFunction · 0.64
completionResultFunction · 0.64
headingResultFunction · 0.64
mountFunction · 0.64
mountFunction · 0.64
createStateFunction · 0.64
mountFunction · 0.64
mountFunction · 0.64
mountVimFunction · 0.64