mirror of
https://github.com/google/nomulus.git
synced 2025-08-06 01:35:17 +02:00
Add XSRF protection to legacy authentication mechanism
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148689952
This commit is contained in:
parent
a5932c0fc3
commit
c7a62e9b98
12 changed files with 227 additions and 56 deletions
|
@ -113,7 +113,7 @@ public class RegistrarSettingsActionTestCase {
|
|||
when(req.getMethod()).thenReturn("POST");
|
||||
when(rsp.getWriter()).thenReturn(new PrintWriter(writer));
|
||||
when(req.getContentType()).thenReturn("application/json");
|
||||
when(req.getHeader(eq("X-CSRF-Token"))).thenReturn(xsrfTokenManager.generateToken("console"));
|
||||
when(req.getHeader(eq("X-CSRF-Token"))).thenReturn(xsrfTokenManager.generateTokenWithCurrentUser("console"));
|
||||
when(req.getReader()).thenReturn(createJsonPayload(ImmutableMap.of("op", "read")));
|
||||
when(sessionUtils.isLoggedIn()).thenReturn(true);
|
||||
when(sessionUtils.checkRegistrarConsoleLogin(req)).thenReturn(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue