summaryrefslogtreecommitdiffstats
path: root/services/auth/sspiauth_posix.go
blob: 49b0ed4a52ac8f57f85f9ec1f92c6f3b2c8d8304 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
}