mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08: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:
		@@ -8,6 +8,7 @@ import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	auth_model "code.gitea.io/gitea/models/auth"
 | 
			
		||||
	"code.gitea.io/gitea/models/perm"
 | 
			
		||||
	"code.gitea.io/gitea/models/unit"
 | 
			
		||||
	"code.gitea.io/gitea/modules/context"
 | 
			
		||||
@@ -92,7 +93,10 @@ func buildAuthGroup() *auth_service.Group {
 | 
			
		||||
	if setting.Service.EnableReverseProxyAuth {
 | 
			
		||||
		group.Add(&auth_service.ReverseProxy{})
 | 
			
		||||
	}
 | 
			
		||||
	specialAdd(group)
 | 
			
		||||
 | 
			
		||||
	if setting.IsWindows && auth_model.IsSSPIEnabled() {
 | 
			
		||||
		group.Add(&auth_service.SSPI{}) // it MUST be the last, see the comment of SSPI
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return group
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user