auth

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

internal/auth/credentials.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWT

func GenerateJWT(username string) (string, error)

GenerateJWT creates a new JWT for a given username

func IsUserInGroup

func IsUserInGroup(username string, targetGroupName string) (bool, error)

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 ValidateCredentials

func ValidateCredentials(username, password string) (bool, error)

ValidateCredentials checks if the Linux user exists, validates the password using PAM, and verifies membership in EITHER the requiredAdminGroup OR the configured APIUserGroup.

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.RegisteredClaims
}

func ValidateJWT

func ValidateJWT(tokenString string) (*Claims, error)

ValidateJWT checks the validity of a JWT string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL