package config
import "chainweaver.org.cn/chainweaver/servicecommon/encrypt"
type Service struct {
Issuer string `mapstructure:"issuer" json:"issuer"`
Holder string `mapstructure:"holder" json:"holder"`
Did string `mapstructure:"did" json:"did"`
Authority string `mapstructure:"authority" json:"authority"` //机构路由
Kms string `mapstructure:"kms" json:"kms"` //kms服务路由
Tdh string `mapstructure:"tdh" json:"tdh"` //存证服务
TdhProxy string `mapstructure:"tdhProxy" json:"tdhProxy"` //存证代理路由服务
DidProxy string `mapstructure:"didProxy" json:"didProxy"` //did代理路由服务
AuthorityProxy string `mapstructure:"authorityProxy" json:"authorityProxy"` //机构代理路由
}
// Jwt jwt相关配置
type Jwt struct {
ExpiresTime int64 `mapstructure:"expires_time" json:"expiresTime"` // token过期时间
Issuer string `mapstructure:"issuer" json:"issuer"` // 签名者
Key string `mapstructure:"key" json:"key"` // 密钥
}
func (j Jwt) GetKey() string {
dkey, err := encrypt.DecryptString(j.Key)
if err != nil {
panic("decrypt Jwt key error:" + err.Error())
}
return dkey
}
-
DevinZeng authored
--story=1
800f242a