Repository navigation
core: global cache for 1Password secrets - #13249
Conversation
9b101d3 to
8f9c288
Compare
sipsma
left a comment
There was a problem hiding this comment.
Very legit test failure https://dagger.cloud/dagger/checks/github.com/dagger/dagger@56a0037fb66feb665a399280df4550a0b730a0a2?check=test-split:test-base&viewMode=trace
Vault secret provider expects creds to be refreshed after a TTL (cc @kpenfound I think you added that back when).
|
Thanks @sipsma, I completely missed that the vault provider was already doing some in memory cache with custom TTLs. I don't really like adding an if condition to the new code when resolving "vault" secrets so I think I'll rollback this changes and just implement a global cache for 1Password like we do for vault. If we want a mechanism for caching that works across all providers we can work on something that sits on top of the core Secret itself maybe? |
Yep that SGTM for now!
Agreed, but probably needs some more larger scale design to handle TTL, secret rotation, etc. so don't need to pull all that in here |
|
Great!! I'm rushing that change now so we can include it in the release and unblock albert! @sipsma |
Signed-off-by: Matias Pan <[email protected]>
8f9c288 to
83b3559
Compare
dagger 0.21.1 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## v0.21.1 - 2026-05-29 ### Added - Add native GraphQL interfaces and unified object IDs in DagQL by @vito in dagger/dagger#12041 \ Dagger now exposes objects through the standard `Node` interface and `ID` scalar, enabling APIs to accept generic Dagger objects while preserving SDK compatibility through legacy `FooID` and `loadFooFromID` views for older clients. ### Fixed - Python SDK: fix unhandled module registration cases and bugs by removing the AST-based module analyzer and returning to runtime introspection by @eunomie in dagger/dagger#13251 - Fix Go module generation to avoid unnecessary dependency churn in generated `go.mod` and `go.sum` files by @sipsma in dagger/dagger#13244 - Fix registry authentication so `withRegistryAuth` credentials are not incorrectly skipped and authenticated publishes keep working after anonymous pulls to the same registry by @marcosnils + @sipsma in dagger/dagger#13255 dagger/dagger#13256 - Fix published image layer structure so `withDirectory` and `withFile` operations preserve expected layer boundaries instead of being squashed into a few large layers by @sipsma in dagger/dagger#13242 - Fix Dockerfile `RUN --mount=type=bind` conversion when the bind source selector points to a regular file, improving compatibility with file and directory bind mounts by @sipsma in dagger/dagger#13273 - Fix module source cache dependency retention, including ephemeral `missing shared result` errors after cache persistence or engine restarts by @sipsma in dagger/dagger#13243 - Fix a bug where some cache entries did not have their size calculated during background and shutdown pruning by @sipsma in dagger/dagger#13225 - Fix repeated `op://` 1Password secret reads by caching resolved 1Password secret values during a run, avoiding provider rate limits when the same secret is mounted or read multiple times by @matipan in dagger/dagger#13249 - Fix Windows Changeset exports so `RemovePaths` entries cannot remove files outside the selected export root through backslash or absolute-path interpretation by @marcosnils in dagger/dagger#13222 - Fix `dagger --x-release` for tagged releases so semver refs download release artifacts instead of looking in the main-build artifact namespace, and prevent local runner override environment from leaking into the re-executed CLI by @grouville in dagger/dagger#13259 ### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) </pre> <p>View the full release notes at <a href="https://github.com/dagger/dagger/releases/tag/v0.21.1">https://github.com/dagger/dagger/releases/tag/v0.21.1</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!9585
Summary
Users with
op://defaults were seeing repeated outgoing 1Password calls for the same secret during a single function run, especially when a secret was mounted/read multiple times. This was causing their pipelines to fail due to rate limits.SetSecretalready stores plaintext on the concrete secret resource for the session. This PR applies the same model to provider-backed secrets: resolve the provider once for a concrete secret binding, memoize the plaintext in memory, and reuse it for later mounts/reads.More context in the discussion below. Instead of modifying existing
SetSecretplumbing, we went with creating a global cache for 1Password just like we do for Vault. Makes the overall change scoped to 1Password.Testing