-
Notifications
You must be signed in to change notification settings - Fork 6.3k
fix(server): Send Azure DevOps token via git extra headers (#23478) #23631
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
fix(server): Send Azure DevOps token via git extra headers (#23478) #23631
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #23631 +/- ##
==========================================
- Coverage 60.18% 60.17% -0.01%
==========================================
Files 346 346
Lines 59248 59249 +1
==========================================
- Hits 35656 35652 -4
- Misses 20730 20732 +2
- Partials 2862 2865 +3 ☔ View full report in Codecov by Sentry. |
1397e2a
to
cf6f56e
Compare
@jagpreetstamber do you mind validating this issue/pr? |
return nil | ||
}), env, nil | ||
var env []string | ||
env = append(env, fmt.Sprintf("%s=Authorization: Bearer %s", bearerAuthHeaderEnv, token)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a reason to remove the credsStore. Perhaps the only change necessary is to do an approach similar to HTTPSCreds?
Lines 243 to 246 in c60a727
} else if creds.bearerToken != "" { | |
// If bearer token is set, we will set ARGOCD_BEARER_AUTH_HEADER to hold the HTTP authorization header | |
env = append(env, fmt.Sprintf("%s=%s", bearerAuthHeaderEnv, creds.BearerAuthHeader())) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I had left it in there, but then I realized it ultimately becomes unused (because it doesn't work as-is). But I can definitely restore it if you'd prefer that.
a1b19e8
to
f77c759
Compare
Hi @agaudreault. Have you had a chance to review after the last push to incorporate your requested change? Please let me know if you have any other concerns which I can address. |
5107b7d
to
53997fe
Compare
53997fe
to
7419946
Compare
Signed-off-by: Mike Bordon <mikebordon@gmail.com>
Signed-off-by: Mike Bordon <mikebordon@gmail.com>
7419946
to
cc2f650
Compare
@agaudreault This PR is still blocked by your previous change for request. Could you please re-review when you have a chance (or clear your vote since @rumstead has now approved)? |
/cherry-pick release-3.1 |
…23478) (argoproj#23631) Signed-off-by: Mike Bordon <mikebordon@gmail.com>
…23478) (argoproj#23631) Signed-off-by: Mike Bordon <mikebordon@gmail.com> Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
…23478) (argoproj#23631) Signed-off-by: Mike Bordon <mikebordon@gmail.com> Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
…23478) (argoproj#23631) Signed-off-by: Mike Bordon <mikebordon@gmail.com> Signed-off-by: enneitex <etienne.divet@gmail.com>
…23478) (argoproj#23631) Signed-off-by: Mike Bordon <mikebordon@gmail.com>
The project's "Git Askpass" implementation only supports username-password authentication, but Azure DevOps specifically requires the token be provided via an Authorization-Bearer request header. This change replaces the "store" approach required by the former in favor of the environment variable mechanism currently leveraged for HTTPS credentials when a bearer token is provided.
Fixes #23478
Checklist: