diff --git a/internal/provider/signins_carry.go b/internal/provider/signins_carry.go index f7190e7e6..d6402d1a8 100644 --- a/internal/provider/signins_carry.go +++ b/internal/provider/signins_carry.go @@ -196,8 +196,16 @@ func (s *SignIns) records() map[string]signInRec { // rotatesKnown are the community plugins whose vendor spends a refresh // token once, read from their sources: MiniMax Code ("MiniMax spends a // refresh token once", invalid_grant 400 after) and Qoder ("a refresh -// token is spent once, so two refreshes would spend it twice"). -var rotatesKnown = []string{"minimax-code", "minimax-code-global", "qoder", "qoder-cn"} +// token is spent once, so two refreshes would spend it twice"), and the +// six whose auth hooks say rotating since plugins #1027: Cline (a spent +// token is 400 invalid_grant), CodeArts and OfficeAce ("one-time refresh +// token"), Factory (WorkOS rotates), Nous Portal (refresh_token_reused), +// SenseNova (Hydra rotates) and WorkBuddy. The hooks say so too; this list +// holds for a sync that runs before the plugin host's list is read. +var rotatesKnown = []string{ + "cline", "codearts", "factory", "minimax-code", "minimax-code-global", "nous-portal", + "officeace", "qoder", "qoder-cn", "sensenova-token-plan", "workbuddy", "workbuddy-ai", +} // rotatingPlugins are the ids of the plugins whose auth hook says their // refresh tokens rotate (Rotating): a sign-in of theirs is never carried, diff --git a/internal/provider/signins_rotating_test.go b/internal/provider/signins_rotating_test.go new file mode 100644 index 000000000..2cd8f2dc4 --- /dev/null +++ b/internal/provider/signins_rotating_test.go @@ -0,0 +1,18 @@ +package provider + +import "testing" + +// Before the plugin host's list is read, a sync still knows which +// plugins' sign-ins rotate: every plugin whose hook says rotating +// (plugins #1027) or whose source says a refresh token is spent once. +func TestRotatingKnownBeforeHostList(t *testing.T) { + got := rotatingPlugins() + for _, id := range []string{ + "cline", "codearts", "factory", "minimax-code", "minimax-code-global", "nous-portal", + "officeace", "qoder", "qoder-cn", "sensenova-token-plan", "workbuddy", "workbuddy-ai", + } { + if !got[id] { + t.Errorf("%s is carried before the plugin host list is read", id) + } + } +}