Compare commits

...

2 Commits

@ -37,6 +37,25 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>packaging validator components</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
@ -73,9 +92,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-logging</groupId> <groupId>org.slf4j</groupId>
<artifactId>commons-logging</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.2</version> <version>1.7.36</version>
</dependency> </dependency>
</dependencies> </dependencies>

@ -0,0 +1,31 @@
<!-- Assemble migration-token-validator server -->
<assembly>
<id>bin</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<outputDirectory>/bin</outputDirectory>
<directory>${project.basedir}/src/main/bin</directory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/main/assembly</directory>
<outputDirectory>/logs</outputDirectory>
<directoryMode>0775</directoryMode>
<excludes>
<exclude>*/**</exclude>
</excludes>
</fileSet>
</fileSets>
<files>
<file>
<outputDirectory>/bin</outputDirectory>
<destName>${project.artifactId}.jar</destName>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<fileMode>0755</fileMode>
</file>
</files>
</assembly>

@ -0,0 +1,23 @@
#!/bin/bash
value_port='8081'
value_db_url='jdbc:mysql://localhost:3306/EN_MI'
value_db_username='root'
value_db_password='root'
property_port='--server.port='
property_db_url='--spring.datasource.url='
property_db_username='--spring.datasource.username='
property_db_password='--spring.datasource.password='
property_log_path='--logging.file.path='
configs=($property_port$value_port \
$property_db_url$value_db_url \
$property_db_username$value_db_username \
$property_db_password$value_db_password)
for config in "${configs[@]}"; do
config_str="${config_str} ${config}"
done
# starting the validation sever
java -jar migration-token-validator.jar "$config_str"

@ -23,7 +23,7 @@ public class TokenValidationExceptionHandler {
return errorMap; return errorMap;
} }
@ResponseStatus(HttpStatus.UNAUTHORIZED) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ExceptionHandler(ValidationException.class) @ExceptionHandler(ValidationException.class)
public Map<String, String> handleValidationException(ValidationException ex) { public Map<String, String> handleValidationException(ValidationException ex) {
Map<String, String> errorMap = new HashMap<>(); Map<String, String> errorMap = new HashMap<>();

@ -6,8 +6,8 @@ import io.entgra.token.validator.dto.TokenDTO;
import io.entgra.token.validator.dto.ValidationInfoDTO; import io.entgra.token.validator.dto.ValidationInfoDTO;
import io.entgra.token.validator.entities.Token; import io.entgra.token.validator.entities.Token;
import io.entgra.token.validator.exception.ValidationException; import io.entgra.token.validator.exception.ValidationException;
import org.apache.commons.logging.Log; import org.slf4j.Logger;
import org.apache.commons.logging.LogFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -15,7 +15,7 @@ import java.util.Objects;
@Service @Service
public class TokenService { public class TokenService {
private static final Log log = LogFactory.getLog(TokenService.class); private static final Logger log = LoggerFactory.getLogger(TokenService.class);
@Autowired @Autowired
public TokenDAO tokenDAO; public TokenDAO tokenDAO;

@ -1,7 +1,9 @@
server.port = 3001 server.port=8081
spring.jpa.hibernate.ddl-auto=none spring.jpa.hibernate.ddl-auto=none
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.datasource.url=jdbc:mysql://localhost:3306/EN_MI spring.datasource.url=jdbc:mysql://localhost:3306/EN_MI
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=root spring.datasource.password=root
spring.jackson.property-naming-strategy=SNAKE_CASE spring.jackson.property-naming-strategy=SNAKE_CASE
logging.file.name=../logs/validator.log
spring.logging.file.max-history=5

@ -0,0 +1,8 @@
__ __ _ _ _ _______ _ __ __ _ _ _ _
| \/ (_) | | (_) |__ __| | | \ \ / / | (_) | | | |
| \ / |_ __ _ _ __ __ _| |_ _ ___ _ __ | | ___ | | _____ _ __ \ \ / /_ _| |_ __| | __ _| |_ ___ _ __
| |\/| | |/ _` | '__/ _` | __| |/ _ \| '_ \ | |/ _ \| |/ / _ \ '_ \ \ \/ / _` | | |/ _` |/ _` | __/ _ \| '__|
| | | | | (_| | | | (_| | |_| | (_) | | | | | | (_) | < __/ | | | \ / (_| | | | (_| | (_| | || (_) | |
|_| |_|_|\__, |_| \__,_|\__|_|\___/|_| |_| |_|\___/|_|\_\___|_| |_| \/ \__,_|_|_|\__,_|\__,_|\__\___/|_|
__/ |
|___/
Loading…
Cancel
Save