taldir

Directory service to resolve wallet mailboxes by messenger addresses
Log | Files | Refs | Submodules | README | LICENSE

commit bc7c627f5cae762e4bfa30f11e81013701d2d51a
parent 23941641905b99d4980e13ce00f94e6df872f5b8
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Sun, 17 Jul 2022 17:37:21 +0200

cleanup

Diffstat:
Mpkg/rest/taldir.go | 20--------------------
1 file changed, 0 insertions(+), 20 deletions(-)

diff --git a/pkg/rest/taldir.go b/pkg/rest/taldir.go @@ -211,20 +211,6 @@ type validation struct { } -type validationMetadata struct { - // ORM - gorm.Model `json:"-"` - - // The hash (SHA512) of the address - HAddress string `json:"h_address"` - - // When does this validation timeframe begin (for retry calculation) - TimeframeStart time.Time - - // How often was this validation re-initiated for this address - InitiationCount int -} - // ErrorDetail is the detailed error payload returned from Taldir endpoints type ErrorDetail struct { @@ -459,7 +445,6 @@ func (t *Taldir) registerRequest(w http.ResponseWriter, r *http.Request){ t.Db.Delete(&validation) return } - // FIXME try to avoid validationMetadata err = t.Db.First(&validation, "h_address = ? AND public_key = ? AND inbox = ? AND duration = ?", hAddress, req.PublicKey, req.Inbox, reqDuration).Error validationExists := (nil == err) @@ -604,7 +589,6 @@ func (t *Taldir) validationPage(w http.ResponseWriter, r *http.Request) { func (t *Taldir) ClearDatabase() { t.Db.Where("1 = 1").Delete(&entry{}) t.Db.Where("1 = 1").Delete(&validation{}) - t.Db.Where("1 = 1").Delete(&validationMetadata{}) } func (t *Taldir) termsResponse(w http.ResponseWriter, r *http.Request) { @@ -770,10 +754,6 @@ func (t *Taldir) Initialize(cfgfile string) { if err := t.Db.AutoMigrate(&validation{}); err != nil { panic(err) } - if err := t.Db.AutoMigrate(&validationMetadata{}); err != nil { - panic(err) - } - // Clean up validations validationExpStr := t.Cfg.Section("taldir").Key("validation_expiration").MustString("24h")