Skip to content

Commit 5de17ab

Browse files
committed
Fix windows lint
1 parent 3cb1d69 commit 5de17ab

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

routers/api/v1/auth_windows.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44

55
package v1
66

7-
import auth_service "code.gitea.io/gitea/services/auth"
7+
import (
8+
"code.gitea.io/gitea/models/auth"
9+
auth_service "code.gitea.io/gitea/services/auth"
10+
)
811

12+
// specialAdd registers the SSPI auth method as the last method in the list.
13+
// The SSPI plugin is expected to be executed last, as it returns 401 status code if negotiation
14+
// fails (or if negotiation should continue), which would prevent other authentication methods
15+
// to execute at all.
916
func specialAdd(group *auth_service.Group) {
1017
if auth.IsSSPIEnabled() {
1118
group.Add(&auth_service.SSPI{})

routers/web/auth_windows.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import (
99
auth_service "code.gitea.io/gitea/services/auth"
1010
)
1111

12+
// specialAdd registers the SSPI auth method as the last method in the list.
13+
// The SSPI plugin is expected to be executed last, as it returns 401 status code if negotiation
14+
// fails (or if negotiation should continue), which would prevent other authentication methods
15+
// to execute at all.
1216
func specialAdd(group *auth_service.Group) {
1317
if auth.IsSSPIEnabled() {
1418
group.Add(&auth_service.SSPI{})

services/auth/sspi_windows.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,3 @@ func sanitizeUsername(username string, cfg *sspi.Source) string {
244244
username = replaceSeparators(username, cfg)
245245
return username
246246
}
247-
248-
// specialInit registers the SSPI auth method as the last method in the list.
249-
// The SSPI plugin is expected to be executed last, as it returns 401 status code if negotiation
250-
// fails (or if negotiation should continue), which would prevent other authentication methods
251-
// to execute at all.
252-
func specialInit() {
253-
if auth.IsSSPIEnabled() {
254-
Register(&SSPI{})
255-
}
256-
}

0 commit comments

Comments
 (0)