Skip to content

Commit 04b06dd

Browse files
authored
Merge pull request #1003 from fluxcd/git-bearer-token-udpate
Update git dependencies for bearer token support
2 parents e0d9585 + f707193 commit 04b06dd

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

api/v1beta2/gitrepository_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type GitRepositorySpec struct {
5555
// SecretRef specifies the Secret containing authentication credentials for
5656
// the GitRepository.
5757
// For HTTPS repositories the Secret must contain 'username' and 'password'
58-
// fields.
58+
// fields for basic auth or 'bearerToken' field for token auth.
5959
// For SSH repositories the Secret must contain 'identity'
6060
// and 'known_hosts' fields.
6161
// +optional

config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,9 @@ spec:
492492
secretRef:
493493
description: SecretRef specifies the Secret containing authentication
494494
credentials for the GitRepository. For HTTPS repositories the Secret
495-
must contain 'username' and 'password' fields. For SSH repositories
496-
the Secret must contain 'identity' and 'known_hosts' fields.
495+
must contain 'username' and 'password' fields for basic auth or
496+
'bearerToken' field for token auth. For SSH repositories the Secret
497+
must contain 'identity' and 'known_hosts' fields.
497498
properties:
498499
name:
499500
description: Name of the referent.

controllers/gitrepository_controller_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ func TestGitRepositoryReconciler_reconcileSource_authStrategy(t *testing.T) {
331331
*conditions.UnknownCondition(meta.ReadyCondition, meta.ProgressingReason, "foo"),
332332
},
333333
},
334+
// TODO: Add test case for HTTPS with bearer token auth secret. It
335+
// depends on gitkit to have support for bearer token based
336+
// authentication.
334337
{
335338
name: "SSH with private key secret makes Reconciling=True",
336339
protocol: "ssh",

docs/api/source.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ github.com/fluxcd/pkg/apis/meta.LocalObjectReference
322322
<p>SecretRef specifies the Secret containing authentication credentials for
323323
the GitRepository.
324324
For HTTPS repositories the Secret must contain &lsquo;username&rsquo; and &lsquo;password&rsquo;
325-
fields.
325+
fields for basic auth or &lsquo;bearerToken&rsquo; field for token auth.
326326
For SSH repositories the Secret must contain &lsquo;identity&rsquo;
327327
and &lsquo;known_hosts&rsquo; fields.</p>
328328
</td>
@@ -1748,7 +1748,7 @@ github.com/fluxcd/pkg/apis/meta.LocalObjectReference
17481748
<p>SecretRef specifies the Secret containing authentication credentials for
17491749
the GitRepository.
17501750
For HTTPS repositories the Secret must contain &lsquo;username&rsquo; and &lsquo;password&rsquo;
1751-
fields.
1751+
fields for basic auth or &lsquo;bearerToken&rsquo; field for token auth.
17521752
For SSH repositories the Secret must contain &lsquo;identity&rsquo;
17531753
and &lsquo;known_hosts&rsquo; fields.</p>
17541754
</td>

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ require (
2424
github.com/fluxcd/go-git/v5 v5.0.0-20221206140629-ec778c2c37df
2525
github.com/fluxcd/pkg/apis/event v0.2.0
2626
github.com/fluxcd/pkg/apis/meta v0.18.0
27-
github.com/fluxcd/pkg/git v0.7.0
28-
github.com/fluxcd/pkg/git/gogit v0.4.0
27+
github.com/fluxcd/pkg/git v0.8.0
28+
github.com/fluxcd/pkg/git/gogit v0.5.0
2929
github.com/fluxcd/pkg/gittestserver v0.8.0
3030
github.com/fluxcd/pkg/helmtestserver v0.10.0
3131
github.com/fluxcd/pkg/lockedfile v0.1.0

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,10 @@ github.com/fluxcd/pkg/apis/event v0.2.0 h1:cmAtkZfoEaNVYegI4SFM8XstdRAil3O9AoP+8
535535
github.com/fluxcd/pkg/apis/event v0.2.0/go.mod h1:OyzKqs90J+MK7rQaEOFMMCkALpPkfmxlkabgyY2wSFQ=
536536
github.com/fluxcd/pkg/apis/meta v0.18.0 h1:s0LeulWcQ4DxVX6805vgDTxlA6bAYk+Lq1QHSnNdqLM=
537537
github.com/fluxcd/pkg/apis/meta v0.18.0/go.mod h1:pYvXRFi1UKNNrGR34jw3uqOnMXw9X6dTkML8j5Z7tis=
538-
github.com/fluxcd/pkg/git v0.7.0 h1:sQHRpFMcOzEdqlyGMjFv2LKMdcoE5xeUr2UcRrsLRG8=
539-
github.com/fluxcd/pkg/git v0.7.0/go.mod h1:3deiLPws4DSQ3hqwtQd7Dt66GXTN/4RcT/yHAljXaHo=
540-
github.com/fluxcd/pkg/git/gogit v0.4.0 h1:u2Rcd/jHdvXUfgv72CES5Gq/nxAp/PblgrBDAm8ZQtQ=
541-
github.com/fluxcd/pkg/git/gogit v0.4.0/go.mod h1:fMBM6efbAPqDEoU2M/ve+P3b/oQCuwRbia4bn9006jM=
538+
github.com/fluxcd/pkg/git v0.8.0 h1:7mIbdqSf+qXwY17+A+Kge2yWIJCMJ1p1DiBDGnKRohg=
539+
github.com/fluxcd/pkg/git v0.8.0/go.mod h1:3deiLPws4DSQ3hqwtQd7Dt66GXTN/4RcT/yHAljXaHo=
540+
github.com/fluxcd/pkg/git/gogit v0.5.0 h1:3Fzx2W16K/37ZHT6WmLFuRYgs+CGvzka+dwY7ktoxJE=
541+
github.com/fluxcd/pkg/git/gogit v0.5.0/go.mod h1:cqoJhKXCmWuN2ezD/2ECUYwR8gR7svMRJoHRr9VyTQc=
542542
github.com/fluxcd/pkg/gittestserver v0.8.0 h1:YrYe63KScKlLxx0GAiQthx2XqHDx0vKitIIx4JnDtIo=
543543
github.com/fluxcd/pkg/gittestserver v0.8.0/go.mod h1:/LI/xKMrnQbIsTDnTyABQ71iaYhFIZ8fb4cvY7WAlBU=
544544
github.com/fluxcd/pkg/helmtestserver v0.10.0 h1:/cnx1D6/cln7v06iXZMLeshl82mV1wv3OVZoBE9Bbm4=

0 commit comments

Comments
 (0)