Add SSO login support

- Add [sso] config section with redirect_uri
- Create mcdsl/sso client when SSO is configured
- Add /login (landing page), /sso/redirect, /sso/callback routes
- Add /logout route
- Update login template with SSO landing page variant
- Bump mcdsl to v1.6.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 20:23:25 -07:00
parent ae4cc8b420
commit 647fd26e60
2619 changed files with 6833933 additions and 9 deletions

View File

@@ -0,0 +1,38 @@
//go:build unix || linux || openbsd || (darwin && amd64)
package lib
import (
"time"
"golang.org/x/sys/unix"
)
// FileTime contains the changed, modified, and accessed timestamps
// for a file.
type FileTime struct {
Changed time.Time
Modified time.Time
Accessed time.Time
}
func timeSpecToTime(ts unix.Timespec) time.Time {
// The casts to int64 are needed because on 386, these are int32s.
return time.Unix(ts.Sec, ts.Nsec)
}
// LoadFileTime returns a FileTime associated with the file.
func LoadFileTime(path string) (FileTime, error) {
var ft = FileTime{}
var st = unix.Stat_t{}
err := unix.Stat(path, &st)
if err != nil {
return ft, err
}
ft.Changed = timeSpecToTime(st.Ctim)
ft.Modified = timeSpecToTime(st.Mtim)
ft.Accessed = timeSpecToTime(st.Atim)
return ft, nil
}