Skip to content

Commit

Permalink
Refactor AuthorizationChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
minhduc140583 committed Apr 14, 2024
1 parent 909e321 commit 7400a46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions authorization_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ type AuthorizationChecker struct {
CheckWhitelist func(id string, token string) bool
}

func NewDefaultAuthorizationChecker(verifyToken func(string, string) (bool, string, map[string]interface{}, int64, int64, error), secret string, key string, options ...string) *AuthorizationChecker {
func NewAuthorizationChecker(verifyToken func(string, string) (bool, string, map[string]interface{}, int64, int64, error), secret string, key string, options ...string) *AuthorizationChecker {
return NewAuthorizationCheckerWithIp(verifyToken, secret, "", nil, nil, key, options...)
}
func NewAuthorizationChecker(verifyToken func(string, string) (bool, string, map[string]interface{}, int64, int64, error), secret string, checkToken func(string, string, time.Time) string, key string, options ...string) *AuthorizationChecker {
func NewAuthorizationCheckerWithBlacklist(verifyToken func(string, string) (bool, string, map[string]interface{}, int64, int64, error), secret string, checkToken func(string, string, time.Time) string, key string, options ...string) *AuthorizationChecker {
return NewAuthorizationCheckerWithIp(verifyToken, secret, "", checkToken, nil, key, options...)
}
func NewAuthorizationCheckerWithWhitelist(verifyToken func(string, string) (bool, string, map[string]interface{}, int64, int64, error), secret string, checkToken func(string, string, time.Time) string, checkWhitelist func(string, string) bool, key string, options ...string) *AuthorizationChecker {
Expand Down

0 comments on commit 7400a46

Please sign in to comment.