jwtauth

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJwtAuth

func NewJwtAuth(lr repo.Repo) (vjc.IJwtAuthClient, error)

Types

type APIAlg

type APIAlg jwt3.HMACSHA

type JwtAuth

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

JwtAuth auth through local token

func (*JwtAuth) Verify added in v0.9.4

func (jwtAuth *JwtAuth) Verify(ctx context.Context, token string) ([]auth.Permission, error)

Verify verify token from request

type JwtPayload

type JwtPayload struct {
	Allow []auth.Permission
}

type RemoteAuth added in v0.9.4

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

RemoteAuth in remote verification mode, venus connects venus-auth service, and verifies whether token is legal through rpc

func NewRemoteAuth added in v0.9.4

func NewRemoteAuth(url string) *RemoteAuth

NewRemoteAuth new remote auth client from venus-auth url

func (*RemoteAuth) GetUserLimit added in v1.0.3

func (r *RemoteAuth) GetUserLimit(name, service, api string) (*ratelimit.Limit, error)

func (*RemoteAuth) Verify added in v0.9.4

func (r *RemoteAuth) Verify(ctx context.Context, token string) ([]auth.Permission, error)

Verify check token through venus-auth rpc api

type ValueFromCtx added in v1.0.1

type ValueFromCtx struct{}

func (*ValueFromCtx) AccFromCtx added in v1.0.1

func (vfc *ValueFromCtx) AccFromCtx(ctx context.Context) (string, bool)

func (*ValueFromCtx) HostFromCtx added in v1.0.1

func (vfc *ValueFromCtx) HostFromCtx(ctx context.Context) (string, bool)

Jump to

Keyboard shortcuts

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