Skip to content

Commit 4cd4dbb

Browse files
committed
Add caching for GitHub App tokens
Signed-off-by: Matheus Pimenta <[email protected]>
1 parent 0c883c9 commit 4cd4dbb

File tree

12 files changed

+362
-170
lines changed

12 files changed

+362
-170
lines changed

auth/github/client.go

+64-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ package github
1818

1919
import (
2020
"context"
21+
"crypto/sha256"
2122
"fmt"
2223
"net/http"
2324
"net/url"
2425
"strconv"
26+
"strings"
2527
"time"
2628

2729
"github.com/bradleyfalzon/ghinstallation/v2"
2830
"golang.org/x/net/http/httpproxy"
31+
32+
"github.com/fluxcd/pkg/cache"
2933
)
3034

3135
const (
@@ -43,6 +47,10 @@ type Client struct {
4347
apiURL string
4448
proxyURL *url.URL
4549
ghTransport *ghinstallation.Transport
50+
cache *cache.TokenCache
51+
kind string
52+
name string
53+
namespace string
4654
}
4755

4856
// OptFunc enables specifying options for the provider.
@@ -158,28 +166,76 @@ func WithProxyURL(proxyURL *url.URL) OptFunc {
158166
}
159167
}
160168

169+
// WithCache sets the token cache and the object involved in the operation for
170+
// recording cache events.
171+
func WithCache(cache *cache.TokenCache, kind, name, namespace string) OptFunc {
172+
return func(p *Client) {
173+
p.cache = cache
174+
p.kind = kind
175+
p.name = name
176+
p.namespace = namespace
177+
}
178+
}
179+
161180
// AppToken contains a GitHub App installation token and its expiry.
162181
type AppToken struct {
163182
Token string `json:"token"`
164183
ExpiresAt time.Time `json:"expires_at"`
165184
}
166185

186+
// GetDuration returns the duration until the token expires.
187+
func (at *AppToken) GetDuration() time.Duration {
188+
return time.Until(at.ExpiresAt)
189+
}
190+
167191
// GetToken returns the token that can be used to authenticate
168192
// as a GitHub App installation.
169193
// Ref: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation
170194
func (p *Client) GetToken(ctx context.Context) (*AppToken, error) {
171-
token, err := p.ghTransport.Token(ctx)
172-
if err != nil {
173-
return nil, err
195+
newToken := func(ctx context.Context) (cache.Token, error) {
196+
token, err := p.ghTransport.Token(ctx)
197+
if err != nil {
198+
return nil, err
199+
}
200+
201+
expiresAt, _, err := p.ghTransport.Expiry()
202+
if err != nil {
203+
return nil, err
204+
}
205+
206+
return &AppToken{
207+
Token: token,
208+
ExpiresAt: expiresAt,
209+
}, nil
210+
}
211+
212+
if p.cache == nil {
213+
token, err := newToken(ctx)
214+
if err != nil {
215+
return nil, err
216+
}
217+
return token.(*AppToken), nil
218+
}
219+
220+
var opts []cache.Options
221+
if p.kind != "" && p.name != "" && p.namespace != "" {
222+
opts = append(opts, cache.WithInvolvedObject(p.kind, p.name, p.namespace))
174223
}
175224

176-
expiresAt, _, err := p.ghTransport.Expiry()
225+
token, _, err := p.cache.GetOrSet(ctx, p.buildCacheKey(), newToken, opts...)
177226
if err != nil {
178227
return nil, err
179228
}
229+
return token.(*AppToken), nil
230+
}
180231

181-
return &AppToken{
182-
Token: token,
183-
ExpiresAt: expiresAt,
184-
}, nil
232+
func (p *Client) buildCacheKey() string {
233+
privateKeyDigest := sha256.Sum256(p.privateKey)
234+
keyParts := []string{
235+
fmt.Sprintf("%s=%s", AppIDKey, p.appID),
236+
fmt.Sprintf("%s=%s", AppInstallationIDKey, p.installationID),
237+
fmt.Sprintf("%s=%s", AppBaseUrlKey, p.apiURL),
238+
fmt.Sprintf("%sDigest=%x", AppPrivateKey, privateKeyDigest),
239+
}
240+
return strings.Join(keyParts, ",")
185241
}

auth/github/client_test.go

+21
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"testing"
2727
"time"
2828

29+
"github.com/fluxcd/pkg/cache"
2930
"github.com/fluxcd/pkg/ssh"
3031
. "github.com/onsi/gomega"
3132
)
@@ -158,6 +159,7 @@ func TestClient_GetToken(t *testing.T) {
158159
expiresAt := time.Now().UTC().Add(time.Hour)
159160
tests := []struct {
160161
name string
162+
opts []OptFunc
161163
accessToken *AppToken
162164
statusCode int
163165
wantErr bool
@@ -175,6 +177,24 @@ func TestClient_GetToken(t *testing.T) {
175177
ExpiresAt: expiresAt,
176178
},
177179
},
180+
{
181+
name: "Get cached token",
182+
opts: []OptFunc{func(client *Client) {
183+
c := cache.NewTokenCache(1)
184+
c.GetOrSet(context.Background(), client.buildCacheKey(), func(context.Context) (cache.Token, error) {
185+
return &AppToken{
186+
Token: "access-token",
187+
ExpiresAt: expiresAt,
188+
}, nil
189+
})
190+
client.cache = c
191+
}},
192+
statusCode: http.StatusInternalServerError, // error status code to make the test fail if the token is not cached
193+
wantAppToken: &AppToken{
194+
Token: "access-token",
195+
ExpiresAt: expiresAt,
196+
},
197+
},
178198
{
179199
name: "Failure in getting token",
180200
statusCode: http.StatusInternalServerError,
@@ -206,6 +226,7 @@ func TestClient_GetToken(t *testing.T) {
206226
opts := []OptFunc{
207227
WithAppBaseURL(srv.URL), WithInstllationID("123"), WithAppID("456"), WithPrivateKey(kp.PrivateKey),
208228
}
229+
opts = append(opts, tt.opts...)
209230

210231
provider, err := New(opts...)
211232
g.Expect(err).ToNot(HaveOccurred())

auth/go.mod

+24-11
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,45 @@ module github.com/fluxcd/pkg/auth
22

33
go 1.23.0
44

5-
replace github.com/fluxcd/pkg/ssh => ../ssh
5+
replace (
6+
github.com/fluxcd/pkg/cache => ../cache
7+
github.com/fluxcd/pkg/ssh => ../ssh
8+
)
69

710
require (
811
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
9-
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1
10-
github.com/bradleyfalzon/ghinstallation/v2 v2.13.0
11-
github.com/fluxcd/pkg/ssh v0.16.0
12+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2
13+
github.com/bradleyfalzon/ghinstallation/v2 v2.14.0
14+
github.com/fluxcd/pkg/cache v0.4.0
15+
github.com/fluxcd/pkg/ssh v0.17.0
1216
github.com/onsi/gomega v1.36.2
13-
golang.org/x/net v0.34.0
17+
golang.org/x/net v0.35.0
1418
)
1519

1620
require (
1721
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
18-
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect
22+
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.0 // indirect
23+
github.com/beorn7/perks v1.0.1 // indirect
24+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1925
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
26+
github.com/go-logr/logr v1.4.2 // indirect
2027
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
2128
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
22-
github.com/google/go-cmp v0.6.0 // indirect
23-
github.com/google/go-github/v68 v68.0.0 // indirect
29+
github.com/google/go-cmp v0.7.0 // indirect
30+
github.com/google/go-github/v69 v69.2.0 // indirect
2431
github.com/google/go-querystring v1.1.0 // indirect
2532
github.com/google/uuid v1.6.0 // indirect
2633
github.com/kylelemons/godebug v1.1.0 // indirect
34+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
2735
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
2836
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
29-
golang.org/x/crypto v0.32.0 // indirect
30-
golang.org/x/sys v0.29.0 // indirect
31-
golang.org/x/text v0.21.0 // indirect
37+
github.com/prometheus/client_golang v1.20.5 // indirect
38+
github.com/prometheus/client_model v0.6.1 // indirect
39+
github.com/prometheus/common v0.55.0 // indirect
40+
github.com/prometheus/procfs v0.15.1 // indirect
41+
golang.org/x/crypto v0.34.0 // indirect
42+
golang.org/x/sys v0.30.0 // indirect
43+
golang.org/x/text v0.22.0 // indirect
44+
google.golang.org/protobuf v1.36.1 // indirect
3245
gopkg.in/yaml.v3 v3.0.1 // indirect
3346
)

auth/go.sum

+38-22
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ=
22
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ=
3-
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1 h1:1mvYtZfWQAnwNah/C+Z+Jb9rQH95LPE2vlmMuWAHJk8=
4-
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1/go.mod h1:75I/mXtme1JyWFtz8GocPHVFyH421IBoZErnO16dd0k=
5-
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.1 h1:Bk5uOhSAenHyR5P61D/NzeQCv+4fEVV8mOkJ82NqpWw=
6-
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.1/go.mod h1:QZ4pw3or1WPmRBxf0cHd1tknzrT54WPBOQoGutCPvSU=
3+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys=
4+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE=
5+
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY=
6+
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8=
77
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
88
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
99
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
1010
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
11-
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 h1:kYRSnvJju5gYVyhkij+RTJ/VR6QIUaCfWeaFm2ycsjQ=
12-
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
13-
github.com/bradleyfalzon/ghinstallation/v2 v2.13.0 h1:5FhjW93/YLQJDmPdeyMPw7IjAPzqsr+0jHPfrPz0sZI=
14-
github.com/bradleyfalzon/ghinstallation/v2 v2.13.0/go.mod h1:EJ6fgedVEHa2kUyBTTvslJCXJafS/mhJNNKEOCspZXQ=
11+
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.0 h1:MUkXAnvvDHgvPItl0nBj0hgk0f7hnnQbGm0h0+YxbN4=
12+
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
13+
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
14+
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
15+
github.com/bradleyfalzon/ghinstallation/v2 v2.14.0 h1:0D4vKCHOvYrDU8u61TnE2JfNT4VRrBLphmxtqazTO+M=
16+
github.com/bradleyfalzon/ghinstallation/v2 v2.14.0/go.mod h1:LOVmdZYVZ8jqdr4n9wWm1ocDiMz9IfMGfRkaYC1a52A=
1517
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
1618
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
1719
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
@@ -27,10 +29,10 @@ github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w
2729
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
2830
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
2931
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
30-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
31-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
32-
github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s=
33-
github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68=
32+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
33+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
34+
github.com/google/go-github/v69 v69.2.0 h1:wR+Wi/fN2zdUx9YxSmYE0ktiX9IAR/BeePzeaUUbEHE=
35+
github.com/google/go-github/v69 v69.2.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM=
3436
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
3537
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
3638
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg=
@@ -39,12 +41,16 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
3941
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
4042
github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs=
4143
github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw=
44+
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
45+
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
4246
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
4347
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
4448
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
4549
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
4650
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
4751
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
52+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
53+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
4854
github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM=
4955
github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM=
5056
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
@@ -53,26 +59,36 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd
5359
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
5460
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
5561
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
62+
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
63+
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
64+
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
65+
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
66+
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
67+
github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
68+
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
69+
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
5670
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
5771
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
5872
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
5973
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
6074
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
6175
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
62-
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
63-
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
64-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
65-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
76+
golang.org/x/crypto v0.34.0 h1:+/C6tk6rf/+t5DhUketUbD1aNGqiSX3j15Z6xuIDlBA=
77+
golang.org/x/crypto v0.34.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
78+
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
79+
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
6680
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
67-
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
68-
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
69-
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
70-
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
71-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
72-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
81+
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
82+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
83+
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
84+
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
85+
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
86+
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
7387
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
7488
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
7589
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
90+
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
91+
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
7692
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7793
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
7894
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

git/go.mod

+20-10
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,38 @@ require (
1111
github.com/ProtonMail/go-crypto v1.1.5
1212
github.com/cyphar/filepath-securejoin v0.4.1
1313
github.com/fluxcd/pkg/auth v0.2.0
14-
github.com/fluxcd/pkg/ssh v0.16.0
14+
github.com/fluxcd/pkg/ssh v0.17.0
1515
github.com/onsi/gomega v1.36.2
1616
)
1717

1818
require (
1919
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 // indirect
20-
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1 // indirect
20+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect
2121
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
22-
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect
23-
github.com/bradleyfalzon/ghinstallation/v2 v2.13.0 // indirect
22+
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.0 // indirect
23+
github.com/beorn7/perks v1.0.1 // indirect
24+
github.com/bradleyfalzon/ghinstallation/v2 v2.14.0 // indirect
25+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2426
github.com/cloudflare/circl v1.5.0 // indirect
27+
github.com/fluxcd/pkg/cache v0.4.0 // indirect
28+
github.com/go-logr/logr v1.4.2 // indirect
2529
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
2630
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
27-
github.com/google/go-cmp v0.6.0 // indirect
28-
github.com/google/go-github/v68 v68.0.0 // indirect
31+
github.com/google/go-cmp v0.7.0 // indirect
32+
github.com/google/go-github/v69 v69.2.0 // indirect
2933
github.com/google/go-querystring v1.1.0 // indirect
3034
github.com/google/uuid v1.6.0 // indirect
3135
github.com/kylelemons/godebug v1.1.0 // indirect
36+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
3237
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
33-
golang.org/x/crypto v0.32.0 // indirect
34-
golang.org/x/net v0.34.0 // indirect
35-
golang.org/x/sys v0.29.0 // indirect
36-
golang.org/x/text v0.21.0 // indirect
38+
github.com/prometheus/client_golang v1.20.5 // indirect
39+
github.com/prometheus/client_model v0.6.1 // indirect
40+
github.com/prometheus/common v0.55.0 // indirect
41+
github.com/prometheus/procfs v0.15.1 // indirect
42+
golang.org/x/crypto v0.34.0 // indirect
43+
golang.org/x/net v0.35.0 // indirect
44+
golang.org/x/sys v0.30.0 // indirect
45+
golang.org/x/text v0.22.0 // indirect
46+
google.golang.org/protobuf v1.36.1 // indirect
3747
gopkg.in/yaml.v3 v3.0.1 // indirect
3848
)

0 commit comments

Comments
 (0)