Skip to content

Commit 27dedc6

Browse files
authored
Merge pull request #19 from contentstack/fix/sre
fixed snyk issue, liscence updated and added release workflow along with security md
2 parents cbd463c + 8d1c81a commit 27dedc6

File tree

4 files changed

+83
-1
lines changed

4 files changed

+83
-1
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build:
8+
name: Build and upload
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3.5.3
13+
with:
14+
fetch-depth: 0
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3.7.0
17+
with:
18+
node-version: "18.x"
19+
- name: Install dependencies
20+
run: npm install
21+
- name: Upload dist
22+
uses: actions/upload-artifact@v3.1.2
23+
with:
24+
name: lib
25+
path: lib
26+
27+
release:
28+
name: Download dist and release
29+
runs-on: ubuntu-latest
30+
needs: build
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3.5.3
34+
with:
35+
fetch-depth: 0
36+
- name: Download dist
37+
uses: actions/download-artifact@v3
38+
with:
39+
name: lib
40+
path: lib
41+
- name: Display directories
42+
run: ls -R lib
43+
- name: Publish to npm
44+
id: release-plugin
45+
uses: JS-DevTools/npm-publish@v2.2.0
46+
with:
47+
token: ${{ secrets.NPM_TOKEN }}
48+
- name: Create GitHub release
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
run: gh release create v${{ steps.release-plugin.outputs.version }} --title "Release ${{ steps.release-plugin.outputs.version }}" --generate-notes

LICENSE.txt renamed to LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018 Contentstack
3+
Copyright (c) 2024 Contentstack
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

SECURITY.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Security
2+
3+
Contentstack takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.
4+
5+
If you believe you have found a security vulnerability in any Contentstack-owned repository, please report it to us as described below.
6+
7+
## Reporting Security Issues
8+
9+
**Please do not report security vulnerabilities through public GitHub issues.**
10+
11+
Send email to [security@contentstack.com](mailto:security@contentstack.com).
12+
13+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
14+
15+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
16+
17+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
18+
- Full paths of source file(s) related to the manifestation of the issue
19+
- The location of the affected source code (tag/branch/commit or direct URL)
20+
- Any special configuration required to reproduce the issue
21+
- Step-by-step instructions to reproduce the issue
22+
- Proof-of-concept or exploit code (if possible)
23+
- Impact of the issue, including how an attacker might exploit the issue
24+
25+
This information will help us triage your report more quickly.
26+
27+
[https://www.contentstack.com/trust/](https://www.contentstack.com/trust/)

lib/request.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ var makeCall = module.exports = function(req, cb, RETRY) {
4848
return cb(new Error('Max retry limit exceeded!'));
4949
}
5050
debug(`Requesting API\n${JSON.stringify(req, null, 2)}`);
51+
//NOTE: Please delete the below three lines in case the code breaks :)
52+
let tempObj = Object.create(null);
53+
merge(tempObj,req);
54+
req = tempObj;
5155
return request(req, function(err, response, body) {
5256
if (err) {
5357
return cb(err);

0 commit comments

Comments
 (0)