Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into upgrade_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
shrikant1407 authored Mar 22, 2024
2 parents 295ba77 + 01491da commit 0b5d915
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ $ curl --cacert ./certs/ca.cert.pem https://localhost:1180/health
Expected result:
```
{
"version": "1.1.6"
"version": "1.1.8"
}
```

Expand Down
13 changes: 6 additions & 7 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
FROM ubuntu:20.04

RUN apt-get clean && apt-get -y update && apt-get -y upgrade
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get clean && apt-get -y update && apt-get -y upgrade && apt-get install -y openjdk-17-jdk maven make git curl swig cmake unzip software-properties-common --no-install-recommends

RUN bash -c 'echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" >> /etc/apt/sources.list'
RUN bash -c 'echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe" >> /etc/apt/sources.list'
RUN apt-get -y update
RUN apt-get -y install g++-4.9 g++-4.9-multilib

RUN apt-get -y update && apt-get -y install g++-4.9 g++-4.9-multilib --no-install-recommends
RUN bash -c 'head -n -2 /etc/apt/sources.list > intermediate_file;mv -f intermediate_file /etc/apt/sources.list'
RUN apt-get -y update
#RUN apt-get -y update
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 10
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 10
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
RUN update-alternatives --set cc /usr/bin/gcc
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
RUN update-alternatives --set c++ /usr/bin/g++

RUN apt-get install -y software-properties-common && add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get install -y openjdk-11-jdk maven make git curl swig cmake unzip

# Create a user 'fdouser'. If the user name is updated, please update the same in docker-compose.yaml.
RUN useradd -ms /bin/bash fdouser
RUN mkdir -p /home/fdouser/epid-verification-service/ ; chown -R fdouser:fdouser /home/fdouser/epid-verification-service/
Expand Down
4 changes: 2 additions & 2 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export https_proxy_host=$(echo $https_proxy | awk -F':' {'print $2'} | tr -d '/'
export https_proxy_port=$(echo $https_proxy | awk -F':' {'print $3'} | tr -d '/')

export _JAVA_OPTIONS="-Dhttp.proxyHost=$http_proxy_host -Dhttp.proxyPort=$http_proxy_port -Dhttps.proxyHost=$https_proxy_host -Dhttps.proxyPort=$https_proxy_port"
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64

# The PGP signature verification requires additional proxy configuration in
# ~/.m2/settings.xml. For simplicity and easier out of box experience, the PGP
# signature verification is disabled here. In case this is used to create
# production build, it is recommended to update ~/.m2/settings.xml to include
# proxy configurations.
MVN_CONFIG="-Dpgpverify.skip=true"
MVN_CONFIG="-Dpgpverify.skip=true -Dcheckstyle.skip"

build_source()
{
Expand Down
3 changes: 1 addition & 2 deletions demo/Dockerfile-epid-verification
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# SPDX-License-Identifier: Apache 2.0

FROM ubuntu:20.04
RUN apt-get update && apt-get install -y openjdk-11-jdk
RUN apt-get install -y wget openssl
RUN apt-get update && apt-get install -y openjdk-17-jdk wget openssl --no-install-recommends

# Create a user 'verifier'.
# If the user name is updated, please update the same in cmdDocker.sh.
Expand Down
2 changes: 1 addition & 1 deletion demo/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: '2.4'
services:

epid-verification-service:
image: epid-verification-service:1.1.6
image: epid-verification-service:1.1.8
container_name: epid-verification-service
expose:
- "1180"
Expand Down
14 changes: 4 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<artifactId>epid-verification-service</artifactId>
<name>FDO EPID Verification Service App</name>
<packaging>jar</packaging>
<version>1.1.6</version>
<version>1.1.8</version>
<description>FDO EPID Verification Service App</description>

<!--
Expand Down Expand Up @@ -61,7 +61,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.17</version>
<version>3.2.3</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -91,14 +91,8 @@
<artifactId>spring-boot-starter-jetty</artifactId>
<version>${spring-boot-starter-jetty.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
Expand All @@ -117,7 +111,7 @@
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
@RestController
public class HealthController {

@Autowired private HttpServletRequest request;

@Autowired private InfoConfig infoConfig;

/**
Expand All @@ -31,7 +29,6 @@ public class HealthController {
@RequestMapping(value = "/health", method = RequestMethod.GET)
@MethodCallLogged
public ResponseEntity checkHealth() {
IpManager.retrieveIpFromRequest(request);
VerificationHealthResponse hr = new VerificationHealthResponse(infoConfig.getVersion());
return new ResponseEntity<>(hr, HttpStatus.OK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import java.io.FileNotFoundException;
import java.io.IOException;
import javax.validation.Valid;
import javax.xml.bind.DatatypeConverter;
import lombok.extern.slf4j.Slf4j;
import org.fidoalliance.fdo.epid.verification.enums.EpidResource;
Expand Down Expand Up @@ -71,7 +70,7 @@ public ResponseEntity<byte[]> createProofEpid20(@RequestBody byte[] streamInput)
produces = MediaType.APPLICATION_JSON_VALUE)
@MethodExecutionLogged
public ResponseEntity<ProofResponse> createProofEpid20(
@Valid @RequestBody ProofRequest proofRequest)
@RequestBody ProofRequest proofRequest)
throws IOException, InvalidSignatureException, SigrlVersionSignatureVersionMismatchException,
GenericVerificationException {
ProofResponse proofResponse = handleJsonRequest(EpidVersion.EPID20, proofRequest);
Expand All @@ -96,7 +95,7 @@ public ResponseEntity<byte[]> createProofEpid11(@RequestBody byte[] streamInput)
produces = MediaType.APPLICATION_JSON_VALUE)
@MethodExecutionLogged
public ResponseEntity<ProofResponse> createProofEpid11(
@Valid @RequestBody ProofRequest proofRequest)
@RequestBody ProofRequest proofRequest)
throws IOException, InvalidSignatureException, SigrlVersionSignatureVersionMismatchException,
GenericVerificationException {
ProofResponse proofResponse = handleJsonRequest(EpidVersion.EPID11, proofRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,8 @@
import org.fidoalliance.fdo.epid.verification.logging.IpManager;
import org.fidoalliance.fdo.epid.verification.logging.TransactionManager;
import org.springframework.lang.Nullable;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import org.springframework.web.servlet.HandlerInterceptor;

public class RequestInitializerInterceptor extends HandlerInterceptorAdapter {
public class RequestInitializerInterceptor implements HandlerInterceptor {

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws NoSuchAlgorithmException {
IpManager.retrieveIpFromRequest(request);
TransactionManager.startTransaction();

return true;
}

@Override
public void afterCompletion(
HttpServletRequest request,
HttpServletResponse response,
Object handler,
@Nullable Exception ex)
throws Exception {
IpManager.removeIP();
TransactionManager.removeTransactionId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -22,13 +21,13 @@
@NoArgsConstructor
public class ProofRequest implements RawSerializable {

@NotNull private byte[] groupId;
private byte[] groupId;

@NotNull private byte[] msg;
private byte[] msg;

private byte[] basename;

@NotNull private byte[] epidSignature;
private byte[] epidSignature;

/**
* Parameterized constructor.
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2021 Intel Corporation
# SPDX-License-Identifier: Apache 2.0

info.build.version: 1.1.6
info.build.version: 1.1.8

server.port: 1180
server.connection-timeout: 70000
Expand Down

0 comments on commit 0b5d915

Please sign in to comment.