jwtauth

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyInfoNotFound = fmt.Errorf("key info not found")
)

Functions

This section is empty.

Types

type APIAlg

type APIAlg jwt3.HMACSHA

type AuthMux added in v0.9.4

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

func NewAuthMux added in v0.9.4

func NewAuthMux(jwtCli IJwtAuthClient, serveMux *http.ServeMux) *AuthMux

func (*AuthMux) ServeHTTP added in v0.9.4

func (authMux *AuthMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*AuthMux) TrustHandle added in v0.9.4

func (authMux *AuthMux) TrustHandle(pattern string, handler http.Handler)

type IJwtAuthAPI added in v0.9.4

type IJwtAuthAPI interface {
	Verify(ctx context.Context, spanID, serviceName, preHost, host, token string) ([]auth.Permission, error)
	AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)
}

type IJwtAuthClient added in v0.9.4

type IJwtAuthClient interface {
	API() IJwtAuthAPI
	Verify(ctx context.Context, spanID, serviceName, preHost, host, token string) ([]auth.Permission, error)
}

type JwtAuth

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

func NewJwtAuth

func NewJwtAuth(lr repo.Repo) (*JwtAuth, error)

func (*JwtAuth) API

func (jwtAuth *JwtAuth) API() IJwtAuthAPI

func (*JwtAuth) Verify added in v0.9.4

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

type JwtAuthAPI

type JwtAuthAPI struct {
	JwtAuth *JwtAuth
}

func (*JwtAuthAPI) AuthNew

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

func (*JwtAuthAPI) Verify added in v0.9.4

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

type JwtPayload

type JwtPayload struct {
	Allow []auth.Permission
}

type RemoteAuth added in v0.9.4

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

func NewRemoteAuth added in v0.9.4

func NewRemoteAuth(url string) *RemoteAuth

func (*RemoteAuth) API added in v0.9.4

func (r *RemoteAuth) API() IJwtAuthAPI

func (*RemoteAuth) Verify added in v0.9.4

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

type RemoteJwtAuthAPI added in v0.9.4

type RemoteJwtAuthAPI struct {
	JwtAuth IJwtAuthClient
}

func (*RemoteJwtAuthAPI) AuthNew added in v0.9.4

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

func (*RemoteJwtAuthAPI) Verify added in v0.9.4

func (a *RemoteJwtAuthAPI) Verify(ctx context.Context, spanID, serviceName, preHost, host, token string) ([]auth.Permission, error)

Jump to

Keyboard shortcuts

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