mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Fix bug in authentication code
[] changed RequestHandler to log a warning instead of returning an error to the user when authentication failed. Unfortunately, it didn't handle the resulting absent value of AuthResult. I don't yet know why the tests pass, and plan to add a test to check for this situation, but I wanted to start by fixing the problem as soon as possible, as it seems like this would result in exceptions any time a request was handled which didn't pass authentication. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149136265
This commit is contained in:
parent
9a15f08b3a
commit
034312c17d
1 changed files with 1 additions and 0 deletions
|
@ -173,6 +173,7 @@ public class RequestHandler<C> {
|
||||||
if (!authResult.isPresent()) {
|
if (!authResult.isPresent()) {
|
||||||
logger.warning("Request would not have been authorized");
|
logger.warning("Request would not have been authorized");
|
||||||
// TODO(b/28219927): Change this to call rsp.sendError(SC_FORBIDDEN) and return
|
// TODO(b/28219927): Change this to call rsp.sendError(SC_FORBIDDEN) and return
|
||||||
|
authResult = Optional.of(AuthResult.NOT_AUTHENTICATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build a new request component using any modules we've constructed by this point.
|
// Build a new request component using any modules we've constructed by this point.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue