Skip to content

auth/aws: AWS CodeCommit IAM authentication#1142

Open
taraspos wants to merge 3 commits intofluxcd:mainfrom
taraspos:taras/aws-codecommit
Open

auth/aws: AWS CodeCommit IAM authentication#1142
taraspos wants to merge 3 commits intofluxcd:mainfrom
taraspos:taras/aws-codecommit

Conversation

@taraspos
Copy link
Copy Markdown

@taraspos taraspos commented Feb 28, 2026

Summary

This PR implements IAM role based authentification for AWS CodeCommit Git HTTPS URLs

Testing

Verified locally that generated username and password works AWS CodeCommit repositories.

@taraspos taraspos changed the title codecommit: initial implementation of git provider auth/aws: AWS CodeCommit IAM authentification Mar 5, 2026
@taraspos taraspos marked this pull request as ready for review March 5, 2026 13:18
@taraspos taraspos requested a review from a team as a code owner March 5, 2026 13:18
@taraspos taraspos force-pushed the taras/aws-codecommit branch 4 times, most recently from ba8d4f8 to c69e541 Compare March 5, 2026 13:23
@makkes makkes changed the title auth/aws: AWS CodeCommit IAM authentification auth/aws: AWS CodeCommit IAM authentication Mar 5, 2026
@taraspos taraspos requested a review from matheuscscp March 5, 2026 13:48
@taraspos taraspos force-pushed the taras/aws-codecommit branch 3 times, most recently from 304978e to 1043954 Compare March 31, 2026 19:39
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hey @matheuscscp I added the integration tests. Current state is following:

--- FAIL: TestGitCloneUsingProvider (130.58s)
    --- PASS: TestGitCloneUsingProvider/controller-level_workload_identity (8.31s)
    --- FAIL: TestGitCloneUsingProvider/object-level_workload_identity_(impersonation) (122.27s)
    --- SKIP: TestGitCloneUsingProvider/object-level_workload_identity_(direct_access) (0.00s)
    --- SKIP: TestGitCloneUsingProvider/object-level_workload_identity_(impersonation,_federation) (0.00s)
    --- SKIP: TestGitCloneUsingProvider/object-level_workload_identity_(direct_access,_federation) (0.00s)
=== RUN   TestGitCloneUsingSSH
    git_test.go:87: Skipping git test, not supported for provider
--- SKIP: TestGitCloneUsingSSH (0.00s)

The "impersonation" test is failing with:

panic: failed to create provider access token for service account 'default/test-workload-id': an AWS region is required for authenticating with a service account. please configure one in the object spec

goroutine 1 [running]:
main.checkGit({0x1ceb7d8, 0xb32a9dc8230})
        /Users/taraspos/code/fluxcd/pkg/tests/integration/testapp/main.go:243 +0x554
main.main()
        /Users/taraspos/code/fluxcd/pkg/tests/integration/testapp/main.go:156 +0x934

I'm not sure if this thing is expected to work with AWS IRSA; however, I can't say that I have a full understanding of what it's trying to do here. I would appreciate your review and assistance when you have a moment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice @taraspos, thanks very much for working on this! We're busy with some urgent bugfixes in helm-controller due to Helm 4 upgrade this week, I'm gonna try to make some time next week to review this. Thanks!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sounds good, thanks. Just want to make sure this change can still land in Flux 2.9 :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@taraspos so you managed to run successfully the test with controller-level workload identity by cloning from CodeCommit? Is the issue with object-level only?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, that's correct.

@matheuscscp
Copy link
Copy Markdown
Member

@taraspos CI is failing, can you pls take a look?

@taraspos
Copy link
Copy Markdown
Author

taraspos commented Apr 1, 2026

Seems like setup-envtest released a new version that depends on Go 1.26.0

go: sigs.k8s.io/controller-runtime/tools/setup-envtest@latest: sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20260331165415-bce0ec74ad73 requires go >= 1.26.0 (running go 1.25.8; GOTOOLCHAIN=local)

Not related to my change, but I can raise a PR with a fix. Let me do it in a separate branch.

@matheuscscp
Copy link
Copy Markdown
Member

Seems like setup-envtest released a new version that depends on Go 1.26.0

go: sigs.k8s.io/controller-runtime/tools/setup-envtest@latest: sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20260331165415-bce0ec74ad73 requires go >= 1.26.0 (running go 1.25.8; GOTOOLCHAIN=local)

Not related to my change, but I can raise a PR with a fix. Let me do it in a separate branch.

We just merged #1158, pls rebase and let's see if this gets fixed 🙏

@taraspos
Copy link
Copy Markdown
Author

taraspos commented Apr 1, 2026

I also raised this PR that pins setup-envtest version to prevent this from happening in the future:

@taraspos taraspos force-pushed the taras/aws-codecommit branch from d1b5536 to 5ba3c17 Compare April 1, 2026 11:01
taraspos added 2 commits April 1, 2026 12:06
Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants