first commit

This commit is contained in:
Yangtao
2025-11-18 17:48:20 +08:00
commit 6e56cab848
196 changed files with 65809 additions and 0 deletions

12
pkg/secure/jwt_test.go Normal file
View File

@ -0,0 +1,12 @@
package secure
import (
"fmt"
"testing"
)
func TestVerifyToken(t *testing.T) {
ts := "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Inlhbmd0YW8iLCJuaWNrbmFtZSI6IuadqOeEmCIsImlzcyI6InpreHFncm91cC5jb20iLCJzdWIiOiJhZjBmNzM4OGM0MDk0MWQzYmU5NTdiYmExM2RkMzExYiIsImV4cCI6MTY4NDkxMjAwNCwibmJmIjoxNjg0ODI1NjA0LCJpYXQiOjE2ODQ4MjU2MDQsImp0aSI6IjkyNzIzMDM0NGE5MTQ0MTU4OTQyYWI4YmQ2MzkwMmQ2In0.58aFVo5FyTem4Fc2PZVBVEB-0DO2hhHuJ34ASGZQh1Cmd3peD5V5scWPdtx3wF3FAkXG_uE-o9smboGeuqscKQ"
gotAccess, gotClaims, err := VerifyToken(ts, "")
fmt.Printf("%v %v %v\n", gotAccess, gotClaims, err)
}