diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-10-14 04:11:39 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-10-14 04:11:39 +0300 |
commit | f099b8367afc8d77cbb228f39a207f94ee8d71bf (patch) | |
tree | 1cd7292540d126777768263ad4c58032f672a6b9 /src/main/java/linaro/pubapi | |
parent | ac201e3b51e60c2be2519e2e1f923eb56a546e54 (diff) |
Make default token not-valid-before/after values configurable.
Well, so far we don't allow to configure these values per-job, so these defaults
should account for all jobs.
Change-Id: I942dddb4edf2e555bc103904ba196f9df755960c
Diffstat (limited to 'src/main/java/linaro/pubapi')
-rw-r--r-- | src/main/java/linaro/pubapi/LinaroPubAPIKey.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/linaro/pubapi/LinaroPubAPIKey.java b/src/main/java/linaro/pubapi/LinaroPubAPIKey.java index e6cfb2c..3a9cb95 100644 --- a/src/main/java/linaro/pubapi/LinaroPubAPIKey.java +++ b/src/main/java/linaro/pubapi/LinaroPubAPIKey.java @@ -43,6 +43,9 @@ public class LinaroPubAPIKey extends Builder { private String secretKey; private String apiURL; + // Using public members alleviates us from creating getters/setters + public String defaultNotBefore; + public String defaultNotAfter; public Descriptor() { load(); @@ -90,7 +93,8 @@ public class LinaroPubAPIKey extends Builder { String url = getDescriptor().getPubAPIURL(); PostMethod method = new PostMethod(url); method.setRequestHeader("AuthToken", getDescriptor().getPubAPISecretKey()); - method.addParameter("expires", "18000"); // 5hrs + method.addParameter("not_valid_til", Integer.toString(Integer.parseInt(getDescriptor().defaultNotBefore) * 60)); + method.addParameter("expires", Integer.toString(Integer.parseInt(getDescriptor().defaultNotAfter) * 60)); // Auto-retry once on some (connection) errors // Note: for some connection issues, there's very long timeouts, so |