endpoint

package
v0.0.0-...-2816995 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

View Source
const (
	OAuth2DetailsKey       = "OAuth2Details"
	OAuth2ClientDetailsKey = "OAuth2ClientDetails"
	OAuth2ErrorKey         = "OAuth2Error"
)

Variables

View Source
var (
	ErrInvalidClientRequest = errors.New("invalid client message")
	ErrInvalidUserRequest   = errors.New("invalid user message")
	ErrNotPermit            = errors.New("not permit")
)

Functions

func MakeAuthorityAuthorizationMiddleware

func MakeAuthorityAuthorizationMiddleware(authority string, logger log.Logger) endpoint.Middleware

func MakeCheckTokenEndpoint

func MakeCheckTokenEndpoint(svc service.TokenService) endpoint.Endpoint

func MakeClientAuthorizationMiddleware

func MakeClientAuthorizationMiddleware(logger log.Logger) endpoint.Middleware

func MakeHealthCheckEndpoint

func MakeHealthCheckEndpoint(svc service.Service) endpoint.Endpoint

MakeHealthCheckEndpoint 创建健康检查Endpoint

func MakeOAuth2AuthorizationMiddleware

func MakeOAuth2AuthorizationMiddleware(logger log.Logger) endpoint.Middleware

func MakeTokenEndpoint

func MakeTokenEndpoint(svc service.TokenGranter, clientService service.ClientDetailsService) endpoint.Endpoint

make endpoint

Types

type AdminRequest

type AdminRequest struct {
}

type AdminResponse

type AdminResponse struct {
	Result string `json:"result"`
	Error  string `json:"error"`
}

type CheckTokenRequest

type CheckTokenRequest struct {
	Token         string
	ClientDetails model.ClientDetails
}

type CheckTokenResponse

type CheckTokenResponse struct {
	OAuthDetails *model.OAuth2Details `json:"o_auth_details"`
	Error        string               `json:"error"`
}

type HealthRequest

type HealthRequest struct{}

HealthRequest 健康检查请求结构

type HealthResponse

type HealthResponse struct {
	Status bool `json:"status"`
}

HealthResponse 健康检查响应结构

type OAuth2Endpoints

type OAuth2Endpoints struct {
	TokenEndpoint          endpoint.Endpoint
	CheckTokenEndpoint     endpoint.Endpoint
	GRPCCheckTokenEndpoint endpoint.Endpoint
	HealthCheckEndpoint    endpoint.Endpoint
}

CalculateEndpoint define endpoint

type SimpleRequest

type SimpleRequest struct {
}

type SimpleResponse

type SimpleResponse struct {
	Result string `json:"result"`
	Error  string `json:"error"`
}

type TokenRequest

type TokenRequest struct {
	GrantType string
	Reader    *http.Request
}

type TokenResponse

type TokenResponse struct {
	AccessToken *model.OAuth2Token `json:"access_token"`
	Error       string             `json:"error"`
}

Jump to

Keyboard shortcuts

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