forked from Silverfish/proton-bridge
fix(GODT-2913): Reduce the number of configuration failure detected.
This commit is contained in:
@ -119,8 +119,9 @@ func (s *Connector) Init(_ context.Context, cache connector.IMAPState) error {
|
||||
}
|
||||
|
||||
func (s *Connector) Authorize(ctx context.Context, username string, password []byte) bool {
|
||||
addrID, err := s.identityState.CheckAuth(username, password, s.telemetry)
|
||||
addrID, err := s.identityState.CheckAuth(username, password)
|
||||
if err != nil {
|
||||
s.telemetry.ReportConfigStatusFailure("IMAP " + err.Error())
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +48,7 @@ type EventProvider interface {
|
||||
type Telemetry interface {
|
||||
useridentity.Telemetry
|
||||
SendConfigStatusSuccess(ctx context.Context)
|
||||
ReportConfigStatusFailure(errDetails string)
|
||||
}
|
||||
|
||||
type GluonIDProvider interface {
|
||||
|
||||
@ -32,7 +32,7 @@ type sharedIdentity interface {
|
||||
GetPrimaryAddress() (proton.Address, error)
|
||||
GetAddresses() []proton.Address
|
||||
WithAddrKR(addrID string, fn func(userKR, addrKR *crypto.KeyRing) error) error
|
||||
CheckAuth(email string, password []byte, telemetry Telemetry) (string, error)
|
||||
CheckAuth(email string, password []byte) (string, error)
|
||||
}
|
||||
|
||||
type rwIdentity struct {
|
||||
@ -102,11 +102,11 @@ func (r *rwIdentity) WithAddrKRs(fn func(*crypto.KeyRing, map[string]*crypto.Key
|
||||
return r.identity.WithAddrKRs(r.keyPassProvider.KeyPass(), fn)
|
||||
}
|
||||
|
||||
func (r *rwIdentity) CheckAuth(email string, password []byte, telemetry Telemetry) (string, error) {
|
||||
func (r *rwIdentity) CheckAuth(email string, password []byte) (string, error) {
|
||||
r.lock.RLock()
|
||||
defer r.lock.RUnlock()
|
||||
|
||||
return r.identity.CheckAuth(email, password, r.bridgePassProvider, telemetry)
|
||||
return r.identity.CheckAuth(email, password, r.bridgePassProvider)
|
||||
}
|
||||
|
||||
func (r *rwIdentity) Write(f func(identity *useridentity.State) error) error {
|
||||
|
||||
Reference in New Issue
Block a user