1 | package edu.ucsb.cs156.example.controllers; | |
2 | ||
3 | import org.springframework.context.annotation.Profile; | |
4 | import org.springframework.security.web.csrf.CsrfToken; | |
5 | import org.springframework.web.bind.annotation.GetMapping; | |
6 | import org.springframework.web.bind.annotation.RestController; | |
7 | ||
8 | | |
9 | import io.swagger.v3.oas.annotations.Operation; | |
10 | import io.swagger.v3.oas.annotations.tags.Tag; | |
11 | ||
12 | @Profile("development") | |
13 | @Tag(name = "CSRF (enabled only in development; can be used with Postman to test APIs)") | |
14 | @RestController | |
15 | public class CSRFController { | |
16 | @Operation(summary= "Get a CSRF Token") | |
17 | @GetMapping("/csrf") | |
18 | public CsrfToken csrf(CsrfToken token) { | |
19 |
1
1. csrf : replaced return value with null for edu/ucsb/cs156/example/controllers/CSRFController::csrf → KILLED |
return token; |
20 | } | |
21 | } | |
Mutations | ||
19 |
1.1 |