Skip to content

refactor: move memento-backed state out of SecretsManager#1029

Merged
EhabY merged 1 commit into
mainfrom
split-memento-out-of-secrets-manager
Jul 9, 2026
Merged

refactor: move memento-backed state out of SecretsManager#1029
EhabY merged 1 commit into
mainfrom
split-memento-out-of-secrets-manager

Conversation

@EhabY

@EhabY EhabY commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #1023

SecretsManager had grown to also persist non-secret state in the workspace Memento: deployment access timestamps (coder.access.*), surfaced announcement banners (coder.surfacedBanners.*), and the legacy url key. This moves all of it into MementoManager, keeping SecretsManager secrets-only.

  • SecretsManager now takes a MementoManager instead of a raw Memento. Secret writes still stamp deployment access, getKnownSafeHostnames still orders by it, and clearAllAuthData remains the single per-deployment cleanup entry point, delegating the memento clears so both stores stay in sync.
  • AnnouncementManager depends on MementoManager directly. The surfaced-banner read-modify-write moved into MementoManager.addSurfacedBanners, so any future atomic memento update can be adopted in one place.
  • Keys and formats are unchanged, so no data migration.

Follow up to #1018

@EhabY EhabY self-assigned this Jul 9, 2026
Deployment access timestamps, surfaced banner keys, and the legacy url
key now live in MementoManager, keeping SecretsManager secrets-only.
SecretsManager takes a MementoManager and still orchestrates
per-deployment cleanup so both stores stay in sync, and
AnnouncementManager depends on MementoManager directly. The surfaced
banner read-modify-write moved into MementoManager.addSurfacedBanners.
Keys and formats are unchanged, so no data migration.

Closes #1023
@EhabY EhabY force-pushed the split-memento-out-of-secrets-manager branch from 4cbe4b4 to e7f0e8d Compare July 9, 2026 08:54
@EhabY EhabY requested a review from mtojek July 9, 2026 09:49
Comment thread src/core/mementoManager.ts
Comment thread src/announcements/manager.ts
Comment thread src/core/mementoManager.ts
Comment thread src/core/container.ts

@mtojek mtojek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@EhabY EhabY merged commit 6911779 into main Jul 9, 2026
13 checks passed
@EhabY EhabY deleted the split-memento-out-of-secrets-manager branch July 9, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split non-secret memento state out of SecretsManager (or rename it)

2 participants