mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-14 19:22:09 +09:00
feat: Add audit logging (#38189)
Co-authored-by: bircni <bircni@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -90,6 +90,32 @@ func NewDeployKeyUserWithKeyID(id int64) *User {
|
||||
return u
|
||||
}
|
||||
|
||||
const (
|
||||
CLIUserID int64 = -4
|
||||
CLIUserName = "CLI"
|
||||
)
|
||||
|
||||
func NewCLIUser() *User {
|
||||
return &User{
|
||||
ID: CLIUserID,
|
||||
Name: CLIUserName,
|
||||
LowerName: strings.ToLower(CLIUserName),
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
AuthenticationSourceUserID int64 = -5
|
||||
AuthenticationSourceUserName = "AuthenticationSource"
|
||||
)
|
||||
|
||||
func NewAuthenticationSourceUser() *User {
|
||||
return &User{
|
||||
ID: AuthenticationSourceUserID,
|
||||
Name: AuthenticationSourceUserName,
|
||||
LowerName: strings.ToLower(AuthenticationSourceUserName),
|
||||
}
|
||||
}
|
||||
|
||||
func GetSystemUserByName(name string) *User {
|
||||
lowerName := strings.ToLower(name)
|
||||
uid := globalVars().systemUserNameIdMap[lowerName]
|
||||
|
||||
Reference in New Issue
Block a user