Merge pull request #796 from fluxcd/libgit2-req-incomplete-auth-test

libgit2/managed/http: test for incomplete creds
This commit is contained in:
Stefan Prodan 2022-06-24 13:16:47 +03:00 committed by GitHub
commit 60cf11a0d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -105,6 +105,16 @@ func TestHttpAction_CreateClientRequest(t *testing.T) {
},
wantedErr: nil,
},
{
name: "incomplete credentials, no basic auth",
action: git2go.SmartServiceActionReceivepackLs,
transport: &http.Transport{},
authOpts: git.AuthOptions{Username: "user"},
assertFunc: func(g *WithT, req *http.Request, client *http.Client) {
_, _, ok := req.BasicAuth()
g.Expect(ok).To(BeFalse())
},
},
{
name: "credentials are correctly configured",
action: git2go.SmartServiceActionUploadpack,