Skip to content

fix(secrets): fast, credential-free atmos secret list - #2646

Merged
Andriy Knysh (aknysh) merged 7 commits into
mainfrom
osterman/fast-masked-secret-list
Jun 21, 2026
Merged

Andriy Knysh (aknysh) merged 7 commits into
mainfrom
osterman/fast-masked-secret-list

Conversation

@osterman

@osterman Erik Osterman (Cloud Posse) (osterman) commented Jun 21, 2026 •

Copy link
Copy Markdown
Member

what

  • Make atmos secret list require no authenticated identity and never decrypt — it only reports whether each secret is set. On a 72-component stack, listing drops from ~21–34s (it previously authenticated every component and decrypted every secret) to effectively instant.
  • Disable per-component authentication during secret-list stack enumeration.
  • Resolve SOPS initialization status from the file's cleartext key names — no age key, no decryption.
  • Rewrite every store's existence check (Has) to a non-decrypting metadata API: SSM GetParameter with WithDecryption=false, Secrets Manager DescribeSecret, GCP GetSecretVersion, Azure Key Vault properties pager, Vault KV metadata read, and a no-reveal 1Password check.
  • Add a tri-state STATUS (initialized / missing / unknown) plus a new --verify flag: remote-store status shows unknown by default; --verify contacts backends with a read/describe identity (never a decrypt identity) on a fully-scoped target.

why

  • Listing is introspection — it shows which secrets are declared and whether they exist, and never needs a plaintext value, so it should not force authentication or decryption (or require kms:Decrypt-style permissions).
  • The old path authenticated per component and fetched+decrypted every secret just to populate the status column, making secret list slow (and prone to hanging) on real-world stacks and unusable without cloud credentials.
  • Existence on a remote store still needs a read credential, so those rows now default to unknown (credential-free) and opt into a real check via --verify, while local backends (SOPS) always show accurate status for free.

references

Listing secrets now requires no authenticated identity and never
decrypts — it only reports whether each secret is set.

- Disable per-component auth during secret-list enumeration.
- SOPS status reads cleartext key names (no age key, no decrypt).
- Rewrite every store Has() to a non-decrypting existence API
  (SSM WithDecryption=false, ASM DescribeSecret, GCP GetSecretVersion,
  Azure properties pager, Vault KV metadata, 1Password no-reveal).
- Add tri-state status + --verify flag: remote-store status shows
  "unknown" by default; --verify contacts backends with a read identity.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@atmos-pro

atmos-pro Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@osterman Erik Osterman (Cloud Posse) (osterman) added the minor New features that do not break anything label Jun 21, 2026
@github-actions github-actions Bot added the size/l Large size PR label Jun 21, 2026
@github-actions

Copy link
Copy Markdown

Warning

Release Documentation Required

This PR is labeled minor or major and requires documentation updates:

  • Changelog entry ✅
  • Roadmap update - Update website/src/data/roadmap.js with the new milestone

Alternatively: If this change doesn't require release documentation, remove the minor or major label.

1 similar comment
@github-actions

Copy link
Copy Markdown

Warning

Release Documentation Required

This PR is labeled minor or major and requires documentation updates:

  • Changelog entry ✅
  • Roadmap update - Update website/src/data/roadmap.js with the new milestone

Alternatively: If this change doesn't require release documentation, remove the minor or major label.

@github-actions

github-actions Bot commented Jun 21, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@coderabbitai

coderabbitai Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR makes atmos secret list credential-free by default. All store Has() implementations are rewritten to use metadata/describe APIs instead of decrypting values. A LocalStore/LocalStatus capability model gates whether Service.Status contacts remote backends. A new --verify flag enables opt-in authenticated status checks, and a new Unknown status field represents unverified remote secrets.

Changes

Credential-Free Secret List with --verify Flag

Layer / File(s) Summary
Store and provider capability contracts
pkg/store/store.go, pkg/secrets/providers/provider.go, pkg/secrets/types.go
Adds LocalStore interface (IsLocal() bool), tightens StatusStore.Has docs to forbid value retrieval, introduces LocalStatus provider interface (LocalStatusCheck() bool), and adds Unknown bool field to Status struct.
SOPS credential-free Status via cleartext key scan
pkg/secrets/providers/sops.go, pkg/secrets/providers/sops_test.go, pkg/secrets/providers/store.go, pkg/secrets/providers/store_test.go
Rewrites sopsProvider.Status to parse encrypted SOPS YAML without decrypting, scanning cleartext key names via keyExists and branchHasKey. Adds LocalStatusCheck() bool returning true. storeProvider.LocalStatusCheck delegates to store.LocalStore.IsLocal().
Service.Status verify gate and Unknown propagation
pkg/secrets/service.go, pkg/secrets/validator.go, pkg/secrets/service_test.go, pkg/secrets/service_coverage_test.go
Updates Service.Status to accept verify bool; adds providerStatusIsLocal helper; sets st.Unknown = true for non-local providers when verify=false. Validate() forces Status(true). New test TestService_Status_RemoteGatedByVerify covers both paths.
Error handling additions for store operations
pkg/store/errors.go, pkg/store/aws_ssm_param_store.go
Introduces ErrAssumeRole sentinel and standardizes error wrapping across AWS SSM operations (Set, Get, GetKey, Delete).
AWS Secrets Manager Has via DescribeSecret
pkg/store/aws_secrets_manager_store.go, pkg/store/aws_secrets_manager_store_test.go
Adds DescribeSecret interface method, rewrites Has to use metadata-only lookup instead of GetSecretValue, maps ResourceNotFoundException to absent, and validates no decrypt occurs during existence checks.
AWS SSM Parameter Store Has via GetParameter without decryption
pkg/store/aws_ssm_param_store.go, pkg/store/aws_ssm_param_store_test.go
Rewrites Has to use GetParameter with WithDecryption=false instead of delegating to Get, performs key resolution and optional role assumption, and adds comprehensive test coverage for decryption-free existence checks.
Azure Key Vault Has via metadata versions pager
pkg/store/azure_keyvault_store.go, pkg/store/azure_keyvault_store_test.go
Extends AzureKeyVaultClient with NewListSecretPropertiesVersionsPager interface method, rewrites Has to check existence via versions metadata instead of GetSecret, introduces shared secretIDFormat for error consistency, and validates no secret data is retrieved during checks.
GCP Secret Manager Has via GetSecretVersion
pkg/store/google_secret_manager_store.go, pkg/store/google_secret_manager_store_test.go
Adds GetSecretVersion to GSMClient interface, rewrites Has to use metadata-only version lookup instead of AccessSecretVersion, removes errors.Is dependency, maps gRPC status codes appropriately, and validates decrypt APIs are never called.
HashiCorp Vault KV v2 Has via metadata endpoint
pkg/store/hashicorp_vault_store.go, pkg/store/hashicorp_vault_store_test.go
Extends VaultKVClient with HasMetadata method for metadata-only checks, rewrites Has to use KV v2 metadata instead of reading secret data, updates test fake to track metadata vs data reads, and adds test assertions for metadata-only behavior.
Keychain local store Has and locality reporting
pkg/store/keychain_store.go, pkg/store/keychain_store_test.go
Adds Has method using native keyring existence checks and IsLocal method reporting local store behavior, enabling credential-free listing for OS keychain.
1Password Has with optional Exists interface and resolve fallback
pkg/store/onepassword_client.go, pkg/store/onepassword_client_test.go, pkg/store/onepassword_sdk_client_test.go, pkg/store/onepassword_store.go, pkg/store/onepassword_store_test.go
Adds Exists method to sdkClient and connectClient for metadata-only checks without revealing values, introduces onePasswordExistenceChecker interface, rewrites Has to prefer Exists when available and fall back to resolve-based probing, and validates no secret values are exposed.
CLI --verify flag and list command threading
cmd/secret/deps.go, cmd/secret/list.go, cmd/secret/shared.go, cmd/secret/enumerate.go, cmd/secret/init.go, cmd/secret/fake_service_test.go
Updates secretService interface Status method signature to accept verify bool, adds --verify flag constant and registration, introduces loadServiceForList helper (credential-free vs authenticated paths), adds loadServiceForListFn override variable for testing, threads verify into runSecretList and Status calls, adds warning for partially-scoped --verify, forces Status(false) in enumeration, extends statusLabel with "unknown" case, switches rotateDeclaredSecrets to Status(true), and switches enumerateSecretScopes to ExecuteDescribeStacksWithAuthDisabled.
CLI test coverage for --verify flag and loaders
cmd/secret/list_coverage_test.go, cmd/secret/shared_loaders_test.go
Adds new tests covering statusLabel unknown case, verify flag threading through list command, partial-scope --verify warning behavior, and loadServiceForList credential-free/authenticated paths including error cases.
Documentation: CLI reference and blog post
website/blog/2026-06-20-fast-credential-free-secret-list.mdx, website/docs/cli/commands/secret/list.mdx, website/src/data/roadmap.js
Adds comprehensive blog post explaining credential-free default behavior and --verify opt-in, updates CLI reference with status column semantics (initialized, missing, unknown, error), adds --verify flag documentation, includes new usage examples, and updates roadmap milestone.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI as runSecretList
  participant Loader as loadServiceForListFn
  participant Service as secrets.Service
  participant Provider as sopsProvider / storeProvider
  participant Backend as Remote Store / SOPS File

  User->>CLI: atmos secret list [--verify]
  CLI->>Loader: loadServiceForListFn(scope, verify)

  alt verify=false (default)
    Loader->>Service: build with AuthDisabled=true
    CLI->>Service: Status(false)
    Service->>Provider: providerStatusIsLocal?
    alt local provider (SOPS, Keychain)
      Provider->>Backend: scan cleartext keys / native Has
      Backend-->>Provider: key present/absent
      Provider-->>Service: (bool, nil)
    else remote provider
      Service-->>Service: st.Unknown = true
    end
    Service-->>CLI: []Status (remote = Unknown)
  else verify=true
    Loader->>Service: build with full auth (loadService)
    CLI->>Service: Status(true)
    Service->>Provider: provider.Status(coord)
    Provider->>Backend: DescribeSecret / GetSecretVersion / HasMetadata
    Backend-->>Provider: exists / not-found
    Provider-->>Service: (bool, nil)
    Service-->>CLI: []Status (Initialized/Missing)
  end

  CLI->>User: table with STATUS column
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • aknysh
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.79% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: making atmos secret list fast and credential-free, which directly matches the PR's primary objective and the bulk of changes across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch osterman/fast-masked-secret-list

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/store/keychain_store.go (1)

165-171: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add perf tracking to KeychainStore.Has.

This exported method performs keyring I/O but currently skips the required perf instrumentation wrapper.

As per coding guidelines: “Add defer perf.Track(atmosConfig, "pkg.FuncName")() + blank line to all public functions… Exceptions: … pure validation/lookup functions with no I/O.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/store/keychain_store.go` around lines 165 - 171, The exported Has method
in the KeychainStore struct performs keyring I/O but is missing required perf
tracking instrumentation. Add a defer perf.Track call at the start of the Has
method with the appropriate function identifier following the pattern defer
perf.Track(atmosConfig, "pkg.FunctionName")(), followed by a blank line, to
satisfy the coding guidelines for all public functions that perform I/O
operations.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/store/aws_ssm_param_store_test.go`:
- Around line 324-335: The test function `absent_returns_false` sets up an
expectation on the `mockSSM` mock object for the GetParameter method but does
not verify that this expectation was actually called. Add an assertion at the
end of the test to verify that all mock expectations were met on the mockSSM
object. This will ensure that if the code under test changes and stops calling
GetParameter, the test will fail and catch the regression.

In `@pkg/store/aws_ssm_param_store.go`:
- Around line 516-519: The error handling in the assumeRole failure path is
using a dynamic error created with fmt.Errorf instead of a static sentinel error
from errors/errors.go. Replace the fmt.Errorf call that wraps the "failed to
assume read role" message with the appropriate static error sentinel from
errors/errors.go, ensuring that downstream code can use errors.Is checks
consistently and follow the coding guideline that all errors must be wrapped
using static errors defined in errors/errors.go.

In `@pkg/store/onepassword_store.go`:
- Around line 231-233: The `Has` method currently falls back to
`s.resolve(reference)` which retrieves and reveals plaintext secret values when
the Exists operation is unavailable, breaking the metadata-only guarantee and
weakening privacy boundaries. Instead of calling resolve, implement a safe
approach that checks existence without retrieving the actual secret value. This
fix should apply to the main `Has` method implementation and the related code
section that also exhibits this fallback pattern, ensuring that existence probes
never expose secret plaintext regardless of whether the underlying SDK supports
Exists operations.

---

Outside diff comments:
In `@pkg/store/keychain_store.go`:
- Around line 165-171: The exported Has method in the KeychainStore struct
performs keyring I/O but is missing required perf tracking instrumentation. Add
a defer perf.Track call at the start of the Has method with the appropriate
function identifier following the pattern defer perf.Track(atmosConfig,
"pkg.FunctionName")(), followed by a blank line, to satisfy the coding
guidelines for all public functions that perform I/O operations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2fedf5fb-53cf-4274-8fae-9da02d6e1b3a

📥 Commits

Reviewing files that changed from the base of the PR and between 8a9754b and c8f8cb4.

📒 Files selected for processing (32)
  • cmd/secret/deps.go
  • cmd/secret/enumerate.go
  • cmd/secret/fake_service_test.go
  • cmd/secret/init.go
  • cmd/secret/list.go
  • cmd/secret/list_coverage_test.go
  • cmd/secret/shared.go
  • pkg/secrets/providers/provider.go
  • pkg/secrets/providers/sops.go
  • pkg/secrets/providers/sops_test.go
  • pkg/secrets/providers/store.go
  • pkg/secrets/service.go
  • pkg/secrets/service_coverage_test.go
  • pkg/secrets/service_test.go
  • pkg/secrets/types.go
  • pkg/secrets/validator.go
  • pkg/store/aws_secrets_manager_store.go
  • pkg/store/aws_secrets_manager_store_test.go
  • pkg/store/aws_ssm_param_store.go
  • pkg/store/aws_ssm_param_store_test.go
  • pkg/store/azure_keyvault_store.go
  • pkg/store/azure_keyvault_store_test.go
  • pkg/store/google_secret_manager_store.go
  • pkg/store/google_secret_manager_store_test.go
  • pkg/store/hashicorp_vault_store.go
  • pkg/store/hashicorp_vault_store_test.go
  • pkg/store/keychain_store.go
  • pkg/store/onepassword_store.go
  • pkg/store/onepassword_store_test.go
  • pkg/store/store.go
  • website/blog/2026-06-20-fast-credential-free-secret-list.mdx
  • website/docs/cli/commands/secret/list.mdx

Comment thread pkg/store/aws_ssm_param_store_test.go Resolved
Comment thread pkg/store/aws_ssm_param_store.go Resolved
Comment thread pkg/store/onepassword_store.go Resolved
@codecov

codecov Bot commented Jun 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.68778% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.05%. Comparing base (c78ba98) to head (2ddef2f).

Files with missing lines Patch % Lines
pkg/store/aws_ssm_param_store.go 81.48% 3 Missing and 2 partials ⚠️
pkg/secrets/providers/sops/sops.go 84.61% 2 Missing and 2 partials ⚠️
pkg/store/google_secret_manager_store.go 80.95% 2 Missing and 2 partials ⚠️
pkg/store/aws_secrets_manager_store.go 72.72% 2 Missing and 1 partial ⚠️
pkg/store/azure_keyvault_store.go 87.50% 2 Missing and 1 partial ⚠️
cmd/secret/shared.go 91.66% 1 Missing and 1 partial ⚠️
pkg/store/onepassword_client.go 93.33% 1 Missing and 1 partial ⚠️
pkg/store/hashicorp_vault_store.go 92.30% 1 Missing ⚠️
pkg/store/onepassword_store.go 92.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2646      +/-   ##
==========================================
+ Coverage   80.03%   80.05%   +0.02%     
==========================================
  Files        1361     1361              
  Lines      127262   127449     +187     
==========================================
+ Hits       101850   102035     +185     
+ Misses      19760    19748      -12     
- Partials     5652     5666      +14     
Flag Coverage Δ
unittests 80.05% <88.68%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cmd/secret/deps.go 100.00% <100.00%> (ø)
cmd/secret/enumerate.go 97.40% <100.00%> (ø)
cmd/secret/init.go 84.25% <100.00%> (ø)
cmd/secret/list.go 87.50% <100.00%> (+0.61%) ⬆️
pkg/secrets/providers/store.go 97.87% <100.00%> (+4.84%) ⬆️
pkg/secrets/service.go 83.79% <100.00%> (+0.65%) ⬆️
pkg/secrets/types.go 100.00% <ø> (ø)
pkg/secrets/validator.go 100.00% <100.00%> (ø)
pkg/store/keychain_store.go 70.51% <100.00%> (+0.77%) ⬆️
pkg/store/store.go 100.00% <ø> (ø)
... and 9 more

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- pkg/store: add ErrAssumeRole static sentinel and wrap all six
  assume-role failure paths in aws_ssm_param_store.go (errors.Is-friendly).
- pkg/store: assert mock expectations in SSM Has absent_returns_false test.
- pkg/store: implement metadata-only Exists on the native SDK and Connect
  1Password clients so Has never resolves (reveals) the secret value under
  --verify; the resolve fallback now only serves clients without Exists.
  Adds Exists unit tests for both clients.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 21, 2026
Add unit tests covering the new credential-free `secret list` paths that
Codecov flagged on PR #2646 (patch coverage 62%): per-store Has() existence
-check error branches, the loadServiceForList credential-free loader, the
LocalStatus capability, and SOPS keyExists error handling.

All changed functions now sit at >=83% (most 90-100%); no production code
changed. Reuses existing fakes/mocks and the writeMinimalAtmosProject fixture.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
pkg/store/onepassword_store_test.go (1)

247-254: ⚡ Quick win

Assert malformed-reference failure is pre-client.

This test checks the error, but not the key contract that no Exists/Resolve call happens before reference rendering fails. Add call-count assertions to lock that behavior down.

Suggested patch
 func TestOnePasswordStore_Has_MalformedReference(t *testing.T) {
-	s := newTestOPStore(newFakeOPClient(nil), "")
+	fake := newFakeOPClient(nil)
+	s := newTestOPStore(fake, "")
 
 	_, err := s.Has("prod", "api", "op://{{ .atmos_stack ")
 	require.Error(t, err)
+	assert.Equal(t, 0, fake.existsCalls)
+	assert.Equal(t, 0, fake.resolveCalls)
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/store/onepassword_store_test.go` around lines 247 - 254, The
TestOnePasswordStore_Has_MalformedReference test currently only verifies that an
error is returned for a malformed reference, but does not verify the key
contract that no client calls are made before the reference rendering fails. Add
call-count assertions to the fakeOPClient to verify that the Exists or Resolve
methods were never called after the Has method returns an error for the
malformed reference string "op://{{ .atmos_stack ". This ensures the behavior is
locked down that reference validation and rendering failures occur before any
client interaction happens.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/secret/list_coverage_test.go`:
- Around line 100-113: The test TestRunSecretList_VerifyWithoutFullScope_Warns
is named to indicate it should verify warning output, but it only asserts that
runSecretSubcommand returns no error without actually capturing and asserting
the warning message. Modify the test to capture the stderr or stdout output from
the runSecretSubcommand call and add an explicit assertion that verifies the
expected warning text is present in that output, ensuring the warning branch
behavior is actually tested rather than just the success condition.

In `@cmd/secret/shared_loaders_test.go`:
- Around line 196-202: The test function TestLoadServiceForListSeam_Error
currently only validates the error case when verify is false. Add an additional
assertion in this test that calls loadServiceForListFn with verify set to true
and also expects an error. This ensures both branches of the seam (verify=true
and verify=false) are covered on the error path, providing comprehensive unit
test coverage as required by the coding guidelines.

---

Nitpick comments:
In `@pkg/store/onepassword_store_test.go`:
- Around line 247-254: The TestOnePasswordStore_Has_MalformedReference test
currently only verifies that an error is returned for a malformed reference, but
does not verify the key contract that no client calls are made before the
reference rendering fails. Add call-count assertions to the fakeOPClient to
verify that the Exists or Resolve methods were never called after the Has method
returns an error for the malformed reference string "op://{{ .atmos_stack ".
This ensures the behavior is locked down that reference validation and rendering
failures occur before any client interaction happens.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 03d61c39-50db-47f9-a6d8-71874498deaa

📥 Commits

Reviewing files that changed from the base of the PR and between c4a3a45 and 869ebfa.

📒 Files selected for processing (8)
  • cmd/secret/list_coverage_test.go
  • cmd/secret/shared_loaders_test.go
  • pkg/secrets/providers/sops_test.go
  • pkg/secrets/providers/store_test.go
  • pkg/store/aws_ssm_param_store_test.go
  • pkg/store/google_secret_manager_store_test.go
  • pkg/store/keychain_store_test.go
  • pkg/store/onepassword_store_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/store/google_secret_manager_store_test.go
  • pkg/secrets/providers/sops_test.go

Comment thread cmd/secret/list_coverage_test.go Resolved
Comment thread cmd/secret/shared_loaders_test.go Resolved
@osterman Erik Osterman (Cloud Posse) (osterman) added patch A minor, backward compatible change and removed minor New features that do not break anything labels Jun 21, 2026
Address review feedback on PR #2646:
- Assert the `--verify`-without-full-scope warning is actually emitted
  (capture the UI channel via a new setupIOCapture helper), not just that
  the command succeeds.
- Cover the verify=true error branch of the loadServiceForList seam too.

Reclassify as a patch (enhancement to an unreleased feature): remove the
changelog blog post and its shipped roadmap milestone. The `--verify` flag
docs in secret/list.mdx remain.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 21, 2026
@mergify

mergify Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏

@mergify mergify Bot added the conflict This PR has conflicts label Jun 21, 2026
Resolves conflicts from the SOPS refactor in #2643 (main), which moved
pkg/secrets/providers/sops.go into the new pkg/secrets/providers/sops
subpackage and added cloud-KMS auth via Atmos identity.

- pkg/secrets/providers/store_test.go: kept this branch's localFakeStore +
  TestStoreProvider_LocalStatusCheck (testing storeProvider.LocalStatusCheck);
  dropped TestNewSops_FromSection/TestNewSops_NotFound, which main moved to the
  sops subpackage (newSopsProvider no longer lives in package providers).
- pkg/secrets/providers/sops/sops_test.go: qualified this branch's added tests'
  references to LocalStatus and Coordinate with the providers package now that
  the file lives in package sops.

The auto-merged sops/sops.go retains both main's cloud-KMS auth (sopsauth,
keyservice, authResolver) and this branch's credential-free existence check
(keyExists/branchHasKey/LocalStatusCheck). go build ./..., go vet ./..., and the
full secret suite (pkg/secrets/..., pkg/store/..., cmd/secret/...) pass.
@aknysh
Andriy Knysh (aknysh) merged commit aa68d85 into main Jun 21, 2026
66 checks passed
@aknysh
Andriy Knysh (aknysh) deleted the osterman/fast-masked-secret-list branch June 21, 2026 21:38
@atmos-pro

atmos-pro Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.222.0-rc.6.

Andriy Knysh (aknysh) pushed a commit that referenced this pull request Jun 22, 2026
…2652)

In processComponentEntry, per-component authentication ran before the stack and
component filters and was never memoized. Any auth-enabled ExecuteDescribeStacks
caller (atmos describe stacks, list values/instances, terraform --all/--query)
authenticated every component in every stack before discarding the out-of-scope
ones, and re-authenticated each same-identity component from scratch. On a large
multi-stack repo, `atmos describe stacks -s <stack>` authenticates components in
stacks other than the one requested and effectively hangs.

#2646 sidestepped this for `atmos secret list` by disabling per-component auth
there; this fixes the root cause in the shared processor for every other caller.

- Move the stack and component filters above resolveComponentAuthManager so only
  in-scope components authenticate. Auth still precedes its consumers
  (BuildTerraformWorkspace, template and YAML-function processing).
- Add a pass-scoped cache keyed by the parent chain plus a deterministic JSON
  fingerprint of the component auth section, so components sharing an auth
  section reuse one authenticated manager instead of re-running the full auth
  cycle (credential writes, file locks, keyring rebuilds).
- Add regression tests (out-of-scope skip + cache reuse).

Measured with the identical command (`describe stacks -s <stack> --logs-level
Debug`, 45s budget, only the atmos binary varies): the latest release (v1.221.1)
and current main both fail to complete within 45s, authenticating mostly
out-of-scope components, while this change completes in ~18s (43 auths; in-scope
processor-path auth reduced to 2).

Related to #2639.
Andriy Knysh (aknysh) added a commit that referenced this pull request Jun 23, 2026
…secret list (#2657)

`atmos secret list -s <stack>` (and `secret list -s <stack> -c <component>`
without `--verify`) resolve stack/component config with authentication disabled
to avoid one auth cycle per component, but still evaluated `!terraform.state`,
`!terraform.output`, and `!store`. With auth disabled, those reads fall back to
the default AWS credential chain and ultimately the unreachable EC2 IMDS
endpoint, so listing aborts with an assume-role/credentials error even when the
user is authenticated.

Listing only needs the static `secrets.vars` declarations
(secrets.ExtractDeclarations), which never require a resolved value. Add
credentialFreeSkip() and use it in enumerateSecretScopes and loadServiceForList
(non-verify) so the credentialed read functions are skipped; a skipped function
leaves its raw string in place, which the extractor ignores. Authenticated
paths (loadServiceAndConfig, `secret list --verify`) keep skipping only
`!secret`.

Write-up: docs/fixes/2026-06-23-secret-list-credential-free-skip.md

Related to #2639. Follow-up to #2646, which made secret-list enumeration
credential-free but left the credentialed function evaluation in place.

Co-authored-by: Andriy Knysh <[email protected]>

This branch was successfully deployed

1 active deployment
preview — 2ddef2f3 Deployed Jun 21, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change size/l Large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants