fix: resolve CI lint failures across frontend and Go projects
Node.js bumped to 22 in lint workflow (pnpm 11.x requires >=22.13). Extract goconst-flagged string literals in secrets-scanner to named constants. Carry along monitor-dashboard docker/package fixes.
This commit is contained in:
parent
ca8382482b
commit
adeec9b36d
|
|
@ -123,7 +123,7 @@ jobs:
|
|||
if: matrix.type == 'biome'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
node-version: '22'
|
||||
|
||||
- name: Setup pnpm
|
||||
if: matrix.type == 'biome'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
FROM node:24-alpine
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
RUN corepack enable && corepack prepare pnpm@10.29.1 --activate
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
FROM node:24-alpine AS build
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
RUN corepack enable && corepack prepare pnpm@10.29.1 --activate
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY frontend/package.json frontend/pnpm-lock.yaml* ./
|
||||
COPY frontend/package.json frontend/pnpm-lock.yaml* frontend/.npmrc* ./
|
||||
|
||||
RUN pnpm install --frozen-lockfile || pnpm install
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
strict-dep-builds=false
|
||||
|
|
@ -59,6 +59,10 @@
|
|||
"pnpm": {
|
||||
"overrides": {
|
||||
"vite": "npm:rolldown-vite@7.2.5"
|
||||
}
|
||||
},
|
||||
"onlyBuiltDependencies": [
|
||||
"@parcel/watcher",
|
||||
"esbuild"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ func (d *Detector) Detect(chunk types.Chunk) []types.Finding { //nolint:gocognit
|
|||
charset := rules.DetectCharset(secret)
|
||||
var charsetStr string
|
||||
switch charset {
|
||||
case "hex":
|
||||
case rules.CharsetNameHex:
|
||||
charsetStr = rules.HexCharset
|
||||
case "base64":
|
||||
case rules.CharsetNameBase64:
|
||||
charsetStr = rules.Base64Charset
|
||||
default:
|
||||
charsetStr = rules.AlphanumericCharset
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -84,8 +84,8 @@ func TestIsPlaceholder(t *testing.T) { //nolint:dupl
|
|||
secret: "your-api-key",
|
||||
want: true,
|
||||
},
|
||||
"placeholder": {
|
||||
secret: "placeholder",
|
||||
stopwordPlaceholder: {
|
||||
secret: stopwordPlaceholder,
|
||||
want: true,
|
||||
},
|
||||
"xxxx pattern": {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ const (
|
|||
Base64Charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=-_"
|
||||
HexCharset = "0123456789abcdefABCDEF"
|
||||
AlphanumericCharset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
||||
|
||||
CharsetNameHex = "hex"
|
||||
CharsetNameBase64 = "base64"
|
||||
CharsetNameAlphanumeric = "alphanumeric"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -98,19 +102,19 @@ func DetectCharset(s string) string {
|
|||
}
|
||||
|
||||
if total == 0 {
|
||||
return "alphanumeric"
|
||||
return CharsetNameAlphanumeric
|
||||
}
|
||||
|
||||
hexRatio := float64(hexCount) / float64(total)
|
||||
b64Ratio := float64(b64Count) / float64(total)
|
||||
|
||||
if hexRatio == 1.0 && isAllHexChars(s) {
|
||||
return "hex"
|
||||
return CharsetNameHex
|
||||
}
|
||||
if b64Ratio >= 0.95 {
|
||||
return "base64"
|
||||
return CharsetNameBase64
|
||||
}
|
||||
return "alphanumeric"
|
||||
return CharsetNameAlphanumeric
|
||||
}
|
||||
|
||||
func ExtractHighEntropyTokens(
|
||||
|
|
|
|||
|
|
@ -128,27 +128,27 @@ func TestDetectCharset(t *testing.T) {
|
|||
}{
|
||||
"hex string": {
|
||||
input: "a1b2c3d4e5f6",
|
||||
want: "hex",
|
||||
want: CharsetNameHex,
|
||||
},
|
||||
"base64 with special chars": {
|
||||
input: "kR9mPx2vBnQ8jL5w+/YzTf==",
|
||||
want: "base64",
|
||||
want: CharsetNameBase64,
|
||||
},
|
||||
"pure alphanumeric": {
|
||||
input: "HelloWorld123XYZ",
|
||||
want: "base64",
|
||||
want: CharsetNameBase64,
|
||||
},
|
||||
"mixed with symbols": {
|
||||
input: "hello@world#foo$bar",
|
||||
want: "alphanumeric",
|
||||
want: CharsetNameAlphanumeric,
|
||||
},
|
||||
"empty string": {
|
||||
input: "",
|
||||
want: "alphanumeric",
|
||||
want: CharsetNameAlphanumeric,
|
||||
},
|
||||
"only hex digits": {
|
||||
input: "deadbeef0123456789",
|
||||
want: "hex",
|
||||
want: CharsetNameHex,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue