ffc-pay-event-publisher 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ name: Secret Scanner
2
+
3
+ on:
4
+ workflow_call:
5
+ push:
6
+ branches:
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - main
11
+ types:
12
+ - opened # PR created
13
+ - synchronize # new commits pushed to an existing PR
14
+ - reopened # PR reopened after being closed
15
+
16
+ jobs:
17
+ secret-scan:
18
+ uses: DEFRA/ffc-shared-actions/.github/workflows/secret-scanner.yml@main
19
+ secrets: inherit
package/.gitleaks.toml ADDED
@@ -0,0 +1,18 @@
1
+ # ffc-pay-event-publisher/.gitleaks.toml
2
+ title = "ffc-pay-event-publisher"
3
+
4
+ [extend]
5
+ path = ".gitleaks-shared/.gitleaks.toml"
6
+
7
+ # Service-specific additions only below this line, use [[ ]] for multiple allowlist instances
8
+ [allowlist]
9
+ description = "Service-specific exclusions"
10
+ paths = [
11
+ '''test/mock-objects/.*''',
12
+ '''test/mock-modules/.*''',
13
+ '''test/unit/.*'''
14
+ ]
15
+
16
+ #enter regex here wrapped in triple ''' to exclude specific keys
17
+ #regexes = [
18
+ #]
File without changes
@@ -0,0 +1,30 @@
1
+ #!/bin/sh
2
+
3
+ GITLEAKS_VERSION="8.30.0"
4
+ GITLEAKS_BIN="$HOME/.local/bin/gitleaks"
5
+ GITLEAKS_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
6
+
7
+ # get installed version (if any)
8
+ INSTALLED_VERSION=""
9
+ if [ -x "$GITLEAKS_BIN" ]; then
10
+ INSTALLED_VERSION=$("$GITLEAKS_BIN" --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || true)
11
+ fi
12
+
13
+ if [ "$INSTALLED_VERSION" != "$GITLEAKS_VERSION" ]; then
14
+ echo "⚠️ Installing/updating gitleaks v${GITLEAKS_VERSION} (was: ${INSTALLED_VERSION:-none})..."
15
+ mkdir -p "$HOME/.local/bin"
16
+ curl -sSfL "$GITLEAKS_URL" | tar -xz -C "$HOME/.local/bin" gitleaks
17
+ chmod +x "$GITLEAKS_BIN"
18
+ fi
19
+
20
+ # Always fetch latest shared gitleaks config
21
+ echo "Fetching shared gitleaks config..."
22
+ mkdir -p .gitleaks-shared
23
+ if ! curl -sSfL https://raw.githubusercontent.com/DEFRA/ffc-shared-actions/main/.gitleaks.toml \
24
+ -o .gitleaks-shared/.gitleaks.toml; then
25
+ echo "❌ Failed to fetch shared gitleaks config from ffc-shared-actions." >&2
26
+ exit 1
27
+ fi
28
+
29
+ echo "🔍 Running gitleaks scan..."
30
+ "$GITLEAKS_BIN" protect --staged --config .gitleaks.toml --verbose --exit-code=2
package/.npmignore CHANGED
@@ -2,4 +2,6 @@ test-output
2
2
  node_modules
3
3
  helm/**/*.lock
4
4
  *.tgz
5
- .vscode
5
+ .vscode
6
+
7
+ .gitleaks-shared/
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "ffc-pay-event-publisher",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "ffc-pay-event-publisher",
9
- "version": "1.2.2",
9
+ "version": "1.2.4",
10
10
  "license": "OGL-UK-3.0",
11
11
  "dependencies": {
12
12
  "ffc-messaging": "2.10.5",
@@ -15,6 +15,7 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "eslint": "9.39.1",
18
+ "husky": "9.1.7",
18
19
  "jest": "29.7.0",
19
20
  "jest-junit": "14.0.0",
20
21
  "neostandard": "0.12.2"
@@ -4688,6 +4689,22 @@
4688
4689
  "node": ">=10.17.0"
4689
4690
  }
4690
4691
  },
4692
+ "node_modules/husky": {
4693
+ "version": "9.1.7",
4694
+ "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
4695
+ "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
4696
+ "dev": true,
4697
+ "license": "MIT",
4698
+ "bin": {
4699
+ "husky": "bin.js"
4700
+ },
4701
+ "engines": {
4702
+ "node": ">=18"
4703
+ },
4704
+ "funding": {
4705
+ "url": "https://github.com/sponsors/typicode"
4706
+ }
4707
+ },
4691
4708
  "node_modules/ieee754": {
4692
4709
  "version": "1.2.1",
4693
4710
  "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
@@ -11535,6 +11552,12 @@
11535
11552
  "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
11536
11553
  "dev": true
11537
11554
  },
11555
+ "husky": {
11556
+ "version": "9.1.7",
11557
+ "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
11558
+ "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
11559
+ "dev": true
11560
+ },
11538
11561
  "ieee754": {
11539
11562
  "version": "1.2.1",
11540
11563
  "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffc-pay-event-publisher",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Event sending npm module for FFC pay services",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -11,7 +11,8 @@
11
11
  "scripts": {
12
12
  "test": "jest --runInBand --forceExit",
13
13
  "test:unit": "PORT=0 node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPatterns=test/unit",
14
- "test:watch": "jest --coverage=false --onlyChanged --watch --runInBand"
14
+ "test:watch": "jest --coverage=false --onlyChanged --watch --runInBand",
15
+ "prepare": "node --eval \"const fs=require('fs'),cp=require('child_process');if(fs.existsSync('.git')&&!process.env.CI&&!process.env.TF_BUILD)cp.execSync('husky',{stdio:'inherit'})\""
15
16
  },
16
17
  "contributors": [
17
18
  "Simon Dunn simon.dunn1@rpa.gov.uk",
@@ -32,6 +33,7 @@
32
33
  },
33
34
  "devDependencies": {
34
35
  "eslint": "9.39.1",
36
+ "husky": "9.1.7",
35
37
  "jest": "29.7.0",
36
38
  "jest-junit": "14.0.0",
37
39
  "neostandard": "0.12.2"