You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sspiauth_posix.go 732B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2023 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. //go:build !windows
  4. package auth
  5. import (
  6. "errors"
  7. "net/http"
  8. )
  9. type SSPIUserInfo struct {
  10. Username string // Name of user, usually in the form DOMAIN\User
  11. Groups []string // The global groups the user is a member of
  12. }
  13. type sspiAuthMock struct{}
  14. func (s sspiAuthMock) AppendAuthenticateHeader(w http.ResponseWriter, data string) {
  15. }
  16. func (s sspiAuthMock) Authenticate(r *http.Request, w http.ResponseWriter) (userInfo *SSPIUserInfo, outToken string, err error) {
  17. return nil, "", errors.New("not implemented")
  18. }
  19. func sspiAuthInit() error {
  20. sspiAuth = &sspiAuthMock{} // TODO: we can mock the SSPI auth in tests
  21. return nil
  22. }