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

song-655-jwt-2 #661

Merged
merged 18 commits into from
Aug 7, 2020
Merged

song-655-jwt-2 #661

merged 18 commits into from
Aug 7, 2020

Conversation

rtisma
Copy link
Contributor

@rtisma rtisma commented Jul 22, 2020

No description provided.

@rtisma rtisma self-assigned this Aug 5, 2020
@rtisma rtisma requested a review from andricDu August 5, 2020 15:59
@rtisma rtisma added this to the Code Monkeys - Sprint 35 milestone Aug 5, 2020
Copy link
Contributor

@andricDu andricDu left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -72,6 +73,7 @@
SEQUENCING_READ_NOT_FOUND(NOT_FOUND),
VARIANT_CALL_NOT_FOUND(NOT_FOUND),
UNAUTHORIZED_TOKEN(UNAUTHORIZED),
FORBIDDEN_TOKEN(FORBIDDEN),
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -7,15 +7,15 @@

@Getter
public class ExpiringOauth2Authentication extends OAuth2Authentication {
private final int expiry; // expiry time of the authentication token in seconds
private final long expiry; // expiry time of the authentication token in seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note, the AccessTokenConverterWithExpiry is still using int for the expiryInSeconds

auth:
server:
url: "http://localhost:8084/check_token/"
clientId: "3kJhz9pNtC0pFHAxr2SPkUkGjXrkWWqGcnPC0vBP"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming these are not real.


private static long calcSecondsUntilExpiry(Long expirationTimestamp) {
val diff = expirationTimestamp - MILLISECONDS.toSeconds(currentTimeMillis());
return diff > 0 ? diff : 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally this is fine, and you are fine in this situation, but you can get into trouble when boxing and widening happen in the wrong order. I would personally use 0L whenever I can because when using val you are boxing primitives. Again, you are fine in these situations, just something to think about.

@rtisma rtisma merged commit 0728932 into develop Aug 7, 2020
@rtisma rtisma deleted the song-655-jwt-2 branch August 7, 2020 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants