9
9
import de .muenchen .captchaservice .service .captcha .CaptchaService ;
10
10
import de .muenchen .captchaservice .service .siteauth .SiteAuthService ;
11
11
import de .muenchen .captchaservice .service .sourceaddress .SourceAddressService ;
12
- import io .micrometer .core .instrument .Counter ;
13
12
import jakarta .validation .Valid ;
14
13
import lombok .RequiredArgsConstructor ;
15
14
import lombok .SneakyThrows ;
@@ -27,8 +26,6 @@ public class CaptchaController {
27
26
private final CaptchaService captchaService ;
28
27
private final SiteAuthService siteAuthService ;
29
28
private final SourceAddressService sourceAddressService ;
30
- private final Counter challengeRequestCounter ;
31
- private final Counter verifyRequestCounter ;
32
29
33
30
@ PostMapping ("/challenge" )
34
31
@ SneakyThrows
@@ -37,7 +34,6 @@ public PostChallengeResponse postChallenge(@Valid @RequestBody final PostChallen
37
34
throw new UnauthorizedException ("Wrong credentials." );
38
35
}
39
36
40
- challengeRequestCounter .increment ();
41
37
final SourceAddress sourceAddress = sourceAddressService .parse (request .getSiteKey (), request .getClientAddress ());
42
38
final Altcha .Challenge challenge = captchaService .createChallenge (request .getSiteKey (), sourceAddress );
43
39
return new PostChallengeResponse (challenge );
@@ -49,7 +45,6 @@ public PostVerifyResponse postVerify(@Valid @RequestBody final PostVerifyRequest
49
45
throw new UnauthorizedException ("Wrong credentials." );
50
46
}
51
47
52
- verifyRequestCounter .increment ();
53
48
final boolean isValid = captchaService .verify (request .getSiteKey (), request .getPayload ());
54
49
return new PostVerifyResponse (isValid );
55
50
}
0 commit comments