Skip to content

Fix AWS store auth and add Floci E2E coverage - #2625

Merged
Andriy Knysh (aknysh) merged 14 commits into
mainfrom
osterman/fix-aws-ssm-secrets-auth
Jun 19, 2026
Merged

Andriy Knysh (aknysh) merged 14 commits into
mainfrom
osterman/fix-aws-ssm-secrets-auth

Conversation

@osterman

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

Copy link
Copy Markdown
Member

what

  • Fix AWS SSM/Secrets Manager store auth during hooks, describe, and secret commands, including inherited identities and secret-store access enforcement.
  • Make slash kind notation canonical, add AWS store/secrets gists, document the fix, and add custom endpoint support for AWS, GCP Secret Manager, and Azure Key Vault.
  • Add opt-in Floci E2E tests and CI coverage for AWS, GCP, and Azure store/secrets workflows.

why

  • The reported SSM hook workflow could fall back to ambient AWS credentials or fail with a missing auth resolver even when the Terraform identity was valid.
  • The feature needed full-circle examples plus emulator-backed regression coverage so AWS stores and declared secrets stay working across providers.

references

  • No issue linked.

@atmos-pro

atmos-pro Bot commented Jun 17, 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 github-actions Bot added the size/l Large size PR label Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 15 package(s) with unknown licenses.
See the Details below.

License Issues

go.mod

PackageVersionLicenseIssue Type
github.com/Azure/go-ansiterm0.0.0-20250102033503-faa5f7b0171cNullUnknown License
github.com/distribution/reference0.6.0NullUnknown License
github.com/docker/go-connections0.7.0NullUnknown License
github.com/docker/go-units0.5.0NullUnknown License
github.com/ebitengine/purego0.10.0NullUnknown License
github.com/go-ole/go-ole1.2.6NullUnknown License
github.com/moby/docker-image-spec1.3.1NullUnknown License
github.com/moby/moby/api1.54.2NullUnknown License
github.com/moby/moby/client0.4.1NullUnknown License
github.com/moby/patternmatcher0.6.1NullUnknown License
github.com/stretchr/objx0.5.3NullUnknown License
github.com/testcontainers/testcontainers-go0.42.0NullUnknown License
github.com/tklauser/numcpus0.11.0NullUnknown License
github.com/yusufpapurcu/wmi1.2.4NullUnknown License
github.com/shirou/gopsutil/v44.26.3NullUnknown License
Allowed Licenses: MIT, MIT-0, Apache-2.0, BSD-2-Clause, BSD-2-Clause-Views, BSD-3-Clause, ISC, MPL-2.0, 0BSD, Unlicense, CC0-1.0, CC-BY-3.0, CC-BY-4.0, CC-BY-SA-3.0, Python-2.0, OFL-1.1, LicenseRef-scancode-generic-cla, LicenseRef-scancode-unknown-license-reference, LicenseRef-scancode-unicode, LicenseRef-scancode-google-patent-license-golang
Excluded from license check: pkg:golang/modernc.org/libc

Scanned Files

  • go.mod

@mergify

mergify Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4c0bbc5b-c3d5-43bd-a954-b3efd2be06a6

📥 Commits

Reviewing files that changed from the base of the PR and between 3ee96b8 and 4ddb3f2.

📒 Files selected for processing (1)
  • pkg/store/hashicorp_vault_store_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/store/hashicorp_vault_store_test.go

📝 Walkthrough

Walkthrough

This PR wires store auth resolvers into more execution paths, expands store endpoint and local-auth options, blocks reads from secret stores, adds Floci-based E2E infrastructure and scenarios, introduces runnable AWS gists, updates CI for Floci tests, and aligns store and secret documentation around canonical kind selectors.

Changes

Store auth, backends, Floci tests, and docs

Layer / File(s) Summary
Auth context and resolver wiring
pkg/auth/cloud/aws/..., pkg/auth/identities/aws/..., pkg/store/authbridge/..., pkg/schema/schema.go, cmd/secret/shared.go, cmd/terraform/utils.go, internal/exec/describe_component.go, pkg/config/load.go, pkg/config/process_yaml.go, ...test.go
AWS auth contexts now carry endpoint URLs, resolver URL lookup uses identity-first precedence, auth managers are threaded into AWS auth context setup, and YAML identity decoding preserves function tags.
Store backend endpoint and auth behavior
internal/gcp/auth.go, pkg/store/options.go, pkg/store/aws_*, pkg/store/azure_keyvault_store.go, pkg/store/google_secret_manager_store.go, pkg/store/registry*.go, ...test.go
AWS, Azure, and GCP stores now accept endpoint and auth-mode options, AWS clients initialize lazily, and registry mappings cover the canonical and legacy kinds.
Secret-store read guards and secret set scope handling
internal/exec/template_funcs_store.go, pkg/function/store.go, cmd/secret/set.go, ...test.go
!store, !store.get, and atmos.Store paths now reject secret: true stores, and secret set no longer blocks shared stack/global declarations with the removed override guard.
Floci harness and test execution plumbing
.github/workflows/test.yml, go.mod, tests/preconditions.go, tests/testhelpers/toolchain.go, tests/floci_containers_test.go, tests/floci_harness_test.go, tests/cli_test.go, tests/terraform_floci_dag_test.go, internal/exec/terraform_test.go
Floci test setup is centralized in a reusable harness, executable lookup can prepend cached tool paths, and test tool/version handling is updated for the new runtime flow.
Floci scenarios, E2E coverage, and CI job wiring
.github/workflows/test.yml, tests/aws_stores_floci_test.go, tests/azure_stores_floci_test.go, tests/gcp_stores_floci_test.go, tests/fixtures/scenarios/*, tests/README.md
CI adds a dedicated floci-go job, and new AWS/Azure/GCP Floci scenarios verify store hooks, declared secrets, masking, validation, and Terraform execution against emulator endpoints.
AWS runnable gists and fixtures
gists/aws-secrets/*, gists/aws-store-hooks/*
Two runnable AWS examples add Atmos configs, Terraform components, IAM policies, stack manifests, and usage docs for declared secrets and Terraform-output store hooks.
Store kind and backend documentation
agent-skills/skills/atmos-*, examples/auth-stores/*, docs/prd/*, website/blog/*, website/docs/cli/configuration/stores.mdx, website/docs/intro/multi-cloud.mdx, website/docs/stacks/hooks.mdx, website/docs/tutorials/sharing-state/stores.mdx
Docs and examples switch store definitions to canonical kind values and expand backend option references.
Secret and sharing docs
website/docs/cli/commands/secret/usage.mdx, website/docs/functions/*, docs/prd/secrets-management.md, docs/fixes/..., website/docs/tutorials/sharing-state/stores.mdx
Secret command, store function, PRD, fix notes, and tutorial docs now describe secret scopes, masking, and external store sharing behavior.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~100 minutes

Possibly related PRs

  • cloudposse/atmos#2099: Extends the same identity-based store authentication path with resolver injection and backend behavior changes.
  • cloudposse/atmos#2379: Touches the same authbridge resolver logic that now also returns AWS endpoint information.
  • cloudposse/atmos#1911: Directly overlaps with the secret-store access and !secret/!store behavior changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.54% 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 accurately and concisely summarizes the main changes: AWS store auth fixes and Floci E2E test coverage additions.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch osterman/fix-aws-ssm-secrets-auth

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: 11

🤖 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 @.github/workflows/test.yml:
- Around line 442-447: The actions/setup-go@v6 step in the Floci E2E tests job
is missing an explicit cache policy configuration. Currently it relies on the
default behavior which enables caching, creating a potential security risk for
PR workflows. Add a cache: false parameter to the with section of the
actions/setup-go step to explicitly disable caching and prevent cache poisoning
from untrusted code.

In `@cmd/secret/shared_loaders_test.go`:
- Around line 86-113: Add a new subtest to TestSecretStoreDefaultIdentity that
covers the cfg.IdentityFlagDisabledValue sentinel path. Create a test case
(similar to the existing "select sentinel falls back to auth chain" subtest)
that passes secretScope with Identity set to cfg.IdentityFlagDisabledValue to
the secretStoreDefaultIdentity function and verifies the correct behavior,
setting up any necessary mock expectations on authManager and asserting the
expected return value.

In `@cmd/terraform/utils_hooks_test.go`:
- Around line 769-796: The TestHookStoreDefaultIdentity test function in the
hookStoreDefaultIdentity test suite is missing a test case for the
disabled-identity sentinel value handled by the cfg.IdentityFlagDisabledValue
check. Add a new t.Run sub-test case that tests when the Identity field in
schema.ConfigAndStacksInfo is set to the disabled identity sentinel value, mock
the authManager appropriately (similar to the existing test cases), call
hookStoreDefaultIdentity with this configuration, and assert that the function
falls back to the chain-based identity resolution behavior. This will ensure the
precedence logic for disabled identities is properly tested and maintained.

In `@gists/aws-secrets/iam/secrets-policy.json`:
- Around line 7-14: The issue is that ssm:DescribeParameters action is grouped
with other actions in the same statement, but this action does not support
resource-level permissions and requires Resource set to "*". Remove
ssm:DescribeParameters from the existing statement (which contains
ssm:PutParameter, ssm:GetParameter, and ssm:DeleteParameter with the specific
parameter ARN resource), then create a separate new statement with the same
Effect and Principal but with Action containing only ssm:DescribeParameters and
Resource set to "*". This ensures account-level parameter listing operations
work correctly while maintaining least-privilege access for the other
parameter-specific actions.

In `@gists/aws-secrets/README.md`:
- Around line 108-110: The test command shown at line 109 uses a relative path
`./tests` that assumes execution from the repository root, but the documentation
earlier at line 27 directs users to the `gists/aws-secrets` directory. Add a `cd
../..` command before the test command to navigate back to the repository root
so the `./tests` path resolves correctly, ensuring users can run the Floci test
command without encountering a path not found error.

In `@gists/aws-store-hooks/iam/store-writer-policy.json`:
- Around line 7-14: The ssm:DescribeParameters action in the
store-writer-policy.json file must be moved to a separate IAM policy statement
because it is an account-level action that requires the wildcard resource "*"
and does not support parameter-level resource scoping. Remove
ssm:DescribeParameters from the current statement that contains
ssm:PutParameter, ssm:GetParameter, and ssm:DeleteParameter with the parameter
ARN resource, then create a new separate statement specifically for the
ssm:DescribeParameters action with "Resource": "*" to avoid AccessDenied errors.

In `@gists/aws-store-hooks/README.md`:
- Around line 60-62: The Floci test command in the README uses a relative path
./tests that assumes the user is running from the repository root, but the
documentation places users in the gists/aws-store-hooks subdirectory. Add a cd
../.. command before the ATMOS_TEST_FLOCI environment variable setup to navigate
back to the repository root before executing the go test command, ensuring the
relative path ./tests resolves correctly.

In `@internal/exec/describe_component_test.go`:
- Around line 21-49: The test TestDescribeStoreDefaultIdentity currently expects
the last chain entry to take precedence, but the correct precedence should be:
explicit configured default identity should be checked before falling back to
the chain. In the first test case "authenticated chain wins", update the
expectations so that when both a chain and a default identity are available, the
function should call GetDefaultIdentity(false) and return that result instead of
the last chain entry. This test should demonstrate that the default identity
takes precedence over the chain fallback. Adjust the mock expectations in this
test case to set up GetDefaultIdentity(false) to return a value and verify that
the returned value from describeStoreDefaultIdentity matches the default
identity rather than the chain entry.

In `@internal/exec/describe_component.go`:
- Around line 185-196: In the describeStoreDefaultIdentity function, reorder the
precedence logic so that GetDefaultIdentity is checked first before falling back
to the chain tail. Currently the function returns chain[len(chain)-1] whenever a
chain exists, which prevents GetDefaultIdentity from being evaluated. Instead,
first attempt to retrieve the identity using
authManager.GetDefaultIdentity(false) and return it if successful, then only
fall back to checking the chain and returning its last element if the default
identity was not available.

In `@tests/floci_harness_test.go`:
- Around line 209-223: When ATMOS_TEST_FLOCI environment variable is set to true
(opt-in test run), the TCP probe failure at net.DialTimeout and the HTTP probe
failure at http.DefaultClient.Do should hard-fail using t.Fatalf instead of
skipping silently with t.Skipf. Check if the environment variable is true and
conditionally choose between t.Fatalf (for opted-in runs that must have
coverage) and t.Skipf (for optional runs) for both the TCP dial error handling
and HTTP request error handling to ensure opted-in runs fail loudly when
endpoints are unreachable.

In `@website/docs/cli/configuration/stores.mdx`:
- Line 34: The stores.mdx file correctly uses canonical store kinds like
azure/keyvault and gcp/secretmanager, but other documentation files in the
repository (agent-skills documentation, tutorials, and multi-cloud guide) still
reference the legacy forms such as azure-key-vault and google-secret-manager.
Update all references to store kinds in these other documentation files to use
the canonical forms (azure/keyvault for Azure Key Vault and gcp/secretmanager
for Google Secret Manager) to keep the documentation consistent across the
repository, while optionally noting that legacy forms are still supported for
backward compatibility.
🪄 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: 6d0516ee-1395-4cb1-9e2a-03c4482d6672

📥 Commits

Reviewing files that changed from the base of the PR and between dbbe23e and fc8cc8a.

📒 Files selected for processing (79)
  • .github/workflows/test.yml
  • agent-skills/skills/atmos-stores/SKILL.md
  • agent-skills/skills/atmos-stores/references/store-providers.md
  • cmd/secret/shared.go
  • cmd/secret/shared_loaders_test.go
  • cmd/terraform/utils.go
  • cmd/terraform/utils_hooks_test.go
  • docs/fixes/2026-06-17-aws-stores-secrets-auth-and-gists.md
  • gists/aws-secrets/README.md
  • gists/aws-secrets/atmos.yaml
  • gists/aws-secrets/components/terraform/secret-consumer/main.tf
  • gists/aws-secrets/components/terraform/secret-consumer/outputs.tf
  • gists/aws-secrets/iam/secrets-policy.json
  • gists/aws-secrets/stacks/dev.yaml
  • gists/aws-secrets/stacks/prod.yaml
  • gists/aws-store-hooks/README.md
  • gists/aws-store-hooks/atmos.yaml
  • gists/aws-store-hooks/components/terraform/output-demo/main.tf
  • gists/aws-store-hooks/components/terraform/output-demo/outputs.tf
  • gists/aws-store-hooks/iam/store-writer-policy.json
  • gists/aws-store-hooks/stacks/consumer.yaml
  • gists/aws-store-hooks/stacks/producer.yaml
  • internal/exec/describe_component.go
  • internal/exec/describe_component_test.go
  • internal/exec/template_funcs_store.go
  • internal/exec/template_funcs_store_test.go
  • internal/exec/terraform_test.go
  • internal/gcp/auth.go
  • internal/gcp/auth_test.go
  • pkg/config/identity_dots_test.go
  • pkg/config/load.go
  • pkg/config/process_yaml.go
  • pkg/function/store.go
  • pkg/function/store_test.go
  • pkg/store/authbridge/resolver.go
  • pkg/store/authbridge/resolver_test.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/google_secret_manager_store.go
  • pkg/store/identity.go
  • pkg/store/identity_test.go
  • pkg/store/options.go
  • pkg/store/registry.go
  • pkg/store/registry_kind_test.go
  • pkg/store/registry_test.go
  • tests/README.md
  • tests/aws_stores_floci_test.go
  • tests/azure_stores_floci_test.go
  • tests/fixtures/scenarios/aws-secrets-floci/atmos.yaml
  • tests/fixtures/scenarios/aws-secrets-floci/components/terraform/secret-consumer/main.tf
  • tests/fixtures/scenarios/aws-secrets-floci/components/terraform/secret-consumer/outputs.tf
  • tests/fixtures/scenarios/aws-secrets-floci/stacks/dev.yaml
  • tests/fixtures/scenarios/aws-secrets-floci/stacks/prod.yaml
  • tests/fixtures/scenarios/aws-store-hooks-floci/atmos.yaml
  • tests/fixtures/scenarios/aws-store-hooks-floci/components/terraform/output-demo/main.tf
  • tests/fixtures/scenarios/aws-store-hooks-floci/components/terraform/output-demo/outputs.tf
  • tests/fixtures/scenarios/aws-store-hooks-floci/stacks/consumer.yaml
  • tests/fixtures/scenarios/aws-store-hooks-floci/stacks/producer.yaml
  • tests/fixtures/scenarios/azure-secrets-floci/atmos.yaml
  • tests/fixtures/scenarios/azure-secrets-floci/stacks/dev.yaml
  • tests/fixtures/scenarios/gcp-secrets-floci/atmos.yaml
  • tests/fixtures/scenarios/gcp-secrets-floci/stacks/dev.yaml
  • tests/floci_harness_test.go
  • tests/gcp_stores_floci_test.go
  • tests/preconditions.go
  • tests/terraform_floci_dag_test.go
  • tests/testhelpers/toolchain.go
  • website/docs/cli/commands/secret/usage.mdx
  • website/docs/cli/configuration/secrets.mdx
  • website/docs/cli/configuration/stores.mdx
  • website/docs/functions/template/atmos.Store.mdx
  • website/docs/functions/yaml/store.get.mdx
  • website/docs/functions/yaml/store.mdx
  • website/docs/intro/multi-cloud.mdx
  • website/docs/stacks/hooks.mdx
  • website/docs/tutorials/sharing-state/stores.mdx

Comment thread .github/workflows/test.yml Resolved
Comment thread cmd/secret/shared_loaders_test.go Resolved
Comment thread cmd/terraform/utils_hooks_test.go Resolved
Comment thread gists/aws-secrets/README.md Resolved
Comment thread gists/aws-store-hooks/README.md Resolved
Comment thread internal/exec/describe_component.go Resolved
Comment thread tests/floci_harness_test.go Resolved
@osterman Erik Osterman (Cloud Posse) (osterman) added the patch A minor, backward compatible change label Jun 17, 2026

@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

Caution

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

⚠️ Outside diff range comments (3)
agent-skills/skills/atmos-config/SKILL.md (1)

180-186: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Move identity out of options in this store example.

This example puts identity in the wrong place. It should be a sibling of kind, not nested under options, or users may silently miss identity-based auth resolution.

Suggested fix
 stores:
   ssm/dev:
     kind: aws/ssm
+    identity: dev-admin
     options:
       region: us-east-1
-      identity: dev-admin
🤖 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 `@agent-skills/skills/atmos-config/SKILL.md` around lines 180 - 186, In the
ssm/dev store example, the identity field is incorrectly nested under the
options section. Move the identity field out of options so it becomes a sibling
of the kind field at the same indentation level. This ensures the configuration
matches the expected structure and prevents users from accidentally
misconfiguring identity-based authentication.
pkg/store/aws_secrets_manager_store.go (1)

87-94: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Reset lazy init state when resolver is injected for an existing identity.

When a store is created with a non-empty identityName, an early call to ensureClient() before resolver injection can cache initErr. A later SetAuthContext(resolver, "") (the normal path for preconfigured identities) does not clear that state, so the store can stay permanently broken.

Suggested fix
 func (s *SecretsManagerStore) SetAuthContext(resolver AuthContextResolver, identityName string) {
 	s.authResolver = resolver
 	if identityName != "" && s.identityName != identityName {
 		s.identityName = identityName
 		s.client = nil
 		s.initOnce = sync.Once{}
 		s.initErr = nil
+		return
+	}
+
+	// Resolver injected for an already-configured identity after a prior lazy-init failure.
+	if identityName == "" && s.identityName != "" && s.client == nil && s.initErr != nil {
+		s.initOnce = sync.Once{}
+		s.initErr = nil
 	}
 }
🤖 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/aws_secrets_manager_store.go` around lines 87 - 94, In the
SetAuthContext method, the lazy initialization state (initOnce and initErr) is
only being reset when the identityName changes, but it should also be reset when
the resolver is injected for an existing identity with an empty identityName.
Modify the condition to additionally reset s.initOnce and s.initErr when
identityName is empty (the normal path for preconfigured identities), ensuring
that any previously cached initialization errors are cleared when a new resolver
is provided, preventing the store from remaining in a broken state.
tests/preconditions.go (1)

365-383: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Serialize global PATH updates across binaries.

Line 365 guards once-per-binary, but Lines 377-382 mutate one global PATH. Parallel misses for different binaries can clobber each other and cause flaky exec.LookPath outcomes.

Suggested fix
 var testToolPathLocks sync.Map
+var testToolPathMu sync.Mutex
@@
 	lockValue, _ := testToolPathLocks.LoadOrStore(binary, &sync.Once{})
 	lockValue.(*sync.Once).Do(func() {
@@
-		path := os.Getenv("PATH")
-		if path == "" {
-			os.Setenv("PATH", binDir)
-			return
-		}
-		os.Setenv("PATH", binDir+string(os.PathListSeparator)+path)
+		testToolPathMu.Lock()
+		defer testToolPathMu.Unlock()
+
+		path := os.Getenv("PATH")
+		if path == "" {
+			_ = os.Setenv("PATH", binDir)
+			return
+		}
+		_ = os.Setenv("PATH", binDir+string(os.PathListSeparator)+path)
 	})
 }
🤖 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 `@tests/preconditions.go` around lines 365 - 383, The code uses a per-binary
lock (testToolPathLocks) to ensure once-per-binary execution, but the PATH
environment variable modification in lines 377-382 is global and shared across
all binaries. When different binaries are processed in parallel, their Do()
functions can execute concurrently and race to modify the global PATH, causing
flaky behavior. Add a global sync.Mutex to serialize all modifications to the
PATH environment variable. Guard the entire os.Setenv("PATH", ...) section with
this global mutex to ensure that only one goroutine modifies PATH at a time,
regardless of which binary is being processed.
🤖 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 `@agent-skills/skills/atmos-config/references/sections-reference.md`:
- Around line 272-278: The `identity` field in the ssm/dev store example is
incorrectly positioned as a nested property under `options` when it should be a
top-level property of the store configuration itself. Move the `identity:
dev-admin` line from under the `options` section to be at the same indentation
level as the `options` key and the `kind: aws/ssm` property in the ssm/dev store
block.

In `@website/docs/cli/commands/toolchain/toolchain-get.mdx`:
- Around line 77-87: The documentation page contains inconsistent examples of
configured Terraform versions - one example shows 1.15.6 (configured) while
other examples display 1.9.8 as the configured/current version. Search through
the entire toolchain-get.mdx page and update all instances where a version is
marked with the "(configured)" label to use the same version number consistently
throughout the page. Select either 1.15.6 or 1.9.8 as the standard configured
version and apply it uniformly across all examples to maintain consistency.

---

Outside diff comments:
In `@agent-skills/skills/atmos-config/SKILL.md`:
- Around line 180-186: In the ssm/dev store example, the identity field is
incorrectly nested under the options section. Move the identity field out of
options so it becomes a sibling of the kind field at the same indentation level.
This ensures the configuration matches the expected structure and prevents users
from accidentally misconfiguring identity-based authentication.

In `@pkg/store/aws_secrets_manager_store.go`:
- Around line 87-94: In the SetAuthContext method, the lazy initialization state
(initOnce and initErr) is only being reset when the identityName changes, but it
should also be reset when the resolver is injected for an existing identity with
an empty identityName. Modify the condition to additionally reset s.initOnce and
s.initErr when identityName is empty (the normal path for preconfigured
identities), ensuring that any previously cached initialization errors are
cleared when a new resolver is provided, preventing the store from remaining in
a broken state.

In `@tests/preconditions.go`:
- Around line 365-383: The code uses a per-binary lock (testToolPathLocks) to
ensure once-per-binary execution, but the PATH environment variable modification
in lines 377-382 is global and shared across all binaries. When different
binaries are processed in parallel, their Do() functions can execute
concurrently and race to modify the global PATH, causing flaky behavior. Add a
global sync.Mutex to serialize all modifications to the PATH environment
variable. Guard the entire os.Setenv("PATH", ...) section with this global mutex
to ensure that only one goroutine modifies PATH at a time, regardless of which
binary is being processed.
🪄 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: 26b24afb-d7a9-428b-abc4-f497783d7172

📥 Commits

Reviewing files that changed from the base of the PR and between fc8cc8a and 0c0e7bf.

📒 Files selected for processing (38)
  • .github/workflows/test.yml
  • agent-skills/skills/atmos-config/SKILL.md
  • agent-skills/skills/atmos-config/references/sections-reference.md
  • agent-skills/skills/atmos-stores/SKILL.md
  • agent-skills/skills/atmos-stores/references/store-providers.md
  • cmd/secret/set.go
  • cmd/secret/set_coverage_test.go
  • cmd/secret/set_test.go
  • docs/prd/secrets-management.md
  • docs/prd/store-identity-support.md
  • examples/auth-stores/README.md
  • examples/auth-stores/atmos.yaml
  • gists/aws-secrets/README.md
  • gists/aws-secrets/stacks/dev.yaml
  • gists/aws-secrets/stacks/prod.yaml
  • gists/aws-store-hooks/stacks/consumer.yaml
  • gists/aws-store-hooks/stacks/producer.yaml
  • pkg/store/aws_secrets_manager_store.go
  • pkg/store/aws_secrets_manager_store_test.go
  • pkg/store/registry.go
  • pkg/store/registry_kind_test.go
  • tests/aws_stores_floci_test.go
  • tests/fixtures/scenarios/aws-secrets-floci/stacks/dev.yaml
  • tests/fixtures/scenarios/aws-secrets-floci/stacks/prod.yaml
  • tests/fixtures/scenarios/aws-store-hooks-floci/stacks/consumer.yaml
  • tests/fixtures/scenarios/aws-store-hooks-floci/stacks/producer.yaml
  • tests/fixtures/scenarios/azure-secrets-floci/stacks/dev.yaml
  • tests/fixtures/scenarios/gcp-secrets-floci/stacks/dev.yaml
  • tests/preconditions.go
  • tests/test-cases/hooks-component-scoped/atmos.yaml
  • tests/testhelpers/toolchain.go
  • website/blog/2026-01-29-artifactory-store-fix.mdx
  • website/blog/2026-02-22-store-identity-support.mdx
  • website/docs/cli/commands/toolchain/toolchain-get.mdx
  • website/docs/cli/commands/toolchain/toolchain-info.mdx
  • website/docs/cli/configuration/stores.mdx
  • website/docs/intro/multi-cloud.mdx
  • website/docs/tutorials/sharing-state/stores.mdx
💤 Files with no reviewable changes (2)
  • cmd/secret/set_coverage_test.go
  • cmd/secret/set.go
✅ Files skipped from review due to trivial changes (12)
  • website/docs/cli/commands/toolchain/toolchain-info.mdx
  • tests/test-cases/hooks-component-scoped/atmos.yaml
  • examples/auth-stores/README.md
  • website/blog/2026-01-29-artifactory-store-fix.mdx
  • website/blog/2026-02-22-store-identity-support.mdx
  • tests/fixtures/scenarios/aws-store-hooks-floci/stacks/producer.yaml
  • docs/prd/store-identity-support.md
  • tests/fixtures/scenarios/gcp-secrets-floci/stacks/dev.yaml
  • docs/prd/secrets-management.md
  • tests/fixtures/scenarios/aws-secrets-floci/stacks/prod.yaml
  • agent-skills/skills/atmos-stores/references/store-providers.md
  • agent-skills/skills/atmos-stores/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (10)
  • tests/fixtures/scenarios/aws-store-hooks-floci/stacks/consumer.yaml
  • tests/testhelpers/toolchain.go
  • gists/aws-store-hooks/stacks/consumer.yaml
  • gists/aws-secrets/stacks/dev.yaml
  • tests/fixtures/scenarios/aws-secrets-floci/stacks/dev.yaml
  • tests/fixtures/scenarios/azure-secrets-floci/stacks/dev.yaml
  • .github/workflows/test.yml
  • pkg/store/aws_secrets_manager_store_test.go
  • website/docs/cli/configuration/stores.mdx
  • website/docs/tutorials/sharing-state/stores.mdx

@codecov

codecov Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.09375% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.03%. Comparing base (dbc8dfb) to head (4550863).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/config/load.go 84.61% 2 Missing and 2 partials ⚠️
pkg/config/process_yaml.go 94.73% 1 Missing and 1 partial ⚠️
pkg/store/aws_secrets_manager_store.go 90.47% 1 Missing and 1 partial ⚠️
tests/preconditions.go 92.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2625      +/-   ##
==========================================
+ Coverage   79.77%   80.03%   +0.26%     
==========================================
  Files        1352     1353       +1     
  Lines      126821   127034     +213     
==========================================
+ Hits       101169   101676     +507     
+ Misses      20012    19711     -301     
- Partials     5640     5647       +7     
Flag Coverage Δ
unittests 80.03% <96.09%> (+0.26%) ⬆️

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

Files with missing lines Coverage Δ
cmd/secret/set.go 94.02% <ø> (+4.28%) ⬆️
cmd/secret/shared.go 76.59% <100.00%> (+4.06%) ⬆️
cmd/terraform/utils.go 61.73% <100.00%> (+0.80%) ⬆️
internal/exec/describe_component.go 78.09% <100.00%> (+0.49%) ⬆️
internal/exec/template_funcs_store.go 100.00% <100.00%> (ø)
internal/gcp/auth.go 87.80% <100.00%> (+5.04%) ⬆️
pkg/auth/cloud/aws/resolver.go 100.00% <100.00%> (ø)
pkg/auth/cloud/aws/setup.go 92.07% <100.00%> (+1.71%) ⬆️
pkg/auth/identities/aws/assume_role.go 85.97% <100.00%> (+0.04%) ⬆️
pkg/auth/identities/aws/assume_root.go 91.91% <100.00%> (+0.02%) ⬆️
... and 16 more

... and 23 files with indirect coverage changes

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

…ixes

Add testcontainers-based auto-start for the opt-in Floci cloud-emulator E2E
tests. When ATMOS_TEST_FLOCI=true and the FLOCI_* endpoints are unset, the
suite detects the container runtime (Docker or Podman, via pkg/container),
wires Podman's API socket into testcontainers, and brings the AWS/GCP/Azure
emulators up on dynamic ports, tearing them down afterward. CI keeps its
service containers (pre-set endpoints make auto-start a no-op), and tests skip
cleanly with an actionable message when no runtime is available.

Also includes this branch's AWS SSM / Secrets Manager / Azure Key Vault / GCP
Secret Manager store auth and endpoint changes and their tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add a focused test for the error-propagation paths (failing scalar decode
inside a mapping and a sequence) and the default/alias branch of
decodeNodeWithYamlFunctions, raising it from ~73% to ~97%.

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: 3

🤖 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 755-760: The test for buildAuthConfigOpts in the SSMStore test
file only validates the count of returned options using assert.Len, but does not
verify the actual behavior of those options such as region and endpoint
selection. After asserting the option length, add additional assertions to
verify the applied effects of the options by checking that the correct region
and endpoint values are actually set when the options are applied, ensuring
precedence rules are maintained and preventing future regressions in option
behavior.

In `@tests/cli_test.go`:
- Around line 786-789: The maybeStartFloci function call on line 786 uses
context.Background() which has no timeout, potentially causing TestMain to block
indefinitely if Podman or Docker calls hang. Replace the context.Background()
argument with a context that has an appropriate timeout (such as using
context.WithTimeout), ensuring the auto-start process for Floci has a defined
time limit before it fails gracefully and allows the test suite to proceed.

In `@tests/precondition_cached_tools_test.go`:
- Around line 78-82: The subtest hardcodes Unix-specific paths `/usr/bin` in
both the t.Setenv call on line 78 and the assertion on line 81, which violates
test portability requirements. Replace the hardcoded `/usr/bin` strings with
OS-agnostic paths constructed using filepath.Join() to ensure the test works
correctly across different operating systems. Apply the same filepath.Join()
approach consistently to both the environment variable setting and the expected
PATH value in the assert.Equal comparison.
🪄 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: 1cbf5233-b18b-4b70-ba5e-80bf73b410c6

📥 Commits

Reviewing files that changed from the base of the PR and between d61e8f6 and 6c8b78b.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (27)
  • .github/workflows/test.yml
  • agent-skills/skills/atmos-stores/references/store-providers.md
  • cmd/secret/shared.go
  • cmd/terraform/utils.go
  • gists/aws-store-hooks/README.md
  • go.mod
  • internal/exec/describe_component.go
  • internal/gcp/auth.go
  • pkg/config/load.go
  • pkg/config/load_yaml_path_test.go
  • pkg/config/process_yaml_test.go
  • pkg/function/store.go
  • pkg/store/authbridge/resolver_test.go
  • pkg/store/aws_secrets_manager_store.go
  • pkg/store/aws_secrets_manager_store_endpoint_test.go
  • pkg/store/aws_ssm_param_store_test.go
  • pkg/store/azure_keyvault_store.go
  • pkg/store/azure_keyvault_store_endpoint_test.go
  • pkg/store/google_secret_manager_store.go
  • pkg/store/options.go
  • pkg/store/options_test.go
  • tests/README.md
  • tests/cli_test.go
  • tests/floci_containers_test.go
  • tests/floci_harness_test.go
  • tests/precondition_cached_tools_test.go
  • website/docs/cli/configuration/stores.mdx
✅ Files skipped from review due to trivial changes (2)
  • tests/README.md
  • gists/aws-store-hooks/README.md
🚧 Files skipped from review as they are similar to previous changes (13)
  • pkg/store/options.go
  • cmd/secret/shared.go
  • pkg/function/store.go
  • cmd/terraform/utils.go
  • pkg/store/google_secret_manager_store.go
  • internal/exec/describe_component.go
  • pkg/config/load.go
  • .github/workflows/test.yml
  • pkg/store/azure_keyvault_store.go
  • internal/gcp/auth.go
  • website/docs/cli/configuration/stores.mdx
  • tests/floci_harness_test.go
  • pkg/store/aws_secrets_manager_store.go

Comment thread pkg/store/aws_ssm_param_store_test.go Resolved
Comment thread tests/cli_test.go Resolved
Comment thread tests/precondition_cached_tools_test.go Resolved
- aws_ssm_param_store_test: assert applied option behavior (region,
  endpoint, profile, config/creds files) not just option count, so
  auth precedence can't regress silently
- precondition_cached_tools_test: use OS-agnostic temp-dir PATH fixture
  instead of hardcoded /usr/bin
- cli_test: bound Floci auto-start with a 3m timeout context so a hung
  Podman/Docker call can't block TestMain indefinitely

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 18, 2026
- setup.go: add the required perf.Track defer to the public SetAuthContext
  function, matching the package convention (nil atmosConfig)
- setup_test: make TestSetAuthContext_WithIdentityResolverEndpoint
  table-driven to also exercise the strings.ToLower identity-name fallback
  in endpointURLFromManager (mixed-case input, lowercase-keyed identity)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@github-actions github-actions Bot added size/xl Extra large size PR and removed size/l Large size PR labels Jun 18, 2026

@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: 1

🤖 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/hashicorp_vault_store_test.go`:
- Around line 92-101: In the HTTP handler defined with mux.HandleFunc for the
"/v1/secret/data/" path, replace the require.NoError call on the
json.Decoder.Decode line with explicit error handling that writes an HTTP error
response instead of using require.FailNow() inside the handler goroutine.
Additionally, add the missing writeJSON helper function to this file that sets
the Content-Type header to application/json and marshals the provided value to
JSON, writing it to the response writer with proper error handling.
🪄 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: 3b53eee1-8c65-4efa-8c92-ae432e0510aa

📥 Commits

Reviewing files that changed from the base of the PR and between f66b688 and 3ee96b8.

📒 Files selected for processing (9)
  • pkg/auth/cloud/aws/setup.go
  • pkg/auth/cloud/aws/setup_test.go
  • pkg/secrets/providers/store_test.go
  • pkg/secrets/service_test.go
  • pkg/store/hashicorp_vault_store.go
  • pkg/store/hashicorp_vault_store_test.go
  • pkg/store/onepassword_client_test.go
  • pkg/store/onepassword_store_test.go
  • pkg/store/registry_kind_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/auth/cloud/aws/setup_test.go
  • pkg/auth/cloud/aws/setup.go

Comment thread pkg/store/hashicorp_vault_store_test.go Resolved
@osterman

Copy link
Copy Markdown
Member Author

CodeRabbit (@coderabbitai) any regressions in test coverage or curve fitting?

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Count new vs removed test functions
echo "=== NEW TEST FUNCTIONS ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^+func Test' | wc -l

echo "=== REMOVED TEST FUNCTIONS ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^-func Test' | wc -l

echo "=== REMOVED TEST FUNCTION NAMES ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^-func Test'

echo "=== NEW TEST FUNCTION NAMES (sample) ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^+func Test'

echo ""
echo "=== TESTS THAT ONLY SET UP MOCKS AND CHECK NON-NIL RESOLVER (potential curve-fitting) ==="
rg -n "ResolverOnly" --type go

echo ""
echo "=== CHECKING FOR TESTS SKIPPING ACTUAL BEHAVIOR ASSERTIONS ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^+' | grep -E 'assert\.(NotNil|True|Equal.*nil)' | head -30

echo ""
echo "=== COVERAGE GATE: test.yml codecov step ==="
git diff origin/main...HEAD -- '.github/workflows/test.yml' | grep -A5 -B5 'coverage'

Length of output: 6696



@osterman: Clean picture overall — no regressions, net +46 tests (49 added, 3 removed).

Removed tests — all justified:

Removed Reason
TestGuardInstanceOverride + TestRunSecretSet_OverrideGuard guardInstanceOverride was intentionally deleted; replaced by TestRunSecretSet_SharedScopes
TestNewSSMStore_WithoutIdentity_EagerInit Behavioral flip to lazy init; replaced by TestNewSSMStore_WithoutIdentity_LazyInit

Mild curve-fitting concern — the three *_ResolverOnly tests:

TestInjectSecretStoreAuthResolver_ResolverOnly
TestInjectHookStoreAuthResolver_ResolverOnly
TestInjectDescribeComponentStoreAuthResolver_ResolverOnly

These only assert that SetAuthContext receives a non-nil resolver + empty identity name — they don't exercise the resolver callback itself. The actual resolver behavior is covered separately in pkg/store/authbridge/resolver_test.go, so it's not a gap per se, but the injection-site tests are thin. The lazy-init first-call path (client creation on first Get/Set) for SSM/ASM is also not exercised at the unit level — it relies on the Floci E2E tests to cover it end-to-end.

Coverage gate change (hashFiles('coverage.out') != '') is a net improvement — previously the Codecov upload would run even when tests bailed before generating a coverage file, which caused noisy upload failures.

Short answer: coverage trends up, no regressions, the ResolverOnly tests are a known-shallow pattern worth watching if the auth wiring grows more complex.

@aknysh
Andriy Knysh (aknysh) merged commit 8a9754b into main Jun 19, 2026
64 checks passed
@atmos-pro

atmos-pro Bot commented Jun 19, 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.

@aknysh
Andriy Knysh (aknysh) deleted the osterman/fix-aws-ssm-secrets-auth branch June 19, 2026 17:39
@mergify mergify Bot removed the needs-cloudposse Needs Cloud Posse assistance label Jun 19, 2026
@github-actions

Copy link
Copy Markdown

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

Andriy Knysh (aknysh) added a commit that referenced this pull request Jun 27, 2026
The after-apply `store-outputs` hook resolves store credentials on a separate,
freshly-loaded config from the main terraform path. It injected the store auth
resolver but no default identity, so identity-less stores fell back to the
default AWS SDK credential chain — empty under Atmos auth — and failed with
"no EC2 IMDS role found". The main terraform path already inherits the run's
identity; this brings the hook path in line (the follow-up deferred in #2625).

- internal/exec: add HookStoreDefaultIdentity, mirroring the main path
  (auto-detect the active identity from the auth manager chain, normalize
  empty/select/disabled to ""). Returns "" with no auth manager, so runs
  without Atmos auth keep the prior ambient/default-credential behavior.
- cmd/terraform: injectHookStoreAuthResolver now injects the resolver WITH the
  default identity via SetAuthContextResolverWithDefaultIdentity.
- pkg/store: defaultIdentityForStore was missing *SecretsManagerStore (aws/asm),
  so AWS Secrets Manager stores never inherited a default identity on any path.
  Add the case so aws/asm behaves like aws/ssm.

Tests: internal/exec.TestHookStoreDefaultIdentity (new); cmd/terraform
TestInjectHookStoreAuthResolver_InheritsDefaultIdentity (replaces _ResolverOnly);
pkg/store default-identity test updated so identity-less aws/asm asserts
inheritance; Floci E2E TestAWSStoreHooks_InheritedIdentity_FlociE2E with new
fixture aws-store-hooks-floci-inherit (no per-store identity, ambient creds
cleared, hook write succeeds). Fix doc under docs/fixes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Andriy Knysh (aknysh) added a commit that referenced this pull request Jun 28, 2026
)

* fix(hooks): store-output hooks inherit the run's default identity

The after-apply `store-outputs` hook resolves store credentials on a separate,
freshly-loaded config from the main terraform path. It injected the store auth
resolver but no default identity, so identity-less stores fell back to the
default AWS SDK credential chain — empty under Atmos auth — and failed with
"no EC2 IMDS role found". The main terraform path already inherits the run's
identity; this brings the hook path in line (the follow-up deferred in #2625).

- internal/exec: add HookStoreDefaultIdentity, mirroring the main path
  (auto-detect the active identity from the auth manager chain, normalize
  empty/select/disabled to ""). Returns "" with no auth manager, so runs
  without Atmos auth keep the prior ambient/default-credential behavior.
- cmd/terraform: injectHookStoreAuthResolver now injects the resolver WITH the
  default identity via SetAuthContextResolverWithDefaultIdentity.
- pkg/store: defaultIdentityForStore was missing *SecretsManagerStore (aws/asm),
  so AWS Secrets Manager stores never inherited a default identity on any path.
  Add the case so aws/asm behaves like aws/ssm.

Tests: internal/exec.TestHookStoreDefaultIdentity (new); cmd/terraform
TestInjectHookStoreAuthResolver_InheritsDefaultIdentity (replaces _ResolverOnly);
pkg/store default-identity test updated so identity-less aws/asm asserts
inheritance; Floci E2E TestAWSStoreHooks_InheritedIdentity_FlociE2E with new
fixture aws-store-hooks-floci-inherit (no per-store identity, ambient creds
cleared, hook write succeeds). Fix doc under docs/fixes.

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

* address comments

---------

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

This branch was successfully deployed

1 active deployment
preview — 4550863e Deployed Jun 19, 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/xl Extra large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants