Skip to content

alkathirikhalid/cvss-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

Maven

If you use Maven, you can run the application by using

./mvnw spring-boot:run

JAVA

Alternatively, you can build the JAR file with

./mvnw clean package

and then run the JAR file, as follows:

java -jar target/api-0.0.1-SNAPSHOT.jar

USAGE

The application will need a database to function here we are using MYSQL as described in property file, you may use PostgreSQL, H2 or any suitable DB.

Database name cvss

Allows function to Create, Read, Update and Delete (CRUD access) to entities such as: institutes,certificates and payments. With paging and sort capabilities.

curl -v localhost:8080

Returns self documented REST APIs

{
  "_links" : {
    "institutes" : {
      "href" : "http://localhost:8080/institutes{?page,size,sort}",
      "templated" : true
    },
    "certificates" : {
      "href" : "http://localhost:8080/certificates{?page,size,sort}",
      "templated" : true
    },
    "payments" : {
      "href" : "http://localhost:8080/payments{?page,size,sort}",
      "templated" : true
    },
    "profile" : {
      "href" : "http://localhost:8080/profile"
    }
  }
}

To get a specific self documented endpoints including its params

curl -v localhost:8080/profile/certificates

* Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /profile/certificates HTTP/1.1
> Host: localhost
> User-Agent: curl/8.4.0
> Accept: */*
> 
< HTTP/1.1 200 
< Vary: Origin
< Vary: Access-Control-Request-Method
< Vary: Access-Control-Request-Headers
< Content-Type: application/alps+json
< Transfer-Encoding: chunked
< Date: Fri, 02 Feb 2024 08:29:10 GMT
< 
{
  "alps" : {
    "version" : "1.0",
    "descriptor" : [ {
      "id" : "certificate-representation",
      "href" : "http://localhost/profile/certificates",
      "descriptor" : [ {
        "name" : "name",
        "type" : "SEMANTIC"
      }, {
        "name" : "certificateId",
        "type" : "SEMANTIC"
      }, {
        "name" : "date",
        "type" : "SEMANTIC"
      }, {
        "name" : "action",
        "type" : "SEMANTIC"
      }, {
        "name" : "description",
        "type" : "SEMANTIC"
      }, {
        "name" : "institute",
        "type" : "SEMANTIC"
      } ]
    }, {
      "id" : "get-certificates",
      "name" : "certificates",
      "type" : "SAFE",
      "descriptor" : [ {
        "name" : "page",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The page to return."
        }
      }, {
        "name" : "size",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The size of the page to return."
        }
      }, {
        "name" : "sort",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The sorting criteria to use to calculate the content of the page."
        }
      } ],
      "rt" : "#certificate-representation"
    }, {
      "id" : "create-certificates",
      "name" : "certificates",
      "type" : "UNSAFE",
      "descriptor" : [ ],
      "rt" : "#certificate-representation"
    }, {
      "id" : "get-certificate",
      "name" : "certificate",
      "type" : "SAFE",
      "descriptor" : [ ],
      "rt" : "#certificate-representation"
    }, {
      "id" : "update-certificate",
      "name" : "certificate",
      "type" : "IDEMPOTENT",
      "descriptor" : [ ],
      "rt" : "#certificate-representation"
    }, {
      "id" : "patch-certificate",
      "name" : "certificate",
      "type" : "UNSAFE",
      "descriptor" : [ ],
      "rt" : "#certificate-representation"
    }, {
      "id" : "delete-certificate",
      "name" : "certificate",
      "type" : "IDEMPOTENT",
      "descriptor" : [ ],
      "rt" : "#certificate-representation"
    } ]
  }
* Connection #0 to host localhost left intact

Property list

https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html

Example server.port=80

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages