-
Notifications
You must be signed in to change notification settings - Fork 4
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
song-655-jwt-2 #661
Conversation
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.
LGTM!
@@ -72,6 +73,7 @@ | |||
SEQUENCING_READ_NOT_FOUND(NOT_FOUND), | |||
VARIANT_CALL_NOT_FOUND(NOT_FOUND), | |||
UNAUTHORIZED_TOKEN(UNAUTHORIZED), | |||
FORBIDDEN_TOKEN(FORBIDDEN), |
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.
👍
@@ -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 |
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.
👍
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.
Just a note, the AccessTokenConverterWithExpiry
is still using int for the expiryInSeconds
auth: | ||
server: | ||
url: "http://localhost:8084/check_token/" | ||
clientId: "3kJhz9pNtC0pFHAxr2SPkUkGjXrkWWqGcnPC0vBP" |
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.
I'm assuming these are not real.
|
||
private static long calcSecondsUntilExpiry(Long expirationTimestamp) { | ||
val diff = expirationTimestamp - MILLISECONDS.toSeconds(currentTimeMillis()); | ||
return diff > 0 ? diff : 0; |
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.
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.
No description provided.