feat(auth): add local and OIDC management to tht

This commit is contained in:
2026-08-16 19:23:30 +02:00
parent d17ad0e95b
commit 9646ae09a0
15 changed files with 992 additions and 13 deletions
+11
View File
@@ -3,10 +3,21 @@
package safeio
import (
"errors"
"os"
"path/filepath"
)
func createPrivateDirectory(path string) error {
if err := os.Mkdir(path, 0o700); err != nil {
if errors.Is(err, os.ErrExist) {
return os.ErrExist
}
return err
}
return ProtectPrivateDirectory(path)
}
// ProtectPrivateDirectory sets the private directory mode used for local authentication state.
func ProtectPrivateDirectory(path string) error {
if err := ValidateCanonicalPath(path); err != nil {