Skip to content
Snippets Groups Projects
Select Git revision
  • 5011f3fee43ba97c0f2e90bc6b226a7e07ebf29e
  • release default protected
  • 11-22-implement-kv-interface-defined-in-collectiveversionedkvgo
  • hotfix/TestHostPool_UpdateNdf_AddFilter
  • XX-4719/announcementChannels
  • xx-4717/logLevel
  • jonah/noob-channel
  • master protected
  • XX-4707/tagDiskJson
  • xx-4698/notification-retry
  • hotfix/notifylockup
  • syncNodes
  • hotfix/localCB
  • XX-4677/NewChanManagerMobile
  • XX-4689/DmSync
  • duplicatePrefix
  • XX-4601/HavenInvites
  • finalizedUICallbacks
  • XX-4673/AdminKeySync
  • debugNotifID
  • anne/test
  • v4.7.5
  • v4.7.4
  • v4.7.3
  • v4.7.2
  • v4.7.1
  • v4.6.3
  • v4.6.1
  • v4.5.0
  • v4.4.4
  • v4.3.11
  • v4.3.8
  • v4.3.7
  • v4.3.6
  • v4.3.5
  • v4.2.0
  • v4.3.0
  • v4.3.4
  • v4.3.3
  • v4.3.2
  • v4.3.1
41 results

makeGroup.go

Blame
  • reset.go 1.33 KiB
    package auth
    
    import (
    	jww "github.com/spf13/jwalterweatherman"
    	"gitlab.com/elixxir/crypto/contact"
    	"gitlab.com/elixxir/primitives/fact"
    	"gitlab.com/xx_network/primitives/id"
    )
    
    // Reset sends a contact reset request from the user identity in the imported e2e
    // structure to the passed contact, as well as the passed facts (will error if
    // they are too long).
    // This delete all traces of the relationship with the partner from e2e and
    // create a new relationship from scratch.
    // The round the reset is initially sent on will be returned, but the request
    // will be listed as a critical message, so the underlying cmix client will
    // auto resend it in the event of failure.
    // A request cannot be sent for a contact who has already received a request or
    // who is already a partner.
    func (s *state) Reset(partner contact.Contact) (id.Round, error) {
    
    	// Delete authenticated channel if it exists.
    	if err := s.e2e.DeletePartner(partner.ID); err != nil {
    		jww.WARN.Printf("Unable to delete partner when "+
    			"resetting session: %+v", err)
    	}
    
    	//clean any data which is present
    	_ = s.store.DeleteConfirmation(partner.ID)
    	_ = s.store.DeleteSentRequest(partner.ID)
    	_ = s.store.DeleteReceivedRequest(partner.ID)
    
    	_ = s.store.DeleteSentRequest(partner.ID)
    
    	// Try to initiate a clean session request
    	return s.request(partner, fact.FactList{}, true)
    }