-
Notifications
You must be signed in to change notification settings - Fork 29
#100 moved pinnedKey to ApiEnvironmentType #101
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
#100 moved pinnedKey to ApiEnvironmentType #101
Conversation
c55c1f6
to
bff80d6
Compare
@@ -5,18 +5,20 @@ | |||
*/ | |||
public enum ApiEnvironmentType { | |||
|
|||
PRODUCTION("api.bunq.com", "v1"), | |||
SANDBOX("public-api.sandbox.bunq.com", "v1"); | |||
PRODUCTION("api.bunq.com", "v1","sha256/nI/T/sDfioCBHB5mVppDPyLi2HXYanwk2arpZuHLOu0="), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing space around ,
PRODUCTION("api.bunq.com", "v1"), | ||
SANDBOX("public-api.sandbox.bunq.com", "v1"); | ||
PRODUCTION("api.bunq.com", "v1","sha256/nI/T/sDfioCBHB5mVppDPyLi2HXYanwk2arpZuHLOu0="), | ||
SANDBOX("public-api.sandbox.bunq.com", "v1","sha256/GhNvDokiMyXzhGft+xXWFGchUmmh8R5dQEnO4xu81NY="); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -30,4 +32,7 @@ public String getApiVersion() { | |||
return this.apiVersion; | |||
} | |||
|
|||
public String getPinnedKey() { | |||
return pinnedKey; | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please the missing new line at EOF here 🙊
String.format(ERROR_AMI_ENVIRONMENT_NOT_EXPECTED, apiContext.getEnvironmentType().toString()) | ||
); | ||
private static CertificatePinner determineCertificateToPin(ApiEnvironmentType environmentType) { | ||
if(environmentType!=null && environmentType.getPinnedKey()!=null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing space around operators.
).build(); | ||
} else { | ||
throw new BunqException( | ||
String.format(ERROR_AMI_ENVIRONMENT_NOT_EXPECTED, Objects.toString(environmentType,"<null>")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing space after comma.
@tubbynl you can ignore the 80 line thing, the bot has been reconfigured and on your next push it should check for length of 100. Sorry for the inconvenience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is almost there!
return pinnedKey; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing new line at end of class
block.
} else { | ||
throw new BunqException( | ||
String.format(ERROR_AMI_ENVIRONMENT_NOT_EXPECTED, | ||
Objects.toString(environmentType, "<null>")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This formatting looks weird. It should be on the same level as String.format(ERROR_AMI_ENVIRONMENT_NOT_EXPECTED,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it then will be 109 chars :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same indent level as. My apologies.
throw new BunqException( | ||
String.format(ERROR_AMI_ENVIRONMENT_NOT_EXPECTED, | ||
Objects.toString(environmentType, "<null>")) | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be kind enough to add the missing new line at end of the class
block here as well 👼
fails at but that probably also fails on a build on the |
795a7f1
to
b1c11ac
Compare
see #100 close as-you-wish |
@patrickdw1991 please 👁 the failing test is offline HSM. |
@@ -228,7 +225,7 @@ public boolean ensureSessionActive() { | |||
|
|||
public boolean isSessionActive() { | |||
return sessionContext != null && | |||
getTimeToSessionExpiryInSeconds() < TIME_TO_SESSION_EXPIRY_MINIMUM_SECONDS; | |||
getTimeToSessionExpiryInSeconds() > TIME_TO_SESSION_EXPIRY_MINIMUM_SECONDS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OGKevin Just to be sure are you sure that this won't create any issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to my testing no, It was recreating a session on every call 😅 now it seems to behave as expected. Pipeline should not fail with 429 errors on each test anymore.
@@ -42,9 +39,14 @@ | |||
private static Gson gson = BunqGsonBuilder.buildDefault().create(); | |||
|
|||
private static void EnsureEnoughPayments() { | |||
for (int i = NUMBER_ZERO; i < GetPaymentsMissingCount(); ++i) { | |||
CreatePayment(); | |||
int paymentCount = GetPaymentsMissingCount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missingPaymentCount?
private static void CreatePayment() { | ||
Payment.create(new Amount(PAYMENT_AMOUNT_EUR, PAYMENT_CURRENCY), getPointerBravo(), PAYMENT_DESCRIPTION); | ||
private static Payment createPayment() { | ||
return new Payment( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two spaces 😱
@patrickdw1991 pushed. |
moved the pinnedKeys to ApiEnvironmentType