auth

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash compares a password with a hash.

func GenerateJWT

func GenerateJWT(userID, secret string, expireHours int) (string, error)

func HashPassword

func HashPassword(password string) (string, error)

HashPassword generates a bcrypt hash of the password.

Types

type GitLabHandler

type GitLabHandler struct {
	// contains filtered or unexported fields
}

func NewGitLabHandler

func NewGitLabHandler(cfg *config.Config, db *gorm.DB) *GitLabHandler

func (*GitLabHandler) Callback

func (h *GitLabHandler) Callback(c *gin.Context)

func (*GitLabHandler) Login

func (h *GitLabHandler) Login(c *gin.Context)

type MyCustomClaims

type MyCustomClaims struct {
	jwt.RegisteredClaims
}

func ValidateJWT

func ValidateJWT(tokenString, secret string) (*MyCustomClaims, error)

type OIDCClaims

type OIDCClaims struct {
	PreferredUsername string `json:"preferred_username"`
	Name              string `json:"name"`
	Picture           string `json:"picture"`
}

Jump to

Keyboard shortcuts

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