-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ian UI d2 1394 update attest failure reaction #125
Ian UI d2 1394 update attest failure reaction #125
Conversation
@@ -33,12 +34,11 @@ public class AttestationTokenRetriever { | |||
private final AtomicReference<String> attestationToken; | |||
private final AtomicReference<String> optOutJwt; | |||
private final AtomicReference<String> coreJwt; | |||
private final Handler<Integer> responseWatcher; | |||
private final Handler<Pair<Integer, String>> responseWatcher; |
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.
Are you sure this is only used by operator?
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.
Out of the core, optout, admin, and operator, the attestation token retriever is used by operator and optout, but optout uses a null responseWatcher. Will look into optout closer to make sure it is not broken by these changes
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 have tested optout/core with my shared changes locally and it is able to attest and refresh with no extra changes needed
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
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 don't believe we need to change the attestation scheduled behaviour. Attestation happens on the first call to core, and then after that 10 minutes before expiry of the token.
src/main/java/com/uid2/shared/attest/AttestationTokenRetriever.java
Outdated
Show resolved
Hide resolved
src/main/java/com/uid2/shared/attest/AttestationTokenRetriever.java
Outdated
Show resolved
Hide resolved
src/test/java/com/uid2/shared/attest/AttestationTokenRetrieverTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/uid2/shared/attest/AttestationTokenRetrieverTest.java
Outdated
Show resolved
Hide resolved
# Conflicts: # src/main/java/com/uid2/shared/attest/AttestationTokenRetriever.java # src/test/java/com/uid2/shared/attest/AttestationTokenRetrieverTest.java
@@ -112,6 +115,7 @@ private void attestationExpirationCheck(long timerId) { | |||
} | |||
|
|||
try { | |||
|
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.
Extra line
src/main/java/com/uid2/shared/attest/AttestationTokenRetriever.java
Outdated
Show resolved
Hide resolved
notifyResponseWatcher(401, e.getMessage()); | ||
LOGGER.info("Re-attest failed: ", e); | ||
} catch (IOException e) { |
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.
Sorry to do this as I know you have been trying to get this approved for a while, but can we log out for both the 401 and the 500 the response code, and change the messages so we can tell what the cause was?
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 am not quite sure what you are suggesting. It will already log out for both a 401 and a 500, with the message being based on the exception that occurred. Are you suggesting we generalize the error that is logged, so that a 401 always logs the same thing and a 500 always logs the same thing? And if so what do you suggest for the message?
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.
What I want to make sure is that we can tell the difference in our logs (so we can alert differently) between the 2 types of 401 errors. If you are confident that this is the case, then I am OK with this.
src/test/java/com/uid2/shared/attest/AttestationTokenRetrieverTest.java
Outdated
Show resolved
Hide resolved
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 will break the build for operator, so please make sure you are ready to merge operator soon after merging this change, publishing it and updating operator
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.
Please check that all the conversations have been resolved before merging
Update shared to inform attestation response watcher of both status code and response body.