auth

package
v0.0.0-...-92f319c Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CTXUID = "uid"

Functions

func BuildAuthFunc

func BuildAuthFunc() grpc_auth.AuthFunc

func Config

func Config(opts *Options)

func GenerateAuthToken

func GenerateAuthToken(uid int64) (string, error)

Types

type Auth

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

func (*Auth) AuthFunc

func (a *Auth) AuthFunc(ctx context.Context) (context.Context, error)

func (*Auth) GenerateAuth

func (a *Auth) GenerateAuth(uid int64) (string, error)

type Claims

type Claims struct {
	UID      int64 `json:"uid"`
	ExpireAt int64 `json:"expire_at"`
}

func (*Claims) Valid

func (c *Claims) Valid() error

type Options

type Options struct {
	Secret            string
	HeaderAuthorize   string
	EffectiveDuration int
}

Jump to

Keyboard shortcuts

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