Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow set lifetime for service account creds #516

Merged
merged 12 commits into from
Jan 12, 2021
Prev Previous commit
Next Next commit
update
  • Loading branch information
arithmetic1728 committed Dec 17, 2020
commit 39476f1cde7a588588a1041e9b8155f9d5e686dd
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public class ServiceAccountCredentials extends GoogleCredentials
if (lifetime > TWELVE_HOURS_IN_SECONDS) {
throw new IllegalStateException("lifetime must be less than or equal to 43200");
}
this.lifetime = lifetime == 0 ? DEFAULT_LIFETIME_IN_SECONDS : lifetime;
this.lifetime = lifetime;
}

/**
Expand Down Expand Up @@ -850,7 +850,7 @@ public Builder setQuotaProjectId(String quotaProjectId) {
}

public Builder setLifetime(int lifetime) {
this.lifetime = lifetime;
this.lifetime = lifetime == 0 ? DEFAULT_LIFETIME_IN_SECONDS : lifetime;
return this;
}

Expand Down