Skip to content

Commit

Permalink
v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sim-wangyan committed Jan 25, 2024
1 parent f76e64d commit 5fec116
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions jwtant.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func CreateConfig() *Config {
return &Config{}
}

type jwtant struct {
type Jwtant struct {
name string
next http.Handler
pathParses []PathParse
Expand Down Expand Up @@ -93,7 +93,7 @@ func New(_ context.Context, next http.Handler, config *Config, name string) (htt

}

return &jwtant{
return &Jwtant{
name: name,
next: next,
pathParses: pathParses,
Expand All @@ -102,7 +102,7 @@ func New(_ context.Context, next http.Handler, config *Config, name string) (htt
}, nil
}

func (ja *jwtant) filter1Star(currentPath string, parse PathParse) bool {
func (ja *Jwtant) filter1Star(currentPath string, parse PathParse) bool {

if parse.OneStar.has1Star {

Expand Down Expand Up @@ -138,7 +138,7 @@ func (ja *jwtant) filter1Star(currentPath string, parse PathParse) bool {
return false
}

func (ja *jwtant) filter2StarSuffix(currentPath string, parse PathParse) bool {
func (ja *Jwtant) filter2StarSuffix(currentPath string, parse PathParse) bool {
if parse.TwoStarSuffix.endWith2Star {

if ja.filter1Star(currentPath, parse) {
Expand All @@ -153,7 +153,7 @@ func (ja *jwtant) filter2StarSuffix(currentPath string, parse PathParse) bool {
return false
}

func (ja *jwtant) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
func (ja *Jwtant) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
currentPath := req.URL.EscapedPath()

if currentPath == "/" {
Expand Down Expand Up @@ -189,7 +189,7 @@ func (ja *jwtant) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
}
}

func (ja *jwtant) verifyJwt(rw http.ResponseWriter, req *http.Request) bool {
func (ja *Jwtant) verifyJwt(rw http.ResponseWriter, req *http.Request) bool {

token := req.Header.Get(ja.headerKey)
if token == "" {
Expand Down

0 comments on commit 5fec116

Please sign in to comment.