mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
feat(BRIDGE-366): Kill switch support for IMAP IDLE
This commit is contained in:
2
go.mod
2
go.mod
@ -7,7 +7,7 @@ toolchain go1.24.2
|
||||
require (
|
||||
github.com/0xAX/notificator v0.0.0-20220220101646-ee9b8921e557
|
||||
github.com/Masterminds/semver/v3 v3.2.0
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250516132429-a4b2de331311
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250528075147-f86b8e45326a
|
||||
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a
|
||||
github.com/ProtonMail/go-proton-api v0.4.1-0.20250417134000-e624a080f7ba
|
||||
github.com/ProtonMail/gopenpgp/v2 v2.8.2-proton
|
||||
|
||||
12
go.sum
12
go.sum
@ -36,14 +36,10 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE
|
||||
github.com/ProtonMail/bcrypt v0.0.0-20210511135022-227b4adcab57/go.mod h1:HecWFHognK8GfRDGnFQbW/LiV7A3MX3gZVs45vk5h8I=
|
||||
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf h1:yc9daCCYUefEs69zUkSzubzjBbL+cmOXgnmt9Fyd9ug=
|
||||
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf/go.mod h1:o0ESU9p83twszAU8LBeJKFAAMX14tISa0yk4Oo5TOqo=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250513141309-843796a505bc h1:2oppv7H5ZeFnRDohTbLZW5A8I1ylhoX2QEi3RtKxrLE=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250513141309-843796a505bc/go.mod h1:0/c03TzZPNiSgY5UDJK1iRDkjlDPwWugxTT6et2qDu8=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250514104052-2f93fdfc4850 h1:OFMVeakcDS9nHW5kQ/CuBXri84iPBqPgZFHz5Xs/8jo=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250514104052-2f93fdfc4850/go.mod h1:0/c03TzZPNiSgY5UDJK1iRDkjlDPwWugxTT6et2qDu8=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250515084749-4afe6a076ac4 h1:L1JeVS2op3VIcPKctS493+qOBFGhr488mMkYVSLr9eY=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250515084749-4afe6a076ac4/go.mod h1:0/c03TzZPNiSgY5UDJK1iRDkjlDPwWugxTT6et2qDu8=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250516132429-a4b2de331311 h1:8oEkpmF8PD7GyCQjmTto+4yhz4vE1tTT2djL2BgJcBI=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250516132429-a4b2de331311/go.mod h1:0/c03TzZPNiSgY5UDJK1iRDkjlDPwWugxTT6et2qDu8=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250516142615-1211bf144af5 h1:7vLMnvLacvKRNDwzdmgKmoWHZqrgauV8LSj9eWvn1jY=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250516142615-1211bf144af5/go.mod h1:0/c03TzZPNiSgY5UDJK1iRDkjlDPwWugxTT6et2qDu8=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250528075147-f86b8e45326a h1:kx9rudQK7JCtgtTLNaMvarYISzgtzAKfLC1g5vEKoQ4=
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20250528075147-f86b8e45326a/go.mod h1:0/c03TzZPNiSgY5UDJK1iRDkjlDPwWugxTT6et2qDu8=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230321155629-9a39f2531310/go.mod h1:8TI4H3IbrackdNgv+92dI+rhpCaLqM0IfpgCgenFvRE=
|
||||
github.com/ProtonMail/go-crypto v1.1.4-proton h1:KIo9uNlk3vzlwI7o5VjhiEjI4Ld1TDixOMnoNZyfpFE=
|
||||
github.com/ProtonMail/go-crypto v1.1.4-proton/go.mod h1:zNoyBJW3p/yVWiHNZgfTF9VsjwqYof5YY0M9kt2QaX0=
|
||||
|
||||
@ -335,6 +335,7 @@ func newBridge(
|
||||
uidValidityGenerator,
|
||||
&bridgeIMAPSMTPTelemetry{b: bridge},
|
||||
observabilityService,
|
||||
unleashService,
|
||||
)
|
||||
|
||||
// Check whether username has changed and correct (macOS only)
|
||||
|
||||
@ -38,6 +38,7 @@ import (
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/files"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/logging"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/services/observability"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/unleash"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -88,6 +89,7 @@ func newIMAPServer(
|
||||
uidValidityGenerator imap.UIDValidityGenerator,
|
||||
panicHandler async.PanicHandler,
|
||||
observabilitySender observability.Sender,
|
||||
featureFlagProvider unleash.FeatureFlagValueProvider,
|
||||
) (*gluon.Server, error) {
|
||||
gluonCacheDir = ApplyGluonCachePathSuffix(gluonCacheDir)
|
||||
gluonConfigDir = ApplyGluonConfigPathSuffix(gluonConfigDir)
|
||||
@ -134,6 +136,7 @@ func newIMAPServer(
|
||||
gluon.WithPanicHandler(panicHandler),
|
||||
gluon.WithObservabilitySender(observability.NewAdapter(observabilitySender), int(observability.GluonImapError), int(observability.GluonMessageError), int(observability.GluonOtherError)),
|
||||
gluon.WithConnectionRollingCounter(rollingCounterNewConnectionThreshold, rollingCounterNumberOfBuckets, rollingCounterBucketRotationInterval),
|
||||
gluon.WithFeatureFlagProvider(featureFlagProvider),
|
||||
}
|
||||
|
||||
if disableIMAPAuthenticate {
|
||||
|
||||
@ -34,6 +34,7 @@ import (
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/services/observability"
|
||||
bridgesmtp "github.com/ProtonMail/proton-bridge/v3/internal/services/smtp"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/services/syncservice"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/unleash"
|
||||
"github.com/ProtonMail/proton-bridge/v3/pkg/cpc"
|
||||
"github.com/emersion/go-smtp"
|
||||
"github.com/sirupsen/logrus"
|
||||
@ -63,6 +64,7 @@ type Service struct {
|
||||
telemetry Telemetry
|
||||
|
||||
observabilitySender observability.Sender
|
||||
featureFlagProvider unleash.FeatureFlagValueProvider
|
||||
}
|
||||
|
||||
func NewService(
|
||||
@ -75,6 +77,7 @@ func NewService(
|
||||
uidValidityGenerator imap.UIDValidityGenerator,
|
||||
telemetry Telemetry,
|
||||
observabilitySender observability.Sender,
|
||||
featureFlagProvider unleash.FeatureFlagValueProvider,
|
||||
) *Service {
|
||||
return &Service{
|
||||
requests: cpc.NewCPC(),
|
||||
@ -91,6 +94,7 @@ func NewService(
|
||||
telemetry: telemetry,
|
||||
|
||||
observabilitySender: observabilitySender,
|
||||
featureFlagProvider: featureFlagProvider,
|
||||
}
|
||||
}
|
||||
|
||||
@ -506,6 +510,7 @@ func (sm *Service) createIMAPServer(ctx context.Context) (*gluon.Server, error)
|
||||
sm.uidValidityGenerator,
|
||||
sm.panicHandler,
|
||||
sm.observabilitySender,
|
||||
sm.featureFlagProvider,
|
||||
)
|
||||
if err == nil {
|
||||
sm.eventPublisher.PublishEvent(ctx, events.IMAPServerCreated{})
|
||||
|
||||
Reference in New Issue
Block a user