Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: vulnerability findings API support #517

Merged
merged 3 commits into from
Dec 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//.npmrc
registry=https://registry.npmjs.org
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ Runners
Services
Tags
Triggers
VulnerabilityFindings

// Users
Users
Expand Down Expand Up @@ -300,6 +301,7 @@ Services
Tags
Todos
Triggers
VulnerabilityFindings
```

2. UsersBundle which includes:
Expand Down Expand Up @@ -492,7 +494,7 @@ If your Gitlab server is running via HTTPS, the proper way to pass in your certi
For responses such as file data that may be returned from the API, the data is exposed as a buffer. For example, when trying to write a file, this can be done like:

```javascript
let bufferedData = await api.Jobs.downloadLatestArtifactFile(project.id, "test", "job_test);
let bufferedData = await api.Jobs.downloadLatestArtifactFile(project.id, "test", "job_test");

fs.writeFileSync("test.zip", bufferedData);

Expand Down
1 change: 1 addition & 0 deletions src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const ProjectsBundle = bundler({
Services: APIServices.Services,
Tags: APIServices.Tags,
Triggers: APIServices.Triggers,
VulnerabilityFindings: APIServices.VulnerabilityFindings,
});

// All initialized
Expand Down
19 changes: 19 additions & 0 deletions src/core/services/VulnerabilityFindings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { BaseService, PaginatedRequestOptions, RequestHelper } from '../infrastructure';

export class VulnerabilityFindings extends BaseService {
all(
projectId: string | number,
options?: {
id: string | number;
reportType: string[];
scope: string;
severity: string[];
confidence: string[];
pipelineId: string | number;
} & PaginatedRequestOptions,
) {
const pId = encodeURIComponent(projectId);

return RequestHelper.get(this, `projects/${pId}/vulnerability_findings`, options);
}
}
1 change: 1 addition & 0 deletions src/core/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export * from './Services';
export * from './Tags';
export * from './Todos';
export * from './Triggers';
export * from './VulnerabilityFindings';

// General
export * from './ApplicationSettings';
Expand Down