-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bugfix/ignore-specified-account
- Loading branch information
Showing
9 changed files
with
72 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2023 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
//go:build !windows | ||
|
||
package auth | ||
|
||
import ( | ||
"errors" | ||
"net/http" | ||
) | ||
|
||
type SSPIUserInfo struct { | ||
Username string // Name of user, usually in the form DOMAIN\User | ||
Groups []string // The global groups the user is a member of | ||
} | ||
|
||
type sspiAuthMock struct{} | ||
|
||
func (s sspiAuthMock) AppendAuthenticateHeader(w http.ResponseWriter, data string) { | ||
} | ||
|
||
func (s sspiAuthMock) Authenticate(r *http.Request, w http.ResponseWriter) (userInfo *SSPIUserInfo, outToken string, err error) { | ||
return nil, "", errors.New("not implemented") | ||
} | ||
|
||
func sspiAuthInit() error { | ||
sspiAuth = &sspiAuthMock{} // TODO: we can mock the SSPI auth in tests | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |