
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
gitlab-restapi
Advanced tools
The module allows you to perform the list of methods described in the GitLab service documentation in the section Jobs , Pipelines ( for now)
And you can Add your own method that is not yet implemented by this api
And yes, let's start!
First install Node.js
npm i gitlab-restapi
const GitLab = require("gitlab-restapi");
const gitLab = new GitLab.API(new GitLab.Options({
privateToken: process.env.GIT_TOKEN,
projectId: process.env.GIT_PID,
}));
const jobs = await gitLab.Jobs.jobs(
new GitLab.PaginateParams({
page: 1, per_page: 100, scope: ['success', 'failed']
}));
// find first(last executed) Job by name
const job = jobs.find({name: 'testofclasses'});
console.log(job.status)
GitLab.Options can specify your method for fetching data. For nodes 18+ - this is the own node fetch (by default), for younger versions (unless otherwise specified) - the internal mechanism
new GitLab.Options({
privateToken: process.env.GIT_TOKEN,
projectId: process.env.GIT_PID,
fetchMethod: fetch // axios, fetch, node-fetch, GitLab.Request (tested)
})
const GitLab = require("gitlab-restapi");
const gitLab = new GitLab.API(new GitLab.Options({
privateToken: process.env.GIT_TOKEN,
projectId: process.env.GIT_PID,
fetchMethod: fetch // axios, fetch, node-fetch, GitLab.Request (tested)
}));
console.log(gitLab.Jobs.methods)
// list of registered APIs
console.log(gitLab.getOwnPropertyNames())
Get a single job of a project
const jobs = await gitLab.Jobs.jobs(
new GitLab.PaginateParams({page: 1, per_page: 1, scope: ['success']}));
// const jobs = await gitLab.Jobs.jobs(new GitLab.PaginateParams({})); // page: 1, per_page: 20, all scopes
// const jobs = await gitLab.Jobs.jobs(); // page: 1, per_page: 20, all scopes
console.log('jobs:', jobs.list)
const _job = jobs.find({status: 'success'});
console.log('found:', _job)
const job = await gitLab.Jobs.job(_job.id);
console.log('Get a single job of a project by id:', job)
Erase a single job of a project (remove job artifacts and a job log)
const jobs = await gitLab.Jobs.jobs(new GitLab.PaginateParams({
page: 1,
per_page: 100,
scope: ['failed', 'canceled']
}));
const erasedJobs = new GitLab.Jobs([])
for (let job of jobs.list) {
if (job.artifacts && job.artifacts.length) {
const obj = await gitLab.Jobs.erase(job.id);
if (obj) erasedJobs.push(obj)
}
}
console.log(erasedJobs.list)
const pipelinelatest = await gitLab.Pipelines.latest();
console.log(pipelinelatest)
const pipelines = await gitLab.Pipelines.pipelines(new GitLab.PaginateParams({
page: 1, per_page: 20, status: 'success', source: 'push',}));
console.log(pipelines.list)
Add your own method that is not yet implemented by this api
gitLab.add('MyGroups').addMethods({
groups: new GitLab.Method({method: 'get', class: GitLab.Responses,
url: () => `groups`})
})
console.log(gitLab.MyGroups.methods)
const groups = await gitLab.MyGroups.groups(
new GitLab.PaginateParams({page: 2, per_page: 20}));
console.log(groups.list)
gitLab.add('MyReleases').addMethods({
releases: new GitLab.Method({method: 'get', class: GitLab.Responses,
url: () => `projects/${gitLab.projectId}/releases`})
})
console.log(gitLab.MyReleases.methods)
const releases = await gitLab.MyReleases.releases(new GitLab.PaginateParams({page: 2, per_page: 20}));
console.log(releases.list)
Thanks for your attention - the continuation of the api will come soon
FAQs
Integration with GitLab REST API
The npm package gitlab-restapi receives a total of 615 weekly downloads. As such, gitlab-restapi popularity was classified as not popular.
We found that gitlab-restapi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.