jwtauth

package
v1.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0, MIT Imports: 15 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 JwtAuthAPI

type JwtAuthAPI struct {
	JwtAuth *JwtAuth
}

func (*JwtAuthAPI) AuthNew

func (a *JwtAuthAPI) AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)

AuthNew create new token with specify permission for access venus

func (*JwtAuthAPI) Verify added in v0.9.4

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

Verify check the token is valid or not

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