Documentation ¶
Index ¶
Constants ¶
View Source
const (
JWTKey = "openapi_oauth2_token_secret"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JWTAccessClaims ¶
type JWTAccessClaims struct { jwt.StandardClaims Payload apistructs.OpenapiOAuth2TokenPayload `json:"payload"` }
JWTAccessClaims jwt claims
func ParseJWTAccess ¶
func ParseJWTAccess(access string) (*JWTAccessClaims, error)
type JWTAccessGenerate ¶
type JWTAccessGenerate struct { SignedKey []byte SignedMethod jwt.SigningMethod }
JWTAccessGenerate generate the jwt access token
func NewJWTAccessGenerate ¶
func NewJWTAccessGenerate(key []byte, method jwt.SigningMethod) *JWTAccessGenerate
NewJWTAccessGenerate create to generate the jwt access token instance
type OAuth2Server ¶
type OAuth2Server struct {
// contains filtered or unexported fields
}
func NewOAuth2Server ¶
func NewOAuth2Server() *OAuth2Server
func (*OAuth2Server) InvalidateToken ¶
func (o *OAuth2Server) InvalidateToken(w http.ResponseWriter, r *http.Request)
{{openapi}}/oauth2/invalidate_token?access_token=xxx
func (*OAuth2Server) Server ¶
func (o *OAuth2Server) Server() *server.Server
func (*OAuth2Server) Token ¶
func (o *OAuth2Server) Token(w http.ResponseWriter, r *http.Request)
{{openapi}}/oauth2/token?grant_type=client_credentials&client_id=pipeline&client_secret=devops/pipeline&scope=read
func (*OAuth2Server) ValidateToken ¶
func (o *OAuth2Server) ValidateToken(w http.ResponseWriter, r *http.Request)
{{openapi}}/oauth2/validate_token?access_token=xxx
Click to show internal directories.
Click to hide internal directories.