New module with the webapp

This commit is contained in:
Xavi Aracil 2023-09-04 10:42:53 +02:00
parent 10224b6a41
commit 8dc94ed601
4 changed files with 264 additions and 0 deletions

179
inspector-vc-web/pom.xml Normal file
View File

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.1edtech</groupId>
<artifactId>vc-public-validator</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>inspector-vc-web</artifactId>
<properties>
<mainClass>org.oneedtech.inspect.vc.web.ValidatorApplication</mainClass>
<spring-boot-starter-parent.version>2.6.7</spring-boot-starter-parent.version>
<spring-boot-maven-plugin.version>2.6.7</spring-boot-maven-plugin.version>
<imageName>gcr.io/staging-1edtech/ims/inspector-vc-public</imageName>
</properties>
<profiles>
<profile>
<id>docker</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.40.2</version>
<configuration>
<images>
<image>
<name>${imageName}</name>
<build>
<dockerFile>${project.basedir}/Dockerfile</dockerFile>
<tags>
<tag>${project.version}</tag>
</tags>
<buildx>
<platforms>
<platform>linux/amd64</platform>
<platform>linux/arm64</platform>
<platform>windows/amd64</platform>
</platforms>
</buildx>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-docker.image</id>
<goals>
<goal>build</goal>
<goal>tag</goal>
</goals>
</execution>
<execution>
<id>push-docker-image</id>
<goals>
<goal>push</goal>
</goals>
<phase>install</phase>
<configuration>
<pushRegistry>gcr.io</pushRegistry>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.1edtech</groupId>
<artifactId>inspector-web-public</artifactId>
</dependency>
<dependency>
<groupId>org.1edtech</groupId>
<artifactId>inspector-vc</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-log4j2 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion> <!-- 20220227 bug: TestEngine with ID 'junit-jupiter' failed to discover
tests -->
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring-boot-starter-parent.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-maven-plugin.version}</version>
<configuration>
<mainClass>${mainClass}</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,24 @@
package org.oneedtech.inspect.vc.web;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.oneedtech.inspect.web.InspectorWebConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@SpringBootApplication // == @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan
@Configuration
@Import(InspectorWebConfig.class)
@ComponentScan("org.oneedtech.inspect.web")
public class ValidatorApplication implements WebMvcConfigurer {
public static void main(String[] args) {
SpringApplication.run(ValidatorApplication.class, args);
}
private final static Logger logger = LogManager.getLogger();
}

View File

@ -0,0 +1,16 @@
# To build a docker image for distribution, set spring.profiles.active=prod and dockerMode=true
# To build a fatjar for deployment on the ims website with oauth sso, set dockerMode=false and spring.profiles.active=prod
# During development, set spring.profiles.active=dev. If dockerMode is true during devMode, a jwt license in /resources is used as a dummy.
# to deploy jars to nexus: set profile=prod & dockerMode false, then mvn clean deploy -Dmaven.test.skip=true -P deploy-nexus
# to build docker: set profile=prod & dockerMode true, then mvn clean install -Dmaven.test.skip=true -P docker, then docker:push gcr.io/staging-1edtech/ims/inspector:0.x.0
#spring.profiles.active = dev | prod
spring.profiles.active=dev
dockerMode=false
app.version=1.0.0
# misc
spring.jackson.serialization.INDENT_OUTPUT=true
server.servlet.encoding.charset=UTF-8
server.servlet.encoding.force-response=true

View File

@ -0,0 +1,45 @@
{
"groups": [
{
"id": "vc",
"name": "Verifiable Credentials",
"desc": "Verifiers for the Open Badges and Comprehensive Learner Record specifications"
}
],
"validators" : [
{
"id": "OB30Inspector",
"name": "Open Badges 3.0 Verifier",
"pkg": "org.oneedtech.inspect.vc",
"desc": "Verifies Open Badges 3.0 files",
"instr": "This validator supports Open Badges 3.0 files.",
"spec": "ob",
"group": "vc",
"supportsCertification": false,
"submissionTypes": ["upload","uri"]
},
{
"id": "OB20Inspector",
"name": "Open Badges 2.0 Verifier",
"pkg": "org.oneedtech.inspect.vc",
"desc": "Verifies Open Badges 2.0 files",
"instr": "This validator supports Open Badges 2.0 files.",
"spec": "ob",
"group": "vc",
"supportsCertification": false,
"submissionTypes": ["upload","uri"]
},
{
"id": "CLR20Inspector",
"name": "CLR 2.0 Verifier",
"pkg": "org.oneedtech.inspect.vc",
"desc": "Verifies Comprehensive Learner Record (CLR) 2.0 files",
"instr": "This validator supports Comprehensive Learner Record (CLR) 2.0 files.",
"spec": "clr",
"group": "vc",
"supportsCertification": false,
"submissionTypes": ["upload","uri"]
}
]
}