Browse Source

fix: put back the expires into the github generator (#5472)

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Gergely Brautigam 6 months ago
parent
commit
b3492fa0ba
1 changed files with 3 additions and 2 deletions
  1. 3 2
      pkg/generator/github/github.go

+ 3 - 2
pkg/generator/github/github.go

@@ -195,8 +195,9 @@ func newGHClient(ctx context.Context, k client.Client, n string, hc *http.Client
 // GetInstallationToken generates a GitHub installation token using the provided private key and app ID.
 func GetInstallationToken(key *rsa.PrivateKey, aid string) (string, error) {
 	claims := jwt.RegisteredClaims{
-		Issuer:   aid,
-		IssuedAt: jwt.NewNumericDate(time.Now().Add(-time.Second * 10)),
+		Issuer:    aid,
+		IssuedAt:  jwt.NewNumericDate(time.Now().Add(-time.Second * 10)),
+		ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Second * 300)),
 	}
 
 	token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims)