Skip to content

#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

Merged
merged 12 commits into from
Jul 10, 2018

Conversation

tubbynl
Copy link
Contributor

@tubbynl tubbynl commented Jun 15, 2018

moved the pinnedKeys to ApiEnvironmentType

@OGKevin
Copy link
Contributor

OGKevin commented Jun 17, 2018

@tubbynl please rebase your commits to follow the following pattern.

- '([A-Za-z0-9 ]+)\. (\(bunq\/sdk_java#[0-9]+\))'

@OGKevin OGKevin self-requested a review June 17, 2018 06:38
@tubbynl tubbynl force-pushed the develop-100-ApiEnvironmentType branch from c55c1f6 to bff80d6 Compare June 17, 2018 14:59
@@ -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="),
Copy link
Contributor

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=");
Copy link
Contributor

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;
}
}
Copy link
Contributor

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) {
Copy link
Contributor

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>"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing space after comma.

@OGKevin
Copy link
Contributor

OGKevin commented Jun 19, 2018

@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.

Copy link
Contributor

@OGKevin OGKevin left a 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;
}
}
Copy link
Contributor

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>"))
Copy link
Contributor

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,

Copy link
Contributor Author

@tubbynl tubbynl Jun 19, 2018

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 :/

Copy link
Contributor

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>"))
);
}
}
Copy link
Contributor

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 👼

@bunq bunq deleted a comment Jun 19, 2018
@bunq bunq deleted a comment Jun 19, 2018
@bunq bunq deleted a comment Jun 19, 2018
@bunq bunq deleted a comment Jun 19, 2018
@bunq bunq deleted a comment Jun 19, 2018
@bunq bunq deleted a comment Jun 19, 2018
@bunq bunq deleted a comment Jun 19, 2018
@bunq bunq deleted a comment Jun 19, 2018
@tubbynl
Copy link
Contributor Author

tubbynl commented Jun 19, 2018

fails at
com.bunq.sdk.model.generated.endpoint.CardDebitTest > orderNewMaestroCardTest FAILED com.bunq.sdk.exception.PleaseContactBunqException at CardDebitTest.java:80

but that probably also fails on a build on the develop branch as-is

@tubbynl tubbynl force-pushed the develop-100-ApiEnvironmentType branch from 795a7f1 to b1c11ac Compare June 20, 2018 07:37
@bunq bunq deleted a comment Jun 20, 2018
@tubbynl
Copy link
Contributor Author

tubbynl commented Jun 20, 2018

see #100 close as-you-wish

@bunq bunq deleted a comment Jun 22, 2018
@OGKevin OGKevin added this to the 1.0.0 milestone Jun 22, 2018
@bunq bunq deleted a comment Jun 22, 2018
@bunq bunq deleted a comment Jun 22, 2018
@bunq bunq deleted a comment Jun 22, 2018
@bunq bunq deleted a comment Jun 22, 2018
@OGKevin
Copy link
Contributor

OGKevin commented Jun 22, 2018

@patrickdw1991 please 👁 the failing test is offline HSM.

@OGKevin OGKevin requested a review from patrickdw1991 June 22, 2018 07:52
OGKevin
OGKevin previously approved these changes Jun 22, 2018
@@ -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;

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?

Copy link
Contributor

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();

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(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two spaces 😱

@OGKevin
Copy link
Contributor

OGKevin commented Jul 10, 2018

@patrickdw1991 pushed.

@bunq bunq deleted a comment Jul 10, 2018
@OGKevin OGKevin merged commit c0d16de into bunq:develop Jul 10, 2018
@OGKevin
Copy link
Contributor

OGKevin commented Jul 10, 2018

@andrederoos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants