Skip to content

Support GitHub OIDC Assume Roles with Web Identity - #1738

Merged
Andriy Knysh (aknysh) merged 9 commits into
mainfrom
auth-fix-github-oidc
Nov 11, 2025
Merged

Andriy Knysh (aknysh) merged 9 commits into
mainfrom
auth-fix-github-oidc

Conversation

@goruha

@goruha Igor Rodionov (goruha) commented Nov 1, 2025 •

Copy link
Copy Markdown
Member

what

  • Updated the GitHub OIDC provider to use AWS AssumeRoleWithWebIdentity authentication, referencing the AWS GitHub Actions implementation.

why

  • Fix bug when GitHub OIDC auth got JWT token, but did not authenticate on AWS

Summary by CodeRabbit

  • New Features

    • Added OIDC (web identity) support for AWS authentication to allow web-identity-based sign-in.
  • Bug Fixes

    • Ensure AWS credentials always include a valid region (defaults to us-east-1) and improved region/duration handling.
  • Tests

    • Expanded test coverage for OIDC/web-identity flows, combined credential paths, duration parsing, error cases, and anonymous/ambient credential scenarios.
  • Documentation

    • Updated license/NOTICE references to reflect bumped dependency versions.
  • Dependencies

    • Bumped AWS SDK v2, Azure identity, and related dependency versions.

@goruha
Igor Rodionov (goruha) requested a review from a team as a code owner November 1, 2025 20:41
@github-actions github-actions Bot added the size/l Large size PR label Nov 1, 2025
@github-actions

github-actions Bot commented Nov 1, 2025 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

  • go.mod

@goruha Igor Rodionov (goruha) added the patch A minor, backward compatible change label Nov 1, 2025
@coderabbitai

coderabbitai Bot commented Nov 1, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds OIDC (web identity) support to AWS assume-role authentication, branching Authenticate to handle OIDC or AWS credentials, introduces helpers for web-identity flow, centralizes duration key and default region handling, updates tests, and bumps SDK dependency versions.

Changes

Cohort / File(s) Summary
OIDC / Web-Identity and Region/Duration Fixes
pkg/auth/identities/aws/assume_role.go
Adds assumeRoleWithWebIdentity, buildAssumeRoleWithWebIdentityInput, toAWSCredentialsFromWebIdentity; branches Authenticate for OIDC vs AWS credentials; introduces defaultAWSRegion and principalDurationKey; ensures region defaults to us-east-1; isolates config loading for web-identity (anonymous) and standard STS client creation.
Tests — OIDC, duration, region, error cases
pkg/auth/identities/aws/assume_role_test.go
Updates error expectations; removes old invalid-type assertion; adds comprehensive OIDC/web-identity tests (input building, conversion, default region, duration parsing), introduces mockInvalidCredentials, and verifies both AWS and OIDC paths and error semantics.
Dependency bumps & Notices
go.mod, NOTICE
Bumps Azure azidentity and multiple AWS SDK v2 modules (config, credentials, feature/s3/manager, sts) and updates corresponding license URL entries in NOTICE.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Authenticate
    participant StdPath as "Standard AWS Path"
    participant OIDCPath as "OIDC/Web Identity Path"
    participant STS

    Client->>Authenticate: Authenticate(credentials)
    alt credentials are OIDC
        Authenticate->>OIDCPath: buildAssumeRoleWithWebIdentityInput
        OIDCPath->>STS: AssumeRoleWithWebIdentity (anonymous config)
        STS-->>OIDCPath: STS WebIdentity response (temp creds)
        OIDCPath->>Authenticate: toAWSCredentialsFromWebIdentity
    else credentials are AWS
        Authenticate->>StdPath: build assume-role input (base creds)
        StdPath->>STS: AssumeRole (with base creds)
        STS-->>StdPath: STS response (temp creds)
        StdPath->>Authenticate: toAWSCredentials
    else unsupported type
        Authenticate-->>Client: error ("base AWS credentials or OIDC credentials are required")
    end
    Authenticate-->>Client: AWSCredentials (region ensured, default us-east-1)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to focus on:
    • pkg/auth/identities/aws/assume_role.go: branching logic between OIDC and AWS paths, STS client construction (anonymous vs base creds), duration parsing via principalDurationKey, and region normalization/defaulting.
    • pkg/auth/identities/aws/assume_role_test.go: new OIDC tests, mockInvalidCredentials, and cases that manipulate environment/config for credential discovery.
    • go.mod / NOTICE: confirm dependency bumps align with SDK usage and license path updates.

Possibly related PRs

Suggested labels

minor

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding OIDC-based authentication support via AWS AssumeRoleWithWebIdentity, which directly matches the core implementation in the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch auth-fix-github-oidc

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

🧹 Nitpick comments (2)
pkg/auth/providers/github/oidc_test.go (2)

39-136: Consider using testify/mock embedding for cleaner mocks.

The mockAuthManager works but is verbose with many stub methods. Consider embedding mock.Mock and implementing only the methods actually called in tests.

Example refactor:

 type mockAuthManager struct {
+	mock.Mock
-	chain      []string
-	identities map[string]schema.Identity
 }

 func (m *mockAuthManager) GetChain() []string {
-	return m.chain
+	args := m.Called()
+	return args.Get(0).([]string)
 }

 func (m *mockAuthManager) GetIdentities() map[string]schema.Identity {
-	return m.identities
+	args := m.Called()
+	return args.Get(0).(map[string]schema.Identity)
 }

-// Remove stub methods that return "not implemented" errors
-// They can be added via mock.On() when needed

Based on learnings.


619-632: Tighten logout error assertions.

The current error checking is too permissive and might mask actual bugs. Consider mocking the file system or creating temporary files to test the actual cleanup behavior, or at least verify the specific error type.

Example refactor to test actual cleanup:

 func TestOIDCProvider_Logout(t *testing.T) {
+	// Create a temporary credentials file to test cleanup
+	tmpDir := t.TempDir()
+	t.Setenv("HOME", tmpDir)
+	
+	// Create AWS credentials directory structure
+	awsDir := filepath.Join(tmpDir, ".aws")
+	require.NoError(t, os.MkdirAll(awsDir, 0755))
+	credFile := filepath.Join(awsDir, "credentials")
+	require.NoError(t, os.WriteFile(credFile, []byte("[default]\naws_access_key_id=test\n"), 0644))
+	
 	p, err := NewOIDCProvider("github-oidc", validOidcSpec())
 	require.NoError(t, err)

 	ctx := context.Background()
 	err = p.Logout(ctx)
-	if err != nil {
-		assert.True(t, errors.Is(err, errUtils.ErrProviderLogout) || errors.Is(err, errUtils.ErrLogoutFailed))
-	}
+	assert.NoError(t, err)
+	
+	// Verify credentials file was removed
+	_, err = os.Stat(credFile)
+	assert.True(t, os.IsNotExist(err))
 }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e09e62b and 4822513.

📒 Files selected for processing (2)
  • NOTICE (1 hunks)
  • pkg/auth/providers/github/oidc_test.go (12 hunks)
✅ Files skipped from review due to trivial changes (1)
  • NOTICE
🧰 Additional context used
📓 Path-based instructions (3)
pkg/**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

Place business logic in pkg rather than in cmd

Files:

  • pkg/auth/providers/github/oidc_test.go
**/*_test.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios

Files:

  • pkg/auth/providers/github/oidc_test.go
**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments

Files:

  • pkg/auth/providers/github/oidc_test.go
🧠 Learnings (6)
📓 Common learnings
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1149
File: internal/exec/go_getter_utils.go:263-264
Timestamp: 2025-03-25T12:24:36.177Z
Learning: Tests for the default Bitbucket username fallback to "x-token-auth" will be added during a future refactoring phase rather than in this PR.
📚 Learning: 2025-09-25T01:02:48.697Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: pkg/auth/manager.go:304-312
Timestamp: 2025-09-25T01:02:48.697Z
Learning: The auth manager in pkg/auth/manager.go should remain cloud-agnostic and not contain AWS-specific logic or references to specific cloud providers. Keep the manager generic and extensible.

Applied to files:

  • pkg/auth/providers/github/oidc_test.go
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Consider using testify/mock for creating mock implementations

Applied to files:

  • pkg/auth/providers/github/oidc_test.go
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to **/*_test.go : Use table-driven tests for multiple scenarios

Applied to files:

  • pkg/auth/providers/github/oidc_test.go
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to **/*_test.go : Test both happy paths and error conditions

Applied to files:

  • pkg/auth/providers/github/oidc_test.go
📚 Learning: 2025-08-15T14:43:41.030Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1352
File: pkg/store/artifactory_store_test.go:108-113
Timestamp: 2025-08-15T14:43:41.030Z
Learning: In test files for the atmos project, it's acceptable to ignore errors from os.Setenv/Unsetenv operations during test environment setup and teardown, as these are controlled test scenarios.

Applied to files:

  • pkg/auth/providers/github/oidc_test.go
🧬 Code graph analysis (1)
pkg/auth/providers/github/oidc_test.go (5)
pkg/auth/types/interfaces.go (2)
  • Identity (71-115)
  • Provider (21-58)
pkg/auth/providers/github/oidc.go (1)
  • NewOIDCProvider (46-70)
pkg/auth/types/aws_credentials.go (1)
  • AWSCredentials (16-24)
errors/errors.go (2)
  • ErrProviderLogout (432-432)
  • ErrLogoutFailed (427-427)
pkg/schema/schema_auth.go (1)
  • SessionConfig (38-40)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Acceptance Tests (macos)
  • GitHub Check: Acceptance Tests (windows)
  • GitHub Check: Acceptance Tests (linux)
  • GitHub Check: Summary
🔇 Additional comments (5)
pkg/auth/providers/github/oidc_test.go (5)

26-37: Mock implementation looks solid.

The mockSTSClient follows testify/mock patterns correctly and provides the necessary interface for testing AWS STS interactions.


226-303: Excellent test coverage for PreAuthenticate.

This test follows the coding guidelines perfectly with table-driven structure and comprehensive coverage of both success and error scenarios.


470-528: Validation test handles edge cases well.

The test correctly distinguishes between validation errors that occur during provider creation versus those caught by the Validate method.


530-540: Environment variable test looks good.

Correctly verifies that both AWS_REGION and AWS_DEFAULT_REGION are set to the configured region.


644-816: Comprehensive testing of session management and STS interactions.

Both TestOIDCProvider_RequestedSessionSeconds and TestOIDCProvider_AssumeRoleWithWebIdentity provide excellent coverage:

  • Session duration boundary testing (default, min, max)
  • STS mock interactions with proper input validation using mock.MatchedBy
  • Error handling scenarios

Comment thread pkg/auth/providers/github/oidc_test.go Resolved
@codecov

codecov Bot commented Nov 2, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.22807% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.75%. Comparing base (4fcddbf) to head (7c9f3be).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/auth/identities/aws/assume_role.go 91.22% 3 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1738      +/-   ##
==========================================
+ Coverage   70.67%   70.75%   +0.08%     
==========================================
  Files         432      432              
  Lines       39866    39916      +50     
==========================================
+ Hits        28175    28243      +68     
+ Misses       9289     9271      -18     
  Partials     2402     2402              
Flag Coverage Δ
unittests 70.75% <91.22%> (+0.08%) ⬆️

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

Files with missing lines Coverage Δ
pkg/auth/identities/aws/assume_role.go 76.69% <91.22%> (+5.39%) ⬆️

... and 5 files with indirect coverage changes

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

@github-actions

github-actions Bot commented Nov 2, 2025

Copy link
Copy Markdown

These changes were released in v1.197.0-test.33.

Comment thread pkg/auth/providers/github/oidc.go Resolved
Comment thread pkg/auth/providers/github/oidc.go Resolved
Comment thread pkg/auth/providers/github/oidc.go Resolved
Comment thread pkg/auth/providers/github/oidc.go Resolved
Comment thread pkg/auth/providers/github/oidc.go Resolved
Comment thread pkg/auth/providers/github/oidc.go Resolved
Comment thread pkg/auth/providers/github/oidc.go Resolved
@autofix-ci
autofix-ci Bot temporarily deployed to feature-releases November 2, 2025 18:58 Inactive
@autofix-ci
autofix-ci Bot temporarily deployed to feature-releases November 2, 2025 18:59 Inactive

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9e5b8f0 and 61b2a12.

📒 Files selected for processing (2)
  • pkg/auth/identities/aws/assume_role.go (2 hunks)
  • pkg/auth/identities/aws/assume_role_test.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
pkg/**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

Place business logic in pkg rather than in cmd

Files:

  • pkg/auth/identities/aws/assume_role.go
  • pkg/auth/identities/aws/assume_role_test.go
**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments

Files:

  • pkg/auth/identities/aws/assume_role.go
  • pkg/auth/identities/aws/assume_role_test.go
**/!(*_test).go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

Document all exported functions, types, and methods with Go doc comments

Files:

  • pkg/auth/identities/aws/assume_role.go
**/*_test.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios

Files:

  • pkg/auth/identities/aws/assume_role_test.go
🧠 Learnings (3)
📓 Common learnings
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to **/*_test.go : Test both happy paths and error conditions

Applied to files:

  • pkg/auth/identities/aws/assume_role_test.go
📚 Learning: 2025-09-09T02:14:36.708Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1452
File: internal/auth/types/whoami.go:14-15
Timestamp: 2025-09-09T02:14:36.708Z
Learning: The WhoamiInfo struct in internal/auth/types/whoami.go requires the Credentials field to be JSON-serializable for keystore unmarshaling operations, despite security concerns about credential exposure.

Applied to files:

  • pkg/auth/identities/aws/assume_role_test.go
🧬 Code graph analysis (2)
pkg/auth/identities/aws/assume_role.go (6)
pkg/auth/types/github_oidc_credentials.go (1)
  • OIDCCredentials (15-19)
pkg/auth/types/aws_credentials.go (1)
  • AWSCredentials (16-24)
pkg/logger/log.go (2)
  • Errorf (59-61)
  • Warn (44-46)
errors/errors.go (2)
  • ErrInvalidIdentityConfig (376-376)
  • ErrAuthenticationFailed (379-379)
pkg/auth/cloud/aws/resolver.go (1)
  • GetResolverConfigOption (25-49)
pkg/auth/cloud/aws/env.go (1)
  • LoadIsolatedAWSConfig (100-124)
pkg/auth/identities/aws/assume_role_test.go (4)
pkg/auth/types/interfaces.go (4)
  • Identity (71-115)
  • Provider (21-58)
  • ValidationInfo (268-283)
  • ICredentials (254-265)
pkg/schema/schema_auth.go (3)
  • Identity (48-57)
  • IdentityVia (60-63)
  • Provider (21-35)
pkg/auth/types/github_oidc_credentials.go (1)
  • OIDCCredentials (15-19)
pkg/auth/types/aws_credentials.go (1)
  • AWSCredentials (16-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: release / goreleaser
  • GitHub Check: release / goreleaser
  • GitHub Check: Build (windows)
  • GitHub Check: Build (linux)
  • GitHub Check: Build (linux)
  • GitHub Check: Build (windows)
  • GitHub Check: Review Dependency Licenses
  • GitHub Check: autofix
  • GitHub Check: autofix
  • GitHub Check: Analyze (go)
  • GitHub Check: Review Dependency Licenses
  • GitHub Check: Summary

Comment thread pkg/auth/identities/aws/assume_role.go Resolved

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 61b2a12 and e14bdc4.

📒 Files selected for processing (1)
  • NOTICE (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to go.{mod,sum} : Keep dependencies up to date

Applied to files:

  • NOTICE
🪛 GitHub Actions: Dependency Review
NOTICE

[error] 1-1: NOTICE file is out of date. Run './scripts/generate-notice.sh' locally and commit the changes.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: [localstack] demo-localstack
  • GitHub Check: Acceptance Tests (macos)
  • GitHub Check: Acceptance Tests (windows)
  • GitHub Check: Acceptance Tests (linux)
  • GitHub Check: release / goreleaser
  • GitHub Check: Summary

Comment thread NOTICE Resolved
@github-actions

Copy link
Copy Markdown

These changes were released in v1.198.0-test.12.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 11, 2025
@aknysh

Andriy Knysh (aknysh) commented Nov 11, 2025 •

Copy link
Copy Markdown
Member

CodeRabbit (@coderabbitai) full review please.
Also, please check if your comment has been correctly addressed in the last commit:

Fix STS client to use anonymous credentials for web identity

In the OIDC path we deliberately have no base AWS keys, but this STS client still tries to resolve the standard credential chain. That causes LoadIsolatedAWSConfig/STS to fail before the token exchange. Set the client to use aws.AnonymousCredentials{} so AssumeRoleWithWebIdentity can proceed.

@coderabbitai

coderabbitai Bot commented Nov 11, 2025

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch the main implementation file
cat pkg/auth/identities/aws/assume_role.go

Length of output: 22134


🏁 Script executed:

#!/bin/bash
# Fetch the test file to review test coverage
cat pkg/auth/identities/aws/assume_role_test.go

Length of output: 35768


🏁 Script executed:

#!/bin/bash
# Check for any other related files that might have changed
git diff main...auth-fix-github-oidc --name-only

Length of output: 207


🏁 Script executed:

#!/bin/bash
# Get the actual diff to see what changed
git diff main...auth-fix-github-oidc -- pkg/auth/identities/aws/assume_role.go

Length of output: 49


🏁 Script executed:

#!/bin/bash
# Get the current branch and list changed files
echo "Current branch:"
git branch --show-current

echo -e "\nChanged files in this branch:"
git diff --name-only origin/main...HEAD 2>/dev/null || git diff --name-only HEAD~5..HEAD

Length of output: 255


🏁 Script executed:

#!/bin/bash
# Get stats on the changes
echo "Code statistics:"
git diff --stat origin/main...HEAD 2>/dev/null || git diff --stat HEAD~5..HEAD

Length of output: 209


🏁 Script executed:

#!/bin/bash
# Look for any TODO or FIXME comments in the changed code
echo "Checking for TODOs or FIXMEs:"
rg -n 'TODO|FIXME' pkg/auth/identities/aws/assume_role.go pkg/auth/identities/aws/assume_role_test.go || echo "None found"

Length of output: 40


Andriy Knysh (@aknysh) I've completed a comprehensive review of PR #1738. Great news - your comment about using anonymous credentials for web identity has been properly addressed!

✅ Fix Verification

The anonymous credentials fix is correctly implemented in assumeRoleWithWebIdentity (Line 171):

config.WithCredentialsProvider(aws.AnonymousCredentials{})

This is accompanied by excellent inline documentation (lines 159-170) that explains:

  • Why anonymous credentials are critical for AssumeRoleWithWebIdentity
  • What would happen without them (EC2 IMDS hangs, credential resolution failures)
  • The difference between AWS SDK v1 and v2 behavior
  • References to similar patterns in other auth flows

🎯 Test Coverage

Three dedicated test cases validate the fix:

  1. TestAssumeRoleIdentity_assumeRoleWithWebIdentity_UsesAnonymousCredentials - Verifies ambient credentials don't interfere with web identity flow
  2. TestAssumeRoleIdentity_assumeRoleWithWebIdentity_IgnoresAmbientCredentials - Tests isolation from multiple environment credential sources
  3. TestAssumeRoleIdentity_WebIdentityVsStandardAssumeRole_DifferentCredentialHandling - Documents the behavioral difference between standard and web identity flows

📋 Overall Implementation Review

Strengths:

  • ✅ Clean separation between standard AssumeRole (AWS credentials) and AssumeRoleWithWebIdentity (OIDC)
  • ✅ Proper use of LoadIsolatedAWSConfig to avoid environment variable conflicts
  • ✅ Comprehensive error handling with descriptive messages
  • ✅ Region resolution with sensible defaults (us-east-1)
  • ✅ Duration and session name handling with validation
  • ✅ Extensive test coverage including edge cases
  • ✅ No TODOs or FIXMEs left in code

Architecture:

  • The implementation correctly detects credential type in Authenticate() and routes to the appropriate flow
  • New helper methods follow existing naming conventions and patterns
  • Error messages clearly indicate whether AWS or OIDC credentials are required

Minor Observations:

  • Error handling uses errors.Join() appropriately for context
  • Session name sanitization is robust (handles length, invalid characters, trailing dashes)
  • The implementation matches the AWS GitHub Actions pattern referenced in the PR description

🎉 Conclusion

The implementation is production-ready. The anonymous credentials fix addresses the exact issue you identified, preventing the SDK from attempting credential resolution in scenarios where:

  • Code runs on EC2/ECS (would try to use instance role)
  • CI/CD environments (would hang on IMDS timeout)
  • Environments with ambient credentials (would cause signing errors)

The code quality is excellent with thorough documentation and comprehensive test coverage.


🧠 Learnings used
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.

Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
✅ Actions performed

Full review triggered.

@autofix-ci
autofix-ci Bot temporarily deployed to feature-releases November 11, 2025 14:44 Inactive
@autofix-ci
autofix-ci Bot temporarily deployed to feature-releases November 11, 2025 14:44 Inactive
@coderabbitai

coderabbitai Bot commented Nov 11, 2025

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the current implementation of assumeRoleWithWebIdentity in assume_role.go
cat pkg/auth/identities/aws/assume_role.go

Length of output: 22134


🏁 Script executed:

#!/bin/bash
# Check recent commits to see the fix
git log --oneline -10

Length of output: 15


🏁 Script executed:

#!/bin/bash
# Show the diff of the most recent commit to see the anonymous credentials fix
git log -1 -p

Length of output: 273575


Andriy Knysh (@aknysh) Thanks. I verified the last commit addresses the comment: in the OIDC path we now explicitly set aws.AnonymousCredentials via config.WithCredentialsProvider(aws.AnonymousCredentials{}) before creating the STS client. This prevents the default credential chain from resolving and allows AssumeRoleWithWebIdentity to proceed without base keys. The change is present in pkg/auth/identities/aws/assume_role.go within assumeRoleWithWebIdentity.

Focused full review notes

  • OIDC flow

    • Good: The STS client is created from an isolated config with region set and AnonymousCredentials injected. Region defaults to us-east-1 if not provided, which is appropriate for STS and avoids empty-region errors.
    • Good: Web identity token is only passed in the API input and not logged.
    • Suggestion: Consider centralizing duration parsing to a shared helper used by both buildAssumeRoleInput and buildAssumeRoleWithWebIdentityInput to keep behavior identical and reduce duplication.
    • Suggestion: If feasible, add a small unit test that exercises the OIDC branch with a dummy token and asserts we reach the STS call path (it’s okay if it fails on network and we just assert error classification). Verifying the exact use of AnonymousCredentials at runtime is non-trivial, so the current approach of behavioral assertion is reasonable.
  • Standard AssumeRole flow

    • Good: newSTSClient uses the provided base AWS credentials via a static credentials provider, keeping behavior unchanged for key-based auth.
    • Good: Region resolution and serialization back to the identity are handled consistently.
  • Errors and messages

    • Good: Error message now clearly states “base AWS credentials or OIDC credentials are required for assume-role”, matching the new capability.
    • The code uses errors.Join with the project’s sentinel errors; that’s consistent with the repo’s style.
  • Serialization and environment prep

    • Good: toAWSCredentials and toAWSCredentialsFromWebIdentity both ensure a non-empty region on the resulting AWSCredentials.
    • PostAuthenticate, Environment, and PrepareEnvironment logic are unchanged and remain correct for both flows.
  • Tests

    • If not already included, please ensure tests cover:
      • buildAssumeRoleWithWebIdentityInput duration handling (valid/invalid).
      • Defaulting region to us-east-1 when unset in OIDC path.
      • The updated error message when neither AWSCredentials nor OIDCCredentials are supplied.

Conclusion

  • The anonymous credentials fix is in place and correct.
  • The OIDC AssumeRoleWithWebIdentity flow now matches expected AWS SDK v2 usage patterns for keyless auth.
  • Only minor test and refactor suggestions above; no blockers from me.

Would you like me to draft a small unit test covering the OIDC default-region and duration parsing cases?


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Search for AssumeRoleWithWebIdentity references =="
rg -n --no-heading --hidden -g '!vendor/**' 'AssumeRoleWithWebIdentity'

echo
echo "== Open assume_role_test.go (if exists) =="
if [ -f pkg/auth/identities/aws/assume_role_test.go ]; then
  sed -n '1,220p' pkg/auth/identities/aws/assume_role_test.go
else
  echo "pkg/auth/identities/aws/assume_role_test.go not found"
fi

echo
echo "== Find OIDCCredentials type =="
rg -n --no-heading --hidden -g '!vendor/**' 'type\s+OIDCCredentials' || true

echo
echo "== Show OIDCCredentials file (common surrounding lines) =="
OIDC_FILE=$(rg -n --no-heading --hidden -g '!vendor/**' 'type\s+OIDCCredentials' | head -n1 | cut -d: -f1 || true)
if [ -n "${OIDC_FILE:-}" ] && [ -f "$OIDC_FILE" ]; then
  sed -n '1,200p' "$OIDC_FILE"
else
  echo "OIDCCredentials type file not found"
fi

echo
echo "== Confirm defaultAWSRegion usage =="
rg -n --no-heading --hidden -g '!vendor/**' 'defaultAWSRegion' || true

echo
echo "== Grep for AnonymousCredentials usage across repo =="
rg -n --no-heading --hidden -g '!vendor/**' 'AnonymousCredentials' || true

Length of output: 13614


Andriy Knysh (@aknysh) Confirmed.

What I checked

  • Code: In the OIDC path, assumeRoleWithWebIdentity injects aws.AnonymousCredentials via config.WithCredentialsProvider(aws.AnonymousCredentials{}). Location: pkg/auth/identities/aws/assume_role.go Line 222.
  • Region handling: defaultAWSRegion = "us-east-1" and fallback applied in both standard and OIDC flows (e.g., Lines 50, 202, 288).
  • Types: OIDCCredentials is defined with Token/Provider/Audience in pkg/auth/types/github_oidc_credentials.go.
  • Tests: Present and cover the web‑identity flow:
    • TestAssumeRoleIdentity_assumeRoleWithWebIdentity_UsesAnonymousCredentials (around Line 972).
    • TestAssumeRoleIdentity_buildAssumeRoleWithWebIdentityInput and conversions/assertions around web identity outputs.
  • Consistency: Anonymous credentials pattern is also used in aws SSO and permission_set flows.

Result

  • Your last commit correctly addresses the comment. The STS client in the OIDC path no longer resolves the standard chain and proceeds with AssumeRoleWithWebIdentity as intended. Tests exist to guard this behavior.

Minor suggestions (non-blocking)

  • Consider a small helper to DRY duration parsing shared by both AssumeRole inputs.
  • Keep an eye on logs to ensure no token or JWT parts are ever emitted (current code looks clean).

Want me to open a follow-up issue to track the small refactor?


🧠 Learnings used
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.

Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
✅ Actions performed

Full review triggered.

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

🧹 Nitpick comments (1)
pkg/auth/identities/aws/assume_role.go (1)

251-272: Consider extracting duration parsing logic.

The duration parsing code (lines 263-269) is similar to the logic in buildAssumeRoleInput (lines 109-114). Consider extracting this into a helper method like parseDuration(principal map[string]any) *int32 to reduce duplication and improve maintainability.

Example:

func (i *assumeRoleIdentity) parseDuration() *int32 {
	if durationStr, ok := i.config.Principal[principalDurationKey].(string); ok && durationStr != "" {
		if duration, err := time.ParseDuration(durationStr); err == nil {
			return aws.Int32(int32(duration.Seconds()))
		}
		log.Warn("Invalid duration specified for assume role", principalDurationKey, durationStr)
	}
	return nil
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4fcddbf and 7c9f3be.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • NOTICE (4 hunks)
  • go.mod (3 hunks)
  • pkg/auth/identities/aws/assume_role.go (6 hunks)
  • pkg/auth/identities/aws/assume_role_test.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
pkg/**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

Place business logic in pkg rather than in cmd

Files:

  • pkg/auth/identities/aws/assume_role_test.go
  • pkg/auth/identities/aws/assume_role.go
**/*_test.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios

Files:

  • pkg/auth/identities/aws/assume_role_test.go
**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments

Files:

  • pkg/auth/identities/aws/assume_role_test.go
  • pkg/auth/identities/aws/assume_role.go
**/!(*_test).go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

Document all exported functions, types, and methods with Go doc comments

Files:

  • pkg/auth/identities/aws/assume_role.go
go.{mod,sum}

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

go.{mod,sum}: Manage dependencies with Go modules
Keep dependencies up to date

Files:

  • go.mod
🧠 Learnings (17)
📚 Learning: 2025-09-09T02:14:36.708Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1452
File: internal/auth/types/whoami.go:14-15
Timestamp: 2025-09-09T02:14:36.708Z
Learning: The WhoamiInfo struct in internal/auth/types/whoami.go requires the Credentials field to be JSON-serializable for keystore unmarshaling operations, despite security concerns about credential exposure.

Applied to files:

  • pkg/auth/identities/aws/assume_role_test.go
  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-11-10T20:03:56.875Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1775
File: pkg/auth/providers/aws/sso_provisioning.go:40-79
Timestamp: 2025-11-10T20:03:56.875Z
Learning: In the Atmos AWS SSO provider (pkg/auth/providers/aws/sso_provisioning.go), the OAuth access token from the AWS SSO device flow is intentionally stored in the `AccessKeyID` field of `AWSCredentials` during authentication. This token is then extracted and used for ListAccounts and ListAccountRoles API calls during identity provisioning. This design reuses the existing `AWSCredentials` type for token transport rather than creating a separate credential type.

Applied to files:

  • pkg/auth/identities/aws/assume_role_test.go
  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-09-25T01:02:48.697Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: pkg/auth/manager.go:304-312
Timestamp: 2025-09-25T01:02:48.697Z
Learning: The auth manager in pkg/auth/manager.go should remain cloud-agnostic and not contain AWS-specific logic or references to specific cloud providers. Keep the manager generic and extensible.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-01-17T00:18:57.769Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-01-25T03:51:57.689Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-09-10T21:17:55.273Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: toolchain/http_client_test.go:3-10
Timestamp: 2025-09-10T21:17:55.273Z
Learning: In the cloudposse/atmos repository, imports should never be changed as per samtholiya's coding guidelines.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-11-08T19:56:18.660Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1697
File: internal/exec/oci_utils.go:0-0
Timestamp: 2025-11-08T19:56:18.660Z
Learning: In the Atmos codebase, when a function receives an `*schema.AtmosConfiguration` parameter, it should read configuration values from `atmosConfig.Settings` fields rather than using direct `os.Getenv()` or `viper.GetString()` calls. The Atmos pattern is: viper.BindEnv in cmd/root.go binds environment variables → Viper unmarshals into atmosConfig.Settings via mapstructure → business logic reads from the Settings struct. This provides centralized config management, respects precedence, and enables testability. Example: `atmosConfig.Settings.AtmosGithubToken` instead of `os.Getenv("ATMOS_GITHUB_TOKEN")` in functions like `getGHCRAuth` in internal/exec/oci_utils.go.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2024-12-02T21:26:32.337Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 808
File: pkg/config/config.go:478-483
Timestamp: 2024-12-02T21:26:32.337Z
Learning: In the 'atmos' project, when reviewing Go code like `pkg/config/config.go`, avoid suggesting file size checks after downloading remote configs if such checks aren't implemented elsewhere in the codebase.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-07-05T20:59:02.914Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1363
File: internal/exec/template_utils.go:18-18
Timestamp: 2025-07-05T20:59:02.914Z
Learning: In the Atmos project, gomplate v4 is imported with a blank import (`_ "github.com/hairyhenderson/gomplate/v4"`) alongside v3 imports to resolve AWS SDK version conflicts. V3 uses older AWS SDK versions that conflict with newer AWS modules used by Atmos. A full migration to v4 requires extensive refactoring due to API changes and should be handled in a separate PR.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
  • go.mod
📚 Learning: 2024-11-18T13:59:10.824Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 768
File: internal/exec/vendor_model_component.go:3-20
Timestamp: 2024-11-18T13:59:10.824Z
Learning: When replacing significant dependencies like `go-getter` that require extensive changes, prefer to address them in separate PRs.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-09-07T17:38:17.619Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/src/components/Screengrabs/demo-stacks/deploy-dev.html:28-37
Timestamp: 2025-09-07T17:38:17.619Z
Learning: Screengrab files in the CloudPosse/atmos repository are programmatically generated and should be ignored during code reviews. Do not provide suggestions or comments on files in screengrab directories or screengrab-related HTML files.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-03-18T12:26:25.329Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1149
File: tests/snapshots/TestCLICommands_atmos_vendor_pull_ssh.stderr.golden:7-7
Timestamp: 2025-03-18T12:26:25.329Z
Learning: In the Atmos project, typos or inconsistencies in test snapshot files (such as "terrafrom" instead of "terraform") may be intentional as they capture the exact output of commands and should not be flagged as issues requiring correction.

Applied to files:

  • pkg/auth/identities/aws/assume_role.go
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to go.{mod,sum} : Manage dependencies with Go modules

Applied to files:

  • go.mod
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to go.{mod,sum} : Keep dependencies up to date

Applied to files:

  • go.mod
📚 Learning: 2025-01-17T00:21:32.987Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:3-3
Timestamp: 2025-01-17T00:21:32.987Z
Learning: Go version 1.23.0 was deliberately introduced by the maintainer (aknysh) in January 2025. While this might be a pre-release or development version of Go, it has been approved for use in this project.

Applied to files:

  • go.mod
📚 Learning: 2025-01-17T00:21:32.987Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:3-3
Timestamp: 2025-01-17T00:21:32.987Z
Learning: The project uses Go version 1.23.0 which has been confirmed by the maintainer to be working in production for months. Do not flag this as an invalid Go version.

Applied to files:

  • go.mod
📚 Learning: 2025-11-01T20:24:29.557Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1714
File: NOTICE:0-0
Timestamp: 2025-11-01T20:24:29.557Z
Learning: In the cloudposse/atmos repository, the NOTICE file is programmatically generated and should not be manually edited. Issues with dependency license URLs in NOTICE will be resolved when upstream package metadata is corrected.

Applied to files:

  • NOTICE
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: [localstack] demo-localstack
  • GitHub Check: Acceptance Tests (linux)
  • GitHub Check: Acceptance Tests (macos)
  • GitHub Check: Acceptance Tests (windows)
  • GitHub Check: release / goreleaser
  • GitHub Check: Summary
🔇 Additional comments (12)
go.mod (1)

11-11: Dependency updates align with OIDC support.

The version bumps for Azure SDK, AWS SDK v2 components (config, credentials, s3/manager, sts), and Microsoft Auth Library are appropriate patch/minor updates that support the new OIDC functionality. The STS update to v1.40.0 likely includes improvements relevant to AssumeRoleWithWebIdentity.

Also applies to: 23-25, 30-30, 125-125

NOTICE (1)

110-110: License URL updates match dependency versions.

The NOTICE file updates correctly reflect the dependency version bumps from go.mod. Per project standards, this file is programmatically generated, and the changes align with the expected output from the generation script.

Based on learnings

Also applies to: 114-114, 122-122, 178-178, 941-941, 965-965

pkg/auth/identities/aws/assume_role.go (5)

24-31: Constants improve maintainability.

The new constants for default region and duration key centralize configuration and make the code more maintainable. The us-east-1 default is standard AWS practice.


151-161: OIDC credential routing is clean and clear.

The branching logic properly detects OIDC vs AWS credentials and routes to the appropriate authentication flow. The error message accurately reflects that either credential type is acceptable.


179-249: Web identity implementation follows established patterns.

The assumeRoleWithWebIdentity method properly implements OIDC authentication with anonymous credentials (line 222) to prevent SDK credential resolution attempts. The comprehensive documentation explains SDK v2 behavior and potential issues. This aligns with patterns used in sso.go and permission_set.go for bearer token authentication.


274-298: Credential conversion is consistent and thorough.

The toAWSCredentialsFromWebIdentity method properly handles nil checks, expiration formatting, and region defaulting. The logic mirrors the standard toAWSCredentials method, maintaining consistency across authentication flows.


109-109: Centralized duration key improves consistency.

Using the principalDurationKey constant for both map access and logging ensures consistency and makes future changes easier to maintain.

Also applies to: 113-113

pkg/auth/identities/aws/assume_role_test.go (5)

285-285: Test error message matches implementation.

The updated error expectation correctly reflects that both AWS and OIDC credentials are now acceptable input types.


695-867: OIDC test coverage is thorough.

The tests for OIDC authentication, input building, and credential conversion cover the happy path, error cases, and edge cases including nil checks, invalid durations, and region defaults. Well structured with clear test names.


869-891: Region default test confirms expected behavior.

This test verifies that empty region values default to us-east-1, ensuring credentials always have a valid region. Good coverage of an important edge case.


972-1027: Anonymous credentials test validates critical fix.

This test confirms the anonymous credentials fix addresses the credential resolution issue documented in past comments. The test properly verifies that ambient AWS credentials in the environment are not used during web identity authentication, preventing IMDS hangs and signing errors. Excellent documentation of the problem and verification approach.


893-1115: Comprehensive credential handling test coverage.

The remaining tests thoroughly cover credential handling scenarios including dual-mode operation (AWS + OIDC), invalid credential types, ambient credential isolation, and flow comparison. The mock credentials implementation properly satisfies the ICredentials interface for testing error paths. This provides strong confidence in the OIDC implementation.

@autofix-ci
autofix-ci Bot temporarily deployed to feature-releases November 11, 2025 15:20 Inactive
@github-actions

Copy link
Copy Markdown

These changes were released in v1.198.0-test.13.

@aknysh
Andriy Knysh (aknysh) merged commit 74482e5 into main Nov 11, 2025
@aknysh
Andriy Knysh (aknysh) deleted the auth-fix-github-oidc branch November 11, 2025 15:22
@github-actions

Copy link
Copy Markdown

These changes were released in v1.198.0.

This branch was previously deployed

2 inactive (1 outdated) deployments
feature-releases — 7c9f3be7 Deployed Nov 11, 2025 by autofix-ci[bot]
release — 08cacb1e Deployed Nov 2, 2025 by autofix-ci[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 release/feature Create release from this PR size/l Large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants