DopplerHQ / DopplerHQ/cli

[FEATURE] idea: stale-while-revalidate for secrets

Open
#423 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
396
Forks
83
Avg merge
1d 2h
Merged PRs (30d)
3

Description

Is your feature request related to a problem? Please describe.
Checking for new secrets every time we run commands just makes running every command slower; it has to do a round trip to Doppler. But secrets only change occasionally in our project, so it would be more valuable to have our commands run speedily than to always have the freshest secrets.

Describe the solution you'd like
Similarly to "stale-while-revalidate" when caching content on the web, give the Doppler CLI an option to just use the secrets from whatever it retrieved last time (so long as it's not too egregiously stale, maybe make it configurable the same way that SWR is), and in the background refresh the secrets so that at least the next time you run the command, if something changed it would be up-to-date.

So the command would run near instantly, but you run the risk of running it with stale values once.

Might be good to additionally have some explicit "refresh" command alongside this when needed.

Describe alternatives you've considered
Turning the internet off and using the fallback? lol or just tolerating all our CLI commands stalling for a second before we do anything. But that makes Doppler less fun.

Additional context
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating the CLI's existing secret retrieval and fallback paths, then read the linked stale-while-revalidate guidance. Done should include an agreed configurable staleness limit, background refresh behavior, and an explicit refresh command, with tests covering stale and refreshed secrets.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.