/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/entity/passcode_json.go
33 строки
965 B
Michael Mayer
Security: Add gosec fixes with shared URL and fs validation helpers
03 мар 2026, 18:38
03 мар 2026, 18:38
f2aabb9
Код
Авторство
О чём код?
package entity import ( "encoding/json" "time" "github.com/photoprism/photoprism/pkg/media" ) // MarshalJSON returns the JSON encoding. func (m *Passcode) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { UID string `json:"UID"` Type string `json:"Type"` Secret string `json:"Secret"` //nolint:gosec // G117: Expected passcode secret response field. QRCode string `json:"QRCode"` RecoveryCode string `json:"RecoveryCode"` CreatedAt time.Time `json:"CreatedAt"` UpdatedAt time.Time `json:"UpdatedAt"` VerifiedAt *time.Time `json:"VerifiedAt"` ActivatedAt *time.Time `json:"ActivatedAt"` }{ UID: m.UID, Type: m.KeyType, Secret: m.Secret(), QRCode: media.DataUrl(m.Png(350)), RecoveryCode: m.RecoveryCode, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, VerifiedAt: m.VerifiedAt, ActivatedAt: m.ActivatedAt, }) }