()
| 79 | } |
| 80 | |
| 81 | func initParams() *jwt.GinJWTMiddleware { |
| 82 | return &jwt.GinJWTMiddleware{ |
| 83 | Realm: "test zone", |
| 84 | Key: []byte("secret key"), |
| 85 | Timeout: time.Hour, |
| 86 | MaxRefresh: time.Hour, |
| 87 | IdentityKey: identityKey, |
| 88 | PayloadFunc: payloadFunc(), |
| 89 | |
| 90 | IdentityHandler: identityHandler(), |
| 91 | Authenticator: authenticator(), |
| 92 | Authorizer: authorizator(), |
| 93 | Unauthorized: unauthorized(), |
| 94 | LogoutResponse: logoutResponse(), |
| 95 | TokenLookup: "header: Authorization, query: token, cookie: jwt", |
| 96 | // TokenLookup: "query:token", |
| 97 | // TokenLookup: "cookie:token", |
| 98 | TokenHeadName: "Bearer", |
| 99 | TimeFunc: time.Now, |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | func payloadFunc() func(data any) gojwt.MapClaims { |
| 104 | return func(data any) gojwt.MapClaims { |
no test coverage detected
searching dependent graphs…