handler

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(user user.User, expiresIn, svcTokenID string) (string, error)

CreateToken creates a token for a user

func GetUserID

func GetUserID(r *http.Request) string

GetUserID returns the logged in user details

func MiddlewareAuthenticationVerification

func MiddlewareAuthenticationVerification(next http.Handler) http.Handler

MiddlewareAuthenticationVerification verifies user auth details

Types

type McApiContext added in v2.1.1

type McApiContext struct {
	Tenant string `json:"tenant" yaml:"tenant"`
	UserID string `json:"userId" yaml:"userId"`
}

struct used in api request

func IsValidToken

func IsValidToken(r *http.Request) (error, *McApiContext)

steps to verify the authentication 1. Verify the token in header 2. Verify the token in cookie

Jump to

Keyboard shortcuts

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