mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Make SSPI auth mockable (#27036)
Before, the SSPI auth is only complied for Windows, it's difficult to test and it breaks a lot. Now, make the SSPI auth mockable and testable.
This commit is contained in:
19
services/auth/sspiauth_windows.go
Normal file
19
services/auth/sspiauth_windows.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//go:build windows
|
||||
|
||||
package auth
|
||||
|
||||
import (
|
||||
"github.com/quasoft/websspi"
|
||||
)
|
||||
|
||||
type SSPIUserInfo = websspi.UserInfo
|
||||
|
||||
func sspiAuthInit() error {
|
||||
var err error
|
||||
config := websspi.NewConfig()
|
||||
sspiAuth, err = websspi.New(config)
|
||||
return err
|
||||
}
|
Reference in New Issue
Block a user