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 JwtAuth ¶
type JwtAuth struct {
// contains filtered or unexported fields
}
JwtAuth auth through local token
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)
Click to show internal directories.
Click to hide internal directories.