Git Product home page Git Product logo

victims-java-service's Introduction

Victims Java Service

Victims Java Service is a microservice that provides Java hash information to the Victims REST project.

How does it work?

the hash endpoint is called passing some files to hash. This service uses the victims-lib-java project to generate a hash a jar file and files compressed within it. Those hashes are then returned to the caller as JSON.

API Documentation

POST /hash

$ curl -X POST -F "library2=@src/test/resources/camel-snakeyaml-2.17.4.jar" http://localhost:8080/hash

[ {
  "hash" : "3cfc3c06a141ba3a43c6c0a01567dbb7268839f75e6367ae0346bab90507ea09c9ecd829ecec3f030ed727c0beaa09da8c08835a8ddc27054a03f800fa049a0a",
  "name" : "camel-snakeyaml-2.17.4.jar",
  "format" : "SHA512",
  "files" : [ {
    "name" : "org/apache/camel/component/snakeyaml/SnakeYAMLDataFormat",
    "hash" : "cb1e80599bd7de814b63ad699849360b6c5d6dd33b7b7a2da6df753197eee137541c6bfde704c5ab8521e6b7dfb436d57f102f369fc0af36738668e4d1d0ff55"
  } ]
} ]

GET /health

Checks the service is up and can access the database

$ curl -v http://localhost:8080/healthz

> GET /healthz HTTP/1.1
> Host: localhost:8080
> Accept: */*
> 
< HTTP/1.1 200 OK
< 

Building this service

Use maven to build the service: mvn clean package

Run the Integration Tests: mvn clean verify

Run a local service: java -jar target/victims-java-service-1.0-SNAPSHOT-fat.jar

Running with Docker

Package the service as a Docker image using S2I: s2i build -E .s2i/environment . registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift:latest victims-java

Run the image passing MongoDB environment variables: docker run -d -p 8080:8080 victims-java

victims-java-service's People

Contributors

ashcrow avatar jasinner avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

jasinner ashcrow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.