Ai
2 Star 0 Fork 0

carlmax_my/console-core-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model.go 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
carlmax_my 提交于 2024-12-02 21:32 +08:00 . init project
package jwt
import (
"github.com/golang-jwt/jwt/v5"
)
// Custom claims structure
type CustomClaims struct {
jwt.RegisteredClaims
BaseClaims
BufferTime int64 `json:"buffer_time,omitempty"` //
}
// if put user info to redis/cache, then we can use less props, more props can get from cache/db
// if didn't use cache, then we can add more props here
// more props means the jwt string will become large
type BaseClaims struct {
UserId string `json:"user_id"` //
Username string `json:"username"` //
Roles string `json:"roles,omitempty"` //
Groups string `json:"groups,omitempty"` //
TenantId string `json:"tenant_id,omitempty"` // our's
From uint8 `json:"from,omitempty"` // login from
UserIdInIdp string `json:"user_id_in_idp,omitempty"` // authing use sub as user id,
Idp string `json:"idp,omitempty"` //
Unionid string `json:"unionid,omitempty"` // only used for parsing third jwt string
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/carlmax_my/console-core-go.git
git@gitee.com:carlmax_my/console-core-go.git
carlmax_my
console-core-go
console-core-go
v0.1.108

搜索帮助