auth

package
v0.0.0-...-effe250 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const GraphServiceTimeout = 8 * time.Hour

set the timeout for the graph service: 8 hours once the timeout is reached, the connection will be closed all requests running ngql will be failed, so keepping a long timeout is necessary, make the connection alive

Variables

View Source
var CtxUserInfoMap map[string]AuthData = make(map[string]AuthData)

Functions

func AuthMiddlewareWithCtx

func AuthMiddlewareWithCtx(svcCtx *svc.ServiceContext) rest.Middleware

func CreateToken

func CreateToken(authData *AuthData, config *config.Config) (string, error)

func IsSessionError

func IsSessionError(err error) bool

func ParseConnectDBParams

func ParseConnectDBParams(params *types.ConnectDBParams, config *config.Config) (string, error)

Types

type AuthData

type AuthData struct {
	Address  string `json:"address"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	NSID     string `json:"nsid,optional"`
}

func Decode

func Decode(tokenString, secret string) (*AuthData, error)

type CtxKeyUserInfo

type CtxKeyUserInfo struct{}

Jump to

Keyboard shortcuts

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