mirror of
https://github.com/google/nomulus
synced 2026-01-06 13:36:48 +00: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:
@@ -173,6 +173,7 @@ public class RequestHandler<C> {
|
||||
if (!authResult.isPresent()) {
|
||||
logger.warning("Request would not have been authorized");
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user