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 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
type IJwtAuthAPI ¶ added in v0.9.4
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 (*JwtAuth) API ¶
func (jwtAuth *JwtAuth) API() IJwtAuthAPI
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)
Click to show internal directories.
Click to hide internal directories.