Started LDAP support

This commit is contained in:
2023-10-24 22:15:58 +02:00
parent 4a9a913d66
commit 7bcd00c97b
11 changed files with 669 additions and 82 deletions

View File

@@ -0,0 +1,28 @@
package backend
import "time"
// Session holds info about the logged-in user that won't change
type Session struct {
SessionID string
Expiration time.Time
UserID string
LdapDN string
}
// SessionCache holds volatile information about the logged-in user
type SessionCache struct {
Valid bool
Groups []string
DisplayName string
Email string
}
type Backend interface {
PutSession(session Session, cache SessionCache) error
GetSession(id string) (Session, *SessionCache, error)
EndSession(id string)
NewSessionID() (string, error)
DoMaintenance()
Ping() error
}