API reference

Automatically generated from LPVS OpenAPI v3.0.0


LPVS API v2-20231228

License Pre-Validation Service (LPVS) is a tool designed to proactively manage license-related risks in Open Source code. It conducts in-depth analysis of your project, meticulously identifying components and their associated licenses with every commit. LPVS empowers your development workflow by ensuring compliance and providing insights into licensing aspects, enhancing the overall health and robustness of your software projects.


License: MIT

GitHub Webhooks API


POST /webhooks

Start Scan

Description

Endpoint for handling GitHub webhook events and processing the payload.

Input parameters

Parameter In Type Default Nullable Description
X-Hub-Signature-256 header string No

Request body

{
    "action": "opened",
    "repository": {
        "name": "LPVS",
        "full_name": "Samsung/LPVS",
        "html_url": "https://github.com/Samsung/LPVS"
    },
    "pull_request": {
        "html_url": "https://github.com/Samsung/LPVS/pull/18",
        "head": {
            "repo": {
                "fork": "true",
                "html_url": "https://github.com/Samsung/LPVS/tree/utests"
            },
            "sha": "edde69ecb8e8a88dde09fa9789e2c9cab7cf7cf9",
            "ref": "Samsung:utests"
        },
        "url": "https://api.github.com/repos/Samsung/LPVS/pulls/18"
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "action": {
            "type": "string",
            "example": "opened"
        },
        "repository": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "example": "LPVS"
                },
                "full_name": {
                    "type": "string",
                    "example": "Samsung/LPVS"
                },
                "html_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://github.com/Samsung/LPVS"
                }
            }
        },
        "pull_request": {
            "type": "object",
            "properties": {
                "html_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://github.com/Samsung/LPVS/pull/18"
                },
                "head": {
                    "type": "object",
                    "properties": {
                        "repo": {
                            "type": "object",
                            "properties": {
                                "fork": {
                                    "type": "string",
                                    "example": "true"
                                },
                                "html_url": {
                                    "type": "string",
                                    "format": "uri",
                                    "example": "https://github.com/Samsung/LPVS/tree/utests"
                                }
                            }
                        },
                        "sha": {
                            "type": "string",
                            "example": "edde69ecb8e8a88dde09fa9789e2c9cab7cf7cf9"
                        },
                        "ref": {
                            "type": "string",
                            "example": "Samsung:utests"
                        }
                    }
                },
                "url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://api.github.com/repos/Samsung/LPVS/pulls/18"
                }
            }
        }
    }
}

Response 200 OK

{
    "message": "Success"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "message": {
            "type": "string",
            "format": "uuid",
            "example": "Success"
        }
    }
}

Response 403 Forbidden

{
    "message": "Error"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "message": {
            "type": "string",
            "format": "uuid",
            "example": "Error"
        }
    }
}

POST /

Forward to Start Scan

Description

Forwards the request to the /webhooks endpoint.

Request body

{
    "action": "opened",
    "repository": {
        "name": "LPVS",
        "full_name": "Samsung/LPVS",
        "html_url": "https://github.com/Samsung/LPVS"
    },
    "pull_request": {
        "html_url": "https://github.com/Samsung/LPVS/pull/18",
        "head": {
            "repo": {
                "fork": "true",
                "html_url": "https://github.com/Samsung/LPVS/tree/utests"
            },
            "sha": "edde69ecb8e8a88dde09fa9789e2c9cab7cf7cf9",
            "ref": "Samsung:utests"
        },
        "url": "https://api.github.com/repos/Samsung/LPVS/pulls/18"
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "action": {
            "type": "string",
            "example": "opened"
        },
        "repository": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "example": "LPVS"
                },
                "full_name": {
                    "type": "string",
                    "example": "Samsung/LPVS"
                },
                "html_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://github.com/Samsung/LPVS"
                }
            }
        },
        "pull_request": {
            "type": "object",
            "properties": {
                "html_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://github.com/Samsung/LPVS/pull/18"
                },
                "head": {
                    "type": "object",
                    "properties": {
                        "repo": {
                            "type": "object",
                            "properties": {
                                "fork": {
                                    "type": "string",
                                    "example": "true"
                                },
                                "html_url": {
                                    "type": "string",
                                    "format": "uri",
                                    "example": "https://github.com/Samsung/LPVS/tree/utests"
                                }
                            }
                        },
                        "sha": {
                            "type": "string",
                            "example": "edde69ecb8e8a88dde09fa9789e2c9cab7cf7cf9"
                        },
                        "ref": {
                            "type": "string",
                            "example": "Samsung:utests"
                        }
                    }
                },
                "url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://api.github.com/repos/Samsung/LPVS/pulls/18"
                }
            }
        }
    }
}

Response 200 OK

{
    "message": "Success"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "message": {
            "type": "string",
            "format": "uuid",
            "example": "Success"
        }
    }
}

Response 403 Forbidden

{
    "message": "Error"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "message": {
            "type": "string",
            "format": "uuid",
            "example": "Error"
        }
    }
}

GitHub Pull Request Single Scan API


POST /scan/{gitHubOrg}/{gitHubRepo}/{prNumber}

GitHub Pull Request Single Scan

Description

Endpoint for performing a single scan operation based on GitHub organization, repository, and pull request number.

Input parameters

Parameter In Type Default Nullable Description
gitHubOrg path string No GitHub organization name
gitHubRepo path string No GitHub repository name
prNumber path integer No Pull request number

Response 200 OK

{
    "message": "Success"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "message": {
            "type": "string",
            "format": "uuid",
            "example": "Success"
        }
    }
}

Response 403 Forbidden

{
    "message": "Error"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "message": {
            "type": "string",
            "format": "uuid",
            "example": "Error"
        }
    }
}

Web API


GET /api/v1/web/user/login

User Login

Description

Retrieves login details for the authenticated user.

Response 200 OK

{
    "isLoggedIn": true,
    "member": {
        "id": 1,
        "name": "John Doe",
        "email": "john.doe@example.com",
        "provider": "GitHub",
        "nickname": "johndoe",
        "organization": "Acme Corp"
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "isLoggedIn": {
            "type": "boolean",
            "description": "Indicates whether the member is logged in or not",
            "example": true
        },
        "member": {
            "$ref": "#/components/schemas/LPVSMember"
        }
    }
}

Response 401 Unauthorized

Response 500 Internal Server Error


GET /api/v1/web/user/info

Retrieve User Information

Description

Retrieves personal information settings for the authenticated user.

Response 200 OK

{
    "id": 1,
    "name": "John Doe",
    "email": "john.doe@example.com",
    "provider": "GitHub",
    "nickname": "johndoe",
    "organization": "Acme Corp"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "id": {
            "type": "integer",
            "description": "The unique identifier of the member",
            "example": 1
        },
        "name": {
            "type": "string",
            "description": "The name of the member",
            "example": "John Doe"
        },
        "email": {
            "type": "string",
            "format": "email",
            "description": "The email address of the member",
            "example": "john.doe@example.com"
        },
        "provider": {
            "type": "string",
            "description": "The provider associated with the member",
            "example": "GitHub"
        },
        "nickname": {
            "type": "string",
            "description": "The nickname of the member",
            "example": "johndoe"
        },
        "organization": {
            "type": "string",
            "description": "The organization associated with the member",
            "example": "Acme Corp"
        }
    }
}

Response 401 Unauthorized

Response 500 Internal Server Error


POST /api/v1/web/user/update

Update User Settings

Description

Updates user settings based on the provided data in the request body.

Request body

{
    "nickname": "string",
    "organization": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "nickname": {
            "type": "string",
            "description": "User's new nickname"
        },
        "organization": {
            "type": "string",
            "description": "User's new organization"
        }
    }
}

Response 200 OK

{
    "id": 1,
    "name": "John Doe",
    "email": "john.doe@example.com",
    "provider": "GitHub",
    "nickname": "johndoe",
    "organization": "Acme Corp"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "id": {
            "type": "integer",
            "description": "The unique identifier of the member",
            "example": 1
        },
        "name": {
            "type": "string",
            "description": "The name of the member",
            "example": "John Doe"
        },
        "email": {
            "type": "string",
            "format": "email",
            "description": "The email address of the member",
            "example": "john.doe@example.com"
        },
        "provider": {
            "type": "string",
            "description": "The provider associated with the member",
            "example": "GitHub"
        },
        "nickname": {
            "type": "string",
            "description": "The nickname of the member",
            "example": "johndoe"
        },
        "organization": {
            "type": "string",
            "description": "The organization associated with the member",
            "example": "Acme Corp"
        }
    }
}

Response 401 Unauthorized

Response 500 Internal Server Error


GET /api/v1/web/history/{type}/{name}

Retrieve History Page Entity

Description

Retrieves the history page entity based on the specified type and name.

Input parameters

Parameter In Type Default Nullable Description
name path string No The name of the user or organization.
pageable query None No The pageable object for pagination.
type path string No The type of history (e.g., "own", "org", "send").

Response 200 OK

{
    "lpvsHistories": [
        {
            "scanDate": "2023-01-01",
            "repositoryName": "example-repo",
            "pullRequestId": 123,
            "url": "https://example.com/pull/123",
            "status": "pending",
            "sender": "JohnDoe",
            "pullNumber": "pull/123",
            "hasIssue": true
        }
    ],
    "count": 10
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "lpvsHistories": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/LPVSHistory"
            },
            "description": "List of LPVSHistory entries"
        },
        "count": {
            "type": "integer",
            "description": "The count of history entries",
            "example": 10
        }
    }
}

Response 401 Unauthorized

Response 500 Internal Server Error


GET /api/v1/web/result/{prId}

Retrieve LPVSResult for Pull Request

Description

Retrieves the LPVSResult for a specific pull request ID.

Input parameters

Parameter In Type Default Nullable Description
pageable query None No The pageable object for pagination.
prId path number No The pull request ID.

Response 200 OK

{
    "lpvsResultFileList": [
        {
            "id": 1,
            "path": "src/main/java/Example.java",
            "componentFileUrl": "https://example.com/file/1",
            "matchLine": "42",
            "matchValue": "Snippet",
            "status": "license.PERMITTED",
            "licenseSpdx": "MIT"
        }
    ],
    "lpvsResultInfo": {
        "id": 1,
        "scanDate": "2023-01-01T12:00:00Z",
        "repositoryName": "example-repo",
        "status": "pending",
        "detectedLicenses": [
            "string"
        ]
    },
    "count": 10,
    "licenseCountMap": {
        "MIT": 3,
        "Apache-2.0": 2
    },
    "pullNumber": "pull/123",
    "hasIssue": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "lpvsResultFileList": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/LPVSResultFile"
            },
            "description": "List of LPVSResultFile entries"
        },
        "lpvsResultInfo": {
            "$ref": "#/components/schemas/LPVSResultInfo"
        },
        "count": {
            "type": "integer",
            "description": "The count of results",
            "example": 10
        },
        "licenseCountMap": {
            "type": "object",
            "additionalProperties": {
                "type": "integer"
            },
            "description": "Map of license counts",
            "example": {
                "MIT": 3,
                "Apache-2.0": 2
            }
        },
        "pullNumber": {
            "type": "string",
            "description": "The pull request number",
            "example": "pull/123"
        },
        "hasIssue": {
            "type": "boolean",
            "description": "Indicates whether the result has an issue or not",
            "example": true
        }
    }
}

Response 401 Unauthorized

Response 500 Internal Server Error


GET /api/v1/web/dashboard/{type}/{name}

Retrieve Dashboard Entity

Description

Retrieves the Dashboard entity based on the specified type and name.

Input parameters

Parameter In Type Default Nullable Description
name path string No The name of the user or organization.
type path string No The type of the dashboard (e.g., user, organization).

Response 200 OK

{
    "name": "john-doe",
    "licenseCountMap": {
        "MIT": 3,
        "Apache-2.0": 2
    },
    "totalDetectionCount": 100,
    "highSimilarityCount": 20,
    "totalIssueCount": 5,
    "totalParticipantsCount": 50,
    "totalRepositoryCount": 10,
    "dashboardElementsByDates": [
        {
            "date": "2023-01-01",
            "participantCount": 5,
            "pullRequestCount": 10,
            "riskGradeMap": {
                "SERIOUS": 2,
                "HIGH": 3,
                "MIDDLE": 5,
                "LOW": 8,
                "NONE": 2
            }
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name of the user or organization",
            "example": "john-doe"
        },
        "licenseCountMap": {
            "type": "object",
            "additionalProperties": {
                "type": "integer"
            },
            "description": "Map of license counts",
            "example": {
                "MIT": 3,
                "Apache-2.0": 2
            }
        },
        "totalDetectionCount": {
            "type": "integer",
            "description": "The total number of detections",
            "example": 100
        },
        "highSimilarityCount": {
            "type": "integer",
            "description": "The count of high similarity detections",
            "example": 20
        },
        "totalIssueCount": {
            "type": "integer",
            "description": "The total number of issues",
            "example": 5
        },
        "totalParticipantsCount": {
            "type": "integer",
            "description": "The total number of participants",
            "example": 50
        },
        "totalRepositoryCount": {
            "type": "integer",
            "description": "The total number of repositories",
            "example": 10
        },
        "dashboardElementsByDates": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/DashboardElementsByDate"
            },
            "description": "List of DashboardElementsByDate entries"
        }
    }
}

Response 401 Unauthorized

Response 500 Internal Server Error


Schemas

Dashboard

Name Type
dashboardElementsByDates Array<DashboardElementsByDate>
highSimilarityCount integer
licenseCountMap Example: {'MIT': 3, 'Apache-2.0': 2}
name string
totalDetectionCount integer
totalIssueCount integer
totalParticipantsCount integer
totalRepositoryCount integer

DashboardElementsByDate

Name Type
date string(date)
participantCount integer
pullRequestCount integer
riskGradeMap Example: {'SERIOUS': 2, 'HIGH': 3, 'MIDDLE': 5, 'LOW': 8, 'NONE': 2}

HistoryEntity

Name Type
count integer
lpvsHistories Array<LPVSHistory>

LPVSHistory

Name Type
hasIssue boolean
pullNumber string
pullRequestId integer
repositoryName string
scanDate string
sender string
status string
url string(uri)

LPVSLoginMember

Name Type
isLoggedIn boolean
member LPVSMember

LPVSMember

Name Type
email string()
id integer
name string
nickname string
organization string
provider string

LPVSResult

Name Type
count integer
hasIssue boolean
licenseCountMap Example: {'MIT': 3, 'Apache-2.0': 2}
lpvsResultFileList Array<LPVSResultFile>
lpvsResultInfo LPVSResultInfo
pullNumber string

LPVSResultFile

Name Type
componentFileUrl string(uri)
id integer
licenseSpdx string
matchLine string
matchValue string
path string
status string

LPVSResultInfo

Name Type
detectedLicenses Array<string>
id integer
repositoryName string
scanDate string(date-time)
status string

Pageable

Name Type
direction string
page integer
size integer
sort string

UserUpdateRequest

Name Type
nickname string
organization string

WebhookRequest

Name Type
action string
pull_request Properties: html_url, head, url
repository Properties: name, full_name, html_url

WebhookResponseForbidden

Name Type
message string(uuid)

WebhookResponseOK

Name Type
message string(uuid)