Skip to content

BYOC connector: Windows service never rotates its token #2366

Done

Description

@abrichr

The BYOC connector in #2300 rotates its token only when run_loop gets a token persister. The CLI daemon passes persist_token and persist_pending (packages/flow/openadapt_flow/connector/cli.py). The Windows service does not: windows_service.serve calls run_loop(client, settings, runner=runner, log=logger.info) with no persister, so a connector that runs as a Windows service never rotates its token, even when the control plane recommends it.

Expected: serve builds the same persisters as the CLI, writing to config_file(config_dir) with the same 0600 permissions, finishes any pending_token at startup, and passes persist_token and persist_pending to run_loop. The rotated token is added to the redactor.

Tests: a service test that drives a rotation recommendation through serve and checks that the new token is persisted before use and that the old token is redacted from logs.

Found in review of #2300 (follow-up, not a blocker for that PR).

Activity

  1. abrichr commented on Nov 21, 2026

    @abrichr
    MemberAuthor

    The implementation for this finding is #2356, stacked on #2300. The virtual service account has read-only access to the administrator’s connector policy. The fix keeps pending and committed credentials in Windows Credential Manager and preserves the configuration file and its ACL. It resumes an interrupted rotation before polling again.

    At 4b5abe1434639ba1e4c2f124f9695b5ea6ea2fd9, the service passed rotation and restart under its real Windows virtual account with a synthetic enrollment. Two portable regressions cover a transient confirmation failure and an edit to the file’s pending field. The next step is to retarget #2356 to main after #2300 lands. Windows job · Grok approval

  2. abrichr commented on Nov 25, 2026

    @abrichr
    MemberAuthor

    Resolved on main in PR #2356 (266284aa7), which persists pending and committed rotated connector tokens in Windows Credential Manager and resumes interrupted rotation on startup in packages/flow/openadapt_flow/connector/windows_service.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions