Skip to content

fix(terragrunt): add missing username for token authentication#7506

Merged
olblak merged 8 commits into
updatecli:mainfrom
eugenestarchenko:fix/terragrunt-token-auth
Jan 19, 2026
Merged

fix(terragrunt): add missing username for token authentication#7506
olblak merged 8 commits into
updatecli:mainfrom
eugenestarchenko:fix/terragrunt-token-auth

Conversation

@eugenestarchenko

@eugenestarchenko eugenestarchenko commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes token authentication from #7359 by adding required username field.

PR #7359 added token support but authentication fails with:

ERROR: authentication required: Repository not found.
It appears that a password has been specified without a username, could it be related?

Root cause: go-git requires non-empty username for HTTP BasicAuth even with token-only auth.

Solution

  • Add Username field with 'oauth2' default (matches GitHub SCM plugin)
  • Generated manifests now include both username and password

  Fix token-only authentication by providing username default for go-git.

  PR updatecli#7359 added token support but token-only auth fails because go-git
  requires non-empty username for HTTP BasicAuth. This fix adds:

  - Username *string field to Spec with oauth2 default
  - getUsername() method matching GitHub SCM plugin behavior
  - Updated manifest template to include username field
  - Test coverage for getUsername()

  Fixes token authentication added in updatecli#7359
@olblak

olblak commented Jan 13, 2026

Copy link
Copy Markdown
Member

Thanks I assumed the other pr was enough but I am happy to merge this one as well

olblak
olblak previously approved these changes Jan 13, 2026
@olblak olblak enabled auto-merge (squash) January 13, 2026 18:12
@olblak olblak added bug Something isn't working resource-terragrunt autodiscovery All things related to the autodiscovery feature labels Jan 13, 2026
@eugenestarchenko

Copy link
Copy Markdown
Contributor Author

Thanks I assumed the other pr was enough but I am happy to merge this one as well

I missed that username "can be anything except an empty string" when I did PR #7359.
https://github.com/go-git/go-git/blob/master/_examples/clone/auth/basic/access_token/main.go#L24

@olblak

olblak commented Jan 14, 2026

Copy link
Copy Markdown
Member

Could you have a look the "github.com/updatecli/updatecli/pkg/plugins/autodiscovery/terragrunt" test is not passing

auto-merge was automatically disabled January 15, 2026 12:14

Head branch was pushed to by a user without write access

@eugenestarchenko

Copy link
Copy Markdown
Contributor Author

Could you have a look the "github.com/updatecli/updatecli/pkg/plugins/autodiscovery/terragrunt" test is not passing

done

olblak
olblak previously approved these changes Jan 15, 2026
@olblak olblak enabled auto-merge (squash) January 15, 2026 16:06
auto-merge was automatically disabled January 16, 2026 15:21

Head branch was pushed to by a user without write access

@olblak olblak enabled auto-merge (squash) January 16, 2026 21:00
olblak
olblak previously approved these changes Jan 16, 2026
auto-merge was automatically disabled January 19, 2026 12:39

Head branch was pushed to by a user without write access

@olblak olblak left a comment

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.

Thanks for the fix

@olblak olblak merged commit 3b76b27 into updatecli:main Jan 19, 2026
9 checks passed
josill pushed a commit to josill/updatecli that referenced this pull request Jan 29, 2026
…ecli#7506)

* fix(terragrunt): add missing username for token authentication

  Fix token-only authentication by providing username default for go-git.

  PR updatecli#7359 added token support but token-only auth fails because go-git
  requires non-empty username for HTTP BasicAuth. This fix adds:

  - Username *string field to Spec with oauth2 default
  - getUsername() method matching GitHub SCM plugin behavior
  - Updated manifest template to include username field
  - Test coverage for getUsername()

  Fixes token authentication added in updatecli#7359

* fix(terragrunt):Fixes test failure introduced by adding username support

* fix(terragrunt): only include username when token is configured

* fix(terragrunt): return empty username when token not configured

---------

Co-authored-by: Olivier Vernin <olivier@vernin.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autodiscovery All things related to the autodiscovery feature bug Something isn't working resource-terragrunt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants