mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-04 17:06:49 +00:00
New lint rules
This commit is contained in:
@ -9,7 +9,7 @@ var currentKeys KeysModel
|
||||
|
||||
// KeysModel is the model
|
||||
type KeysModel struct {
|
||||
model.ModelBase
|
||||
model.Base
|
||||
PublicKey string `gorm:"column:public_key"`
|
||||
PrivateKey string `gorm:"column:private_key"`
|
||||
}
|
||||
@ -19,7 +19,7 @@ func (KeysModel) TableName() string {
|
||||
return "jwt_keys"
|
||||
}
|
||||
|
||||
// LoadByID will load from an ID
|
||||
// LoadLatest will load the latest keys
|
||||
func (m *KeysModel) LoadLatest() error {
|
||||
db := database.GetDB()
|
||||
result := db.Order("created_at DESC").First(&m)
|
||||
|
@ -183,7 +183,7 @@ func (s *testsuite) TestGetPrivateKey() {
|
||||
|
||||
// Set currentKeys and try again
|
||||
currentKeys = KeysModel{
|
||||
ModelBase: model.ModelBase{
|
||||
Base: model.Base{
|
||||
ID: 10,
|
||||
},
|
||||
PrivateKey: s.privateKeyString,
|
||||
@ -210,7 +210,7 @@ func (s *testsuite) TestGetPublicKey() {
|
||||
|
||||
// Set currentKeys and try again
|
||||
currentKeys = KeysModel{
|
||||
ModelBase: model.ModelBase{
|
||||
Base: model.Base{
|
||||
ID: 10,
|
||||
},
|
||||
PrivateKey: s.privateKeyString,
|
||||
@ -228,7 +228,7 @@ func (s *testsuite) TestGenerate() {
|
||||
defer goleak.VerifyNone(s.T(), goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
currentKeys = KeysModel{
|
||||
ModelBase: model.ModelBase{
|
||||
Base: model.Base{
|
||||
ID: 10,
|
||||
},
|
||||
PrivateKey: s.privateKeyString,
|
||||
@ -236,7 +236,7 @@ func (s *testsuite) TestGenerate() {
|
||||
}
|
||||
|
||||
usr := user.Model{
|
||||
ModelBase: model.ModelBase{
|
||||
Base: model.Base{
|
||||
ID: 10,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user