Skip to content

Commit 1443730

Browse files
committed
Add more logging
1 parent 8367aeb commit 1443730

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ static AppInstallationToken generateAppInstallationToken(String appId, String ap
140140
.create();
141141

142142
long expiration = getExpirationSeconds(appInstallationToken);
143+
LOGGER.log(Level.FINEST, "Token raw expiration epoch seconds: {0}", expiration);
143144

145+
AppInstallationToken token = new AppInstallationToken(appInstallationToken.getToken(), expiration);
144146
LOGGER.log(Level.FINE, "Generated App Installation Token for app ID {0}", appId);
145147

146-
return new AppInstallationToken(appInstallationToken.getToken(), expiration);
148+
return token;
147149
} catch (IOException e) {
148150
LOGGER.log(Level.WARNING, "Failed to retrieve GitHub App installation token for app ID " + appId, e);
149151
throw new IllegalArgumentException(String.format(ERROR_AUTHENTICATING_GITHUB_APP, appId), e);
@@ -240,6 +242,7 @@ public AppInstallationToken(String token, long tokenExpirationEpochSeconds) {
240242
// Tokens have a maximum age at which they go stale
241243
tokenStaleEpochSeconds = Math.min(tokenExpirationEpochSeconds, nextSecond + MAXIMUM_AGE_SECONDS);
242244
}
245+
LOGGER.log(Level.FINER, "Token stale time epoch seconds: {0}", tokenStaleEpochSeconds);
243246

244247
this.token = token;
245248
this.tokenStaleEpochSeconds = tokenStaleEpochSeconds;

0 commit comments

Comments
 (0)