Skip to content

Commit 0d36986

Browse files
authored
fix: fix Inefficient regular expression, add security file and configure sonar cloud (#55)
* fix: potential fix for code scanning alert no. 3: Inefficient regular expression * chore: fix regular expression * chore: implement 'isValidHostname' for hostname validation * docs: generate api doc for isValidHostname * chore: add security file and configure sonar cloud * chore: allow sonar to exclude .spec.ts file in the test coverage --------- Co-authored-by: Mr Stone <pierre.evens16@gmail.com>
1 parent 935109c commit 0d36986

File tree

168 files changed

+938
-750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+938
-750
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1820
- name: Setup Node.js
1921
uses: actions/setup-node@v4
2022
with:
@@ -32,6 +34,10 @@ jobs:
3234
with:
3335
token: ${{ secrets.CODECOV_TOKEN }}
3436
slug: stonemjs/http-core
37+
- name: SonarQube Scan
38+
uses: SonarSource/sonarqube-scan-action@v5
39+
env:
40+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3541

3642
release-please:
3743
runs-on: ubuntu-latest

.github/workflows/pr.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
branches:
66
- main
7+
types: [opened, synchronize, reopened]
78

89
permissions:
910
contents: read
@@ -14,6 +15,8 @@ jobs:
1415
steps:
1516
- name: Checkout code
1617
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1720
- name: Setup Node.js
1821
uses: actions/setup-node@v4
1922
with:
@@ -25,4 +28,8 @@ jobs:
2528
- name: Run tests
2629
run: npm run test:cvg
2730
- name: Build library
28-
run: npm run build
31+
run: npm run build
32+
- name: SonarQube Scan
33+
uses: SonarSource/sonarqube-scan-action@v5
34+
env:
35+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,5 @@ pnpm-debug.log*
7676
*.sln
7777
*.sw?
7878

79-
# Index
80-
index.html
81-
82-
# Examples
83-
examples/
84-
85-
README_docs.md
79+
# SonarLint (VSCode)
80+
.sonarlint/

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
![Maintenance](https://img.shields.io/maintenance/yes/2025)
77
[![Build Status](https://github.com/stonemjs/http-core/actions/workflows/main.yml/badge.svg)](https://github.com/stonemjs/http-core/actions/workflows/main.yml)
88
[![Publish Package to npmjs](https://github.com/stonemjs/http-core/actions/workflows/release.yml/badge.svg)](https://github.com/stonemjs/http-core/actions/workflows/release.yml)
9+
[![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=stonemjs_http-core)](https://sonarcloud.io/summary/new_code?id=stonemjs_http-core)
910
[![codecov](https://codecov.io/gh/stonemjs/http-core/graph/badge.svg?token=5MKS9179YL)](https://codecov.io/gh/stonemjs/http-core)
11+
[![Security Policy](https://img.shields.io/badge/Security-Policy-blue.svg)](./SECURITY.md)
1012
[![CodeQL](https://github.com/stonemjs/http-core/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/stonemjs/http-core/security/code-scanning)
1113
[![Dependabot Status](https://img.shields.io/badge/Dependabot-enabled-brightgreen.svg)](https://github.com/stonemjs/http-core/network/updates)
1214
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

SECURITY.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Security Policy
2+
3+
Thank you for your interest in the security of Stone.js. We take the security of our framework and its users seriously.
4+
This document outlines the process for reporting vulnerabilities and our commitment to secure development.
5+
6+
## Supported Versions
7+
8+
We actively maintain and patch the latest stable release of Stone.js and its core packages.
9+
10+
| Version | Status |
11+
| --------- | ---------------------------------- |
12+
| `1.x` | ✅ Actively maintained |
13+
| `< 1.0.0` | ⚠️ Legacy, no guaranteed patches |
14+
15+
If you're using an older version and encounter a security issue, we encourage you to upgrade to the latest release.
16+
17+
## Reporting a Vulnerability
18+
19+
If you discover a security vulnerability in Stone.js or any of its official packages, **please report it responsibly and privately**.
20+
21+
### How to report
22+
23+
- Email: **security@stonejs.com**
24+
- Subject: `Security Issue: [Your short description]`
25+
- Include:
26+
- A detailed description of the vulnerability
27+
- Steps to reproduce (if applicable)
28+
- A suggested fix or patch (optional but appreciated)
29+
- Affected versions and environments
30+
31+
We will respond within **5 working days** and aim to provide a fix or mitigation within **30 days**, depending on severity.
32+
33+
## Our Commitment
34+
35+
We commit to:
36+
37+
- Promptly investigate and validate reports
38+
- Keep reporters informed of the resolution progress
39+
- Publicly disclose confirmed vulnerabilities **after a fix is available**, with appropriate credit (unless anonymity is requested)
40+
- Maintain secure coding standards and regular dependency audits using:
41+
- [GitHub CodeQL](https://codeql.github.com/)
42+
- [Dependabot](https://github.com/dependabot)
43+
44+
## Disclosure Policy
45+
46+
We follow a **coordinated disclosure** policy:
47+
48+
- Vulnerabilities are not published until a fix is available.
49+
- CVE identifiers will be requested when applicable.
50+
- Security-related changes are clearly documented in release notes and changelogs.
51+
52+
## Acknowledgements
53+
54+
We deeply appreciate the responsible security researchers and users who help keep Stone.js secure.
55+
56+
If you’d like to contribute to security audits, penetration testing, or analysis of Stone.js internals, feel free to reach out via [security@stonejs.com](mailto:security@stonejs.com).
57+
58+
## Thank You
59+
60+
Security is a shared responsibility, thank you for helping make Stone.js safer for everyone.
61+
62+
— The Stone.js Team

0 commit comments

Comments
 (0)