• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

torresj / infosas-api / 87

12 Jan 2026 02:35PM UTC coverage: 76.32% (-15.3%) from 91.648%
87

push

circleci

torresj
Auth API added

70 of 170 new or added lines in 20 files covered. (41.18%)

477 of 625 relevant lines covered (76.32%)

0.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.29
/src/main/java/com/torresj/infosas/services/impl/AuthServiceImpl.java
1
package com.torresj.infosas.services.impl;
2

3
import com.torresj.infosas.dtos.AuthResponseDto;
4
import com.torresj.infosas.exceptions.InfoSasAuthenticationException;
5
import com.torresj.infosas.repositories.client.ClientRepository;
6
import com.torresj.infosas.services.AuthService;
7
import com.torresj.infosas.services.JwtService;
8
import lombok.RequiredArgsConstructor;
9
import lombok.extern.slf4j.Slf4j;
10
import org.springframework.security.crypto.password.PasswordEncoder;
11
import org.springframework.stereotype.Service;
12

13
@Service
14
@Slf4j
1✔
15
@RequiredArgsConstructor
16
public class AuthServiceImpl implements AuthService {
17

18
    private final PasswordEncoder encoder;
19
    private final ClientRepository clientRepository;
20
    private final JwtService jwtService;
21

22
    @Override
23
    public AuthResponseDto authenticate(long id, String password) {
NEW
24
        log.debug("[AUTH SERVICE] Authenticating client");
×
NEW
25
        var client = clientRepository.findById(id).orElseThrow(InfoSasAuthenticationException::new);
×
NEW
26
        if (!encoder.matches(password, client.getPassword())) {
×
NEW
27
            throw new InfoSasAuthenticationException();
×
28
        }
NEW
29
        log.debug("[AUTH SERVICE] Client name: {}", client.getName());
×
NEW
30
        return new AuthResponseDto(jwtService.createJWS(client.getName()));
×
31
    }
32
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc