Skip to content

Commit 3a4caad

Browse files
committed
addapt
1 parent cb58026 commit 3a4caad

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

modules/auth/sso/oauth2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212

1313
"code.gitea.io/gitea/models"
1414
"code.gitea.io/gitea/modules/log"
15-
"code.gitea.io/gitea/modules/middlewares"
1615
"code.gitea.io/gitea/modules/timeutil"
16+
"code.gitea.io/gitea/modules/web/middleware"
1717
)
1818

1919
// Ensure the struct implements the interface.
@@ -122,7 +122,7 @@ func (o *OAuth2) VerifyAuthData(req *http.Request, w http.ResponseWriter, store
122122
return nil
123123
}
124124

125-
if middlewares.IsInternalPath(req) || !middlewares.IsAPIPath(req) && !isAttachmentDownload(req) {
125+
if middleware.IsInternalPath(req) || !middleware.IsAPIPath(req) && !isAttachmentDownload(req) {
126126
return nil
127127
}
128128

modules/auth/sso/sspi_windows.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
"code.gitea.io/gitea/models"
1313
"code.gitea.io/gitea/modules/base"
1414
"code.gitea.io/gitea/modules/log"
15-
"code.gitea.io/gitea/modules/middlewares"
1615
"code.gitea.io/gitea/modules/setting"
1716
"code.gitea.io/gitea/modules/templates"
17+
"code.gitea.io/gitea/modules/web/middleware"
1818

1919
gouuid "github.com/google/uuid"
2020
"github.com/quasoft/websspi"
@@ -136,7 +136,7 @@ func (s *SSPI) VerifyAuthData(req *http.Request, w http.ResponseWriter, store Da
136136
}
137137

138138
// Make sure requests to API paths and PWA resources do not create a new session
139-
if !middlewares.IsAPIPath(req) && !isAttachmentDownload(req) {
139+
if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) {
140140
handleSignIn(w, req, sess, user)
141141
}
142142

@@ -167,9 +167,9 @@ func (s *SSPI) shouldAuthenticate(req *http.Request) (shouldAuth bool) {
167167
} else if req.FormValue("auth_with_sspi") == "1" {
168168
shouldAuth = true
169169
}
170-
} else if middlewares.IsInternalPath(req) {
170+
} else if middleware.IsInternalPath(req) {
171171
shouldAuth = false
172-
} else if middlewares.IsAPIPath(req) || isAttachmentDownload(req) {
172+
} else if middleware.IsAPIPath(req) || isAttachmentDownload(req) {
173173
shouldAuth = true
174174
}
175175
return

modules/middlewares/request.go renamed to modules/web/middleware/request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package middlewares
5+
package middleware
66

77
import (
88
"net/http"

0 commit comments

Comments
 (0)