auth_services

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const TOKEN_EXPIRY_DAYS = (7 * 24 * time.Hour) // 7 * 24 hours = 168 hours

Variables

This section is empty.

Functions

func AuthenticateClient added in v1.0.2

func AuthenticateClient(dbProps utils.Map, dataAuth utils.Map) (utils.Map, error)

func GetBasicAuth

func GetBasicAuth(ctx *fiber.Ctx) (string, string, error)

func ParseScope

func ParseScope(dataAuth utils.Map) utils.Map

func ValidateAuthCredential

func ValidateAuthCredential(dbProps utils.Map, dataAuth utils.Map) (utils.Map, error)

************************************************************************************* ** ** ValidateAuthCredentials: ** ** ** **************************************************************************************

func ValidateBearerAuth

func ValidateBearerAuth(ctx *fiber.Ctx, claims jwt.Claims) error

validateBearerAuth -- Authenticate Application Request

func ValidateInputParams

func ValidateInputParams(ctx *fiber.Ctx) (utils.Map, error)

Types

type Claims

type Claims struct {
	ClientType  string `json:"client_type"`
	ClientScope string `json:"client_scope"`
	ClientId    string `json:"client_id"`
	GrandType   string `json:"grant_type"`
	BusinessId  string `json:"business_id,omitempty"`
	UserId      string `json:"user_id,omitempty"`
	TokenString string `json:"token_string,omitempty"`

	jwt.RegisteredClaims
}

func AuthValidate

func AuthValidate(ctx *fiber.Ctx) (Claims, error)

func GetAuthToken

func GetAuthToken(authClaims Claims) Claims

func GetRefreshToken

func GetRefreshToken(ctx *fiber.Ctx) (Claims, error)

func Map2Claims

func Map2Claims(authData utils.Map) Claims

Jump to

Keyboard shortcuts

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