Documentation
¶
Overview ¶
internal/auth/auth.go
internal/auth/credentials.go
internal/auth/users.go
Index ¶
- func ChangeUserPassword(username, currentPassword, newPassword string, isSuperuser bool) error
- func CreateUser(req models.UserCreateRequest) error
- func DeleteUser(username string) error
- func GenerateJWT(username string) (string, error)
- func GetAllUsers() ([]models.UserDetails, error)
- func GetUserDetails(username string) (models.UserDetails, error)
- func InitAuth()
- func IsUserInGroup(username string, targetGroupName string) (bool, error)
- func UpdateUser(username string, req models.UserUpdateRequest) error
- func ValidateCredentials(username, password string) (bool, error)
- type Claims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeUserPassword ¶ added in v0.1.4
ChangeUserPassword changes a user's password
func CreateUser ¶ added in v0.1.4
func CreateUser(req models.UserCreateRequest) error
CreateUser creates a new Linux user with the specified details
func DeleteUser ¶ added in v0.1.4
DeleteUser deletes the specified user from the system
func GenerateJWT ¶
GenerateJWT creates a new JWT for a given username
func GetAllUsers ¶ added in v0.1.4
func GetAllUsers() ([]models.UserDetails, error)
GetAllUsers returns a list of all system users that are relevant to the API Filters out system accounts or other internal users by their UID ranges
func GetUserDetails ¶ added in v0.1.4
func GetUserDetails(username string) (models.UserDetails, error)
GetUserDetails retrieves detailed information about a specific user
func InitAuth ¶ added in v0.1.5
func InitAuth()
InitAuth initializes the auth package with the current server start time
func IsUserInGroup ¶
IsUserInGroup checks if a Linux user is a member of a specific group. Returns false, nil if the group doesn't exist or the user isn't in it. Returns false, error for actual system errors during lookup.
func UpdateUser ¶ added in v0.1.4
func UpdateUser(username string, req models.UserUpdateRequest) error
UpdateUser updates the specified user's information
func ValidateCredentials ¶
ValidateCredentials checks if the Linux user exists, validates the password using PAM, and verifies membership in EITHER the requiredAdminGroup OR the configured APIUserGroup.