Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow force of basic auth for HTTP repositories #11983

Merged
merged 2 commits into from
Feb 1, 2023

Conversation

jannfis
Copy link
Member

@jannfis jannfis commented Jan 14, 2023

Change introduces a new boolean setting for repositories: forceHttpBasicAuth. If set to true, Argo CD will make the Git client send an Authorization: Basic ... header to the repository server, thereby bypassing any authentication scheme negotiation done by Git (or libcurl, to be precise).

Closes #11914
Fixes #6289
Fixes #6362

Signed-off-by: jannfis jann@mistrust.net

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@codecov
Copy link

codecov bot commented Jan 14, 2023

Codecov Report

Base: 47.30% // Head: 47.44% // Increases project coverage by +0.13% 🎉

Coverage data is based on head (8d235c7) compared to base (8917077).
Patch coverage: 45.65% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11983      +/-   ##
==========================================
+ Coverage   47.30%   47.44%   +0.13%     
==========================================
  Files         245      246       +1     
  Lines       41670    41860     +190     
==========================================
+ Hits        19712    19859     +147     
- Misses      19972    20002      +30     
- Partials     1986     1999      +13     
Impacted Files Coverage Δ
cmd/argocd/commands/repo.go 0.00% <0.00%> (ø)
cmd/argocd/commands/repocreds.go 0.00% <0.00%> (ø)
cmd/util/repo.go 0.00% <0.00%> (ø)
server/repository/repository.go 51.49% <0.00%> (-0.13%) ⬇️
util/settings/settings.go 49.20% <ø> (+0.77%) ⬆️
util/git/client.go 49.43% <20.00%> (-0.23%) ⬇️
util/db/repository_secrets.go 68.35% <57.14%> (-0.44%) ⬇️
pkg/apis/application/v1alpha1/repository_types.go 71.42% <66.66%> (+0.39%) ⬆️
util/git/creds.go 50.31% <100.00%> (+1.45%) ⬆️
util/oidc/provider.go 34.42% <0.00%> (-20.12%) ⬇️
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jannfis jannfis force-pushed the feat/http-force-basic-auth branch 2 times, most recently from 427cf19 to 5ffeb0d Compare January 18, 2023 21:16
Signed-off-by: jannfis <jann@mistrust.net>
@jannfis jannfis force-pushed the feat/http-force-basic-auth branch from 5ffeb0d to 91e4cb2 Compare January 18, 2023 21:16
@jannfis jannfis marked this pull request as ready for review January 18, 2023 21:17
@jannfis
Copy link
Member Author

jannfis commented Jan 26, 2023

@crenshaw-dev @leoluz @alexmt Could I get someone of you having a look at this PR please?

Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @jannfis!

Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

Should we also update https://argo-cd.readthedocs.io/en/latest/operator-manual/declarative-setup/ and argocd-repositories.yaml with examples?

@jannfis
Copy link
Member Author

jannfis commented Feb 1, 2023

Good thinking, I'll update this PR to include some docs. Thanks!

Signed-off-by: jannfis <jann@mistrust.net>
@crenshaw-dev crenshaw-dev merged commit b600da1 into argoproj:master Feb 1, 2023
@crenshaw-dev
Copy link
Member

Cherry-picked onto release-2.6 for 2.6.0-rc7.

crenshaw-dev pushed a commit that referenced this pull request Feb 2, 2023
* feat: Allow force of basic auth for HTTP repositories

Signed-off-by: jannfis <jann@mistrust.net>

* Some docs

Signed-off-by: jannfis <jann@mistrust.net>

---------

Signed-off-by: jannfis <jann@mistrust.net>
schakrad pushed a commit to schakrad/argo-cd that referenced this pull request Mar 14, 2023
* feat: Allow force of basic auth for HTTP repositories

Signed-off-by: jannfis <jann@mistrust.net>

* Some docs

Signed-off-by: jannfis <jann@mistrust.net>

---------

Signed-off-by: jannfis <jann@mistrust.net>
Signed-off-by: schakrad <chakradari.sindhu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants