diff --git a/bindings/e2e.go b/bindings/e2e.go index 8820d59f9fed3ae4c3f120dec040b7c857ddfa94..bd849f9ad1304b14b6eaa3a20e8177059c82c7d6 100644 --- a/bindings/e2e.go +++ b/bindings/e2e.go @@ -7,7 +7,6 @@ package bindings import ( - jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/cmix/identity/receptionID" "gitlab.com/elixxir/client/cmix/rounds" "gitlab.com/elixxir/client/xxdk" @@ -49,7 +48,7 @@ func LoginE2e(cmixId int, callbacks AuthCallbacks, identity []byte) (*E2e, error var authCallbacks xxdk.AuthCallbacks if callbacks == nil { - authCallbacks = defaultAuthCallbacks{} + authCallbacks = xxdk.DefaultAuthCallbacks{} } else { authCallbacks = &authCallback{bindingsCbs: callbacks} } @@ -78,7 +77,7 @@ func LoginE2eEphemeral(cmixId int, callbacks AuthCallbacks, identity []byte) (*E var authCallbacks xxdk.AuthCallbacks if callbacks == nil { - authCallbacks = defaultAuthCallbacks{} + authCallbacks = xxdk.DefaultAuthCallbacks{} } else { authCallbacks = &authCallback{bindingsCbs: callbacks} } @@ -103,7 +102,7 @@ func LoginE2eLegacy(cmixId int, callbacks AuthCallbacks) (*E2e, error) { var authCallbacks xxdk.AuthCallbacks if callbacks == nil { - authCallbacks = defaultAuthCallbacks{} + authCallbacks = xxdk.DefaultAuthCallbacks{} } else { authCallbacks = &authCallback{bindingsCbs: callbacks} } @@ -162,25 +161,3 @@ func (a *authCallback) Reset(partner contact.Contact, receptionID receptionID.EphemeralIdentity, round rounds.Round, _ *xxdk.E2e) { a.bindingsCbs.Reset(convertAuthCallbacks(partner, receptionID, round)) } - -// defaultAuthCallbacks is a simple structure for providing a default Callbacks implementation -// It should generally not be used. -type defaultAuthCallbacks struct{} - -// Confirm will be called when an auth Confirm message is processed. -func (a defaultAuthCallbacks) Confirm(contact.Contact, - receptionID.EphemeralIdentity, rounds.Round, *xxdk.E2e) { - jww.ERROR.Printf("No valid auth callback assigned!") -} - -// Request will be called when an auth Request message is processed. -func (a defaultAuthCallbacks) Request(contact.Contact, - receptionID.EphemeralIdentity, rounds.Round, *xxdk.E2e) { - jww.ERROR.Printf("No valid auth callback assigned!") -} - -// Reset will be called when an auth Reset operation occurs. -func (a defaultAuthCallbacks) Reset(contact.Contact, - receptionID.EphemeralIdentity, rounds.Round, *xxdk.E2e) { - jww.ERROR.Printf("No valid auth callback assigned!") -} diff --git a/xxdk/e2e.go b/xxdk/e2e.go index 34271b2092203b14feb7b8efe6d44499221a9597..650428be9707f07cb0ce6a440f5004ac72785659 100644 --- a/xxdk/e2e.go +++ b/xxdk/e2e.go @@ -432,3 +432,25 @@ func (aca *authCallbacksAdapter) Reset(partner contact.Contact, receptionID receptionID.EphemeralIdentity, round rounds.Round) { aca.ac.Reset(partner, receptionID, round, aca.e2e) } + +// DefaultAuthCallbacks is a simple structure for providing a default Callbacks implementation +// It should generally not be used. +type DefaultAuthCallbacks struct{} + +// Confirm will be called when an auth Confirm message is processed. +func (a DefaultAuthCallbacks) Confirm(contact.Contact, + receptionID.EphemeralIdentity, rounds.Round, *E2e) { + jww.ERROR.Printf("No valid auth callback assigned!") +} + +// Request will be called when an auth Request message is processed. +func (a DefaultAuthCallbacks) Request(contact.Contact, + receptionID.EphemeralIdentity, rounds.Round, *E2e) { + jww.ERROR.Printf("No valid auth callback assigned!") +} + +// Reset will be called when an auth Reset operation occurs. +func (a DefaultAuthCallbacks) Reset(contact.Contact, + receptionID.EphemeralIdentity, rounds.Round, *E2e) { + jww.ERROR.Printf("No valid auth callback assigned!") +}