@starci/eslint-canon-be 3.4.3 → 3.4.5
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.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/runtime/knowledge/hfs/canon-pins.yaml +9 -4
- package/runtime/knowledge/hfs/rules.yaml +19 -2
- package/runtime/knowledge/sonar-gate.yaml +2 -2
- package/runtime/scripts/hfs/rules/secrets.mjs +8 -10
- package/runtime/scripts/lib/secret-patterns.mjs +77 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.4.5 - 2026-10-18
|
|
4
|
+
- Changed: bundled runtime copies follow runtime 1.0.0-alpha.22 (failure codes, the rule catalog with R301 and the candidate trigger laws, canon pins); canon rules are unchanged.
|
|
5
|
+
|
|
6
|
+
## 3.4.4 - 2026-10-18
|
|
7
|
+
- Changed: bundled runtime copies follow runtime 1.0.0-alpha.21 (canon pins, failure codes, the narrowed secret patterns); canon rules are unchanged.
|
|
8
|
+
|
|
3
9
|
## 3.4.3 - 2026-10-18
|
|
4
10
|
- Changed: bundled runtime copies include the refreshed canon pins for the alpha.20 patch set; canon rules are unchanged.
|
|
5
11
|
|
package/package.json
CHANGED
|
@@ -29,14 +29,14 @@ pins:
|
|
|
29
29
|
source: packages/grammar/package.json
|
|
30
30
|
why: 'the grammar front ends read: the brand layer sets `--font-sans` and `--font-mono` and the grammar reads them; it carries the Input tel kind, the copyable and read-only Input, the IconButton disclosure props and count badge, ChatBubble, FillViewport, Textarea mentions and Enter-to-send, the leading PrimaryRailLayout rail, the plate-less Image, ListRow, the soft Alert, Progress steps, the floating primary IconButton, FlowGraph, the STATE-8 loading views and the bordered selectable TagGroup chips. The runtime source version wins for a @starci package.'
|
|
31
31
|
'@starci/eslint-canon-be':
|
|
32
|
-
version: 3.4.
|
|
32
|
+
version: 3.4.5
|
|
33
33
|
group: starci
|
|
34
34
|
install: registry
|
|
35
35
|
side: be
|
|
36
36
|
source: packages/eslint/be/package.json
|
|
37
37
|
why: 'the back-end ESLint canon: `loadHfs(import.meta.url)` of be/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the be side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; `starciBeConfig({ hfs: loadHfs(import.meta.url) })` is the typed factory and the BE-CONVENTION laws are its rules.'
|
|
38
38
|
'@starci/eslint-canon-fe':
|
|
39
|
-
version: 8.4.
|
|
39
|
+
version: 8.4.5
|
|
40
40
|
group: starci
|
|
41
41
|
install: registry
|
|
42
42
|
side: fe
|
|
@@ -76,14 +76,14 @@ pins:
|
|
|
76
76
|
source: packages/test-world/package.json
|
|
77
77
|
why: 'the shared e2e library of every back end (R47, R48), a devDependency of every back end: the warm stack behind toxiproxy, the network-edge fakes, the Nest boot, the typed useTestWorld handle, useSandbox for contract specs and the outage lock. Kafka is real own infra (the one digest-pinned apache/kafka KRaft image, a broker listener and proxy per slot, slot-prefixed topics, consumer groups and client ids) and Postgres is schema-per-context (a schema and a login role per context in a shared database). Each worker has its own data slot (<ns>_w<k>) with its own databases, Keycloak realm, leased Redis DB, bucket/collection/topic prefixes, fakes host, toxiproxy proxies and outage lock; a run provisions min(jest workers, workers cap, default 2) slots, and state file protocol 2 pairs exactly with @starci/jest-preset (TEST_WORLD_PAIR_MISMATCH otherwise). A modules world boots real peer apps beside its modules, world.apps.<name>.during(fn) is the outage of a peer app, w.keycloak.clientSecret(client) answers the run-generated secret of a confidential realm client, world.keycloak.events/sessions read the realm user events and live sessions, world.infra.postgresql.connection(name) takes one database connection down while the others serve, and world.resolve and scope.resolve take any Nest token. Every path a declaration names (`stack`, seeds, the realm, Dockerfiles) resolves from the app root (the directory of hfs.json); the globalSetup registers the path aliases as TypeScript resolves them. Its CLI main is exported at ./cli for starci app stack.'
|
|
78
78
|
'@starci/cli':
|
|
79
|
-
version: 1.
|
|
79
|
+
version: 1.7.0
|
|
80
80
|
group: starci
|
|
81
81
|
install: registry
|
|
82
82
|
side: both
|
|
83
83
|
source: packages/cli/package.json
|
|
84
84
|
why: 'the only StarCi command package; product repositories install it for starci app, while @starci/hfs remains its pinned transitive implementation.'
|
|
85
85
|
'@starci/hfs':
|
|
86
|
-
version: 4.
|
|
86
|
+
version: 4.7.0
|
|
87
87
|
group: starci
|
|
88
88
|
install: registry
|
|
89
89
|
side: both
|
|
@@ -466,6 +466,11 @@ pins:
|
|
|
466
466
|
group: framework
|
|
467
467
|
side: be
|
|
468
468
|
why: 'the GraphQL transport of every back end (be.transport.graphql) that the front end calls; the ecommerce-app resolution on 2026-10-13. Stays on 13.x for alpha.18: the npm-audit advisory fixed by 14.0.3 (semver major) is a documented accepted exception, upgrade deferred to alpha.19 (owner ruling graphql-13-advisory-accepted-until-a19, 2026-10-16).'
|
|
469
|
+
'@graphql-tools/utils':
|
|
470
|
+
version: 12.1.0
|
|
471
|
+
group: framework
|
|
472
|
+
side: be
|
|
473
|
+
why: 'an npm override of every app root (and of the examples that serve GraphQL), never a declared dependency: @nestjs/graphql 13.x pulls @graphql-tools/utils <=12.0.0, which npm audit --audit-level=high reports (GHSA-7mx3-vvmw-hjmv, prototype pollution in mergeDeep). 12.1.0 is a fixed release on the same major and the lowest one every declared range accepts (@graphql-tools/schema and /merge, used at runtime, require ^12.1.0; NIVO v0.2.1 6a1d8e80 overrides 12.0.4, below that range), so the advisory closes without the breaking @nestjs/graphql 14. DROP this pin and the override when @nestjs/graphql 14 is adopted (owner ruling graphql-tools-utils-override, 2026-10-18).'
|
|
469
474
|
'@nestjs/apollo':
|
|
470
475
|
version: 13.4.5
|
|
471
476
|
group: framework
|
|
@@ -3558,7 +3558,7 @@ rules:
|
|
|
3558
3558
|
- {kind: hfs, id: lite-secret-custody, at: scripts/hfs/rules/supabase-secrets.mjs}
|
|
3559
3559
|
- id: R221
|
|
3560
3560
|
code: "CI_TRIGGERS_RELEASE_ONLY"
|
|
3561
|
-
law: "The only workflow triggers are a push of release tags, a person dispatching it and, in the runtime's own workflows (`.github/workflows/` at the root), a push to `main`: every tracked workflow declares an `on` that holds only `push` filtered to `tags: ['v*']` (and, in the runtime's own workflows, `
|
|
3561
|
+
law: "The only workflow triggers are a push of release tags, a push of release candidate branches `release/candidate-*`, a person dispatching it and, in the runtime's own workflows (`.github/workflows/` at the root), a push to `main`: every tracked workflow declares an `on` that holds only `push` filtered to `tags: ['v*']` and/or `branches` naming only `release/candidate-*` (and, in the runtime's own workflows, `main`; no paths or ignore filter beside them) and `workflow_dispatch`. Every `ci.yml`, and the runtime's `examples.yml`, must name `release/candidate-*`: `starci release cut` and `starci app release push` push the exact release sha there and move main and the tag only when that run is green (owner ruling candidate-ci, 2026-10-18). A push to any other branch, a pull_request, a schedule, a workflow_call or any other event refuses the workflow."
|
|
3562
3562
|
scope: runtime
|
|
3563
3563
|
editions: [lite, full]
|
|
3564
3564
|
docs: [docs/git-governance.md#r221]
|
|
@@ -4026,7 +4026,7 @@ rules:
|
|
|
4026
4026
|
- {path: packages/hfs/templates/app/ci-workflows-lite/github/workflows/db-deploy.yml, edition: lite}
|
|
4027
4027
|
- {path: packages/hfs/templates/app/ci-workflows/github/workflows/ci.yml, edition: full}
|
|
4028
4028
|
witness: {status: unreachable, reason: "owner:no-runtime-specs (2026-10-17): the mutation witness was a deleted runtime spec or fixture", date: "2026-10-17"}
|
|
4029
|
-
law: "In lite and full apps, deployment jobs declare a protected environment, explicit permissions and concurrency, materialize sealed secrets through SOPS_AGE_KEY or starci app secret materialize, and reference only the age key and transport SSH key/known_hosts secrets. They never embed a dotenv blob or write a dotenv file. Every remote workflow action uses a 40-hex commit SHA (local actions are allowed and container actions require a full sha256 digest); supply-chain reports each unpinned uses reference at its source line, including disabled jobs and steps; installed tools are checksum or digest verified, or supplied by a pinned action. App workflows start only on release tags [v*] or workflow_dispatch, never on
|
|
4029
|
+
law: "In lite and full apps, deployment jobs declare a protected environment, explicit permissions and concurrency, materialize sealed secrets through SOPS_AGE_KEY or starci app secret materialize, and reference only the age key and transport SSH key/known_hosts secrets. They never embed a dotenv blob or write a dotenv file. Every remote workflow action uses a 40-hex commit SHA (local actions are allowed and container actions require a full sha256 digest); supply-chain reports each unpinned uses reference at its source line, including disabled jobs and steps; installed tools are checksum or digest verified, or supplied by a pinned action. App workflows start only on release tags [v*], the release candidate branches release/candidate-* (required in ci.yml: starci app release push waits for that run, owner ruling candidate-ci 2026-10-18) or workflow_dispatch, never on another branch push."
|
|
4030
4030
|
kinds: [check]
|
|
4031
4031
|
gates: [settle, land, ci]
|
|
4032
4032
|
failureCodes: ["HFS_DEPLOY_WORKFLOW", "HFS_WORKFLOW_PIN", "HFS_CI_TOOL_INSTALL", "HFS_APP_WORKFLOW_TRIGGER"]
|
|
@@ -4967,3 +4967,20 @@ rules:
|
|
|
4967
4967
|
- {path: packages/hfs/templates/app/skeleton/.starcistacks, edition: full}
|
|
4968
4968
|
specNa: "owner:no-runtime-specs (2026-10-17): the runtime has no specs of its own; this code is enforced by runtime code and its spec proof was a deleted runtime spec"
|
|
4969
4969
|
witness: {status: unreachable, reason: "owner:no-runtime-specs (2026-10-17): external smoke fixtures", date: "2026-10-17"}
|
|
4970
|
+
- id: R301
|
|
4971
|
+
code: "CI_STANDARD"
|
|
4972
|
+
law: "The managed app CI, the example apps (the reference) and the runtime repository's own workflows follow the ONE CI standard of knowledge/hfs/ci-standard.yaml (owner ruling ci-standard, 2026-10-18): the job shape fast/test/build(/sonar) with the unit run and the Codecov upload in test alone, full history with STARCI_BASE_REF written before the lint, NODE_OPTIONS --max-old-space-size=6144 on every heavy step, the Sonar lint per side, optional providers probed before they skip, a timeout on every job and every action pinned to a commit sha; the other items (candidate trigger R221, per-fe-app build env, prettier-stable renders, R299 contexts) are owned by the rules the standard names. Apps get the standard only through starci app sync."
|
|
4973
|
+
kinds: [check]
|
|
4974
|
+
gates: [settle, land, ci]
|
|
4975
|
+
failureCodes: ["CI_STANDARD"]
|
|
4976
|
+
enforcers:
|
|
4977
|
+
- {kind: hfs, id: ci-standard, at: scripts/hfs/rules/ci-standard.mjs}
|
|
4978
|
+
- {kind: runtime, id: ci-standard-runtime, at: scripts/hfs/runtime-rules/runtime-ci-standard.mjs}
|
|
4979
|
+
editions: [lite, full]
|
|
4980
|
+
docs:
|
|
4981
|
+
- {path: docs/application-stacks.md#r301, editions: [lite, full]}
|
|
4982
|
+
exemplifiedBy:
|
|
4983
|
+
- {path: packages/hfs/templates/app/ci-workflows-lite/github/workflows/ci.yml, edition: lite}
|
|
4984
|
+
- {path: packages/hfs/templates/app/ci-workflows/github/workflows/ci.yml, edition: full}
|
|
4985
|
+
specNa: "owner:no-runtime-specs (2026-10-17): the runtime has no specs of its own; the scaffold e2e (e2e/hfs-scaffold-app.spec.mjs: a fresh scaffold has no finding) and the example apps prove it"
|
|
4986
|
+
witness: {status: unreachable, reason: "owner:no-runtime-specs (2026-10-17): the runtime has no spec fixtures", date: "2026-10-18"}
|
|
@@ -41,8 +41,8 @@ newCode:
|
|
|
41
41
|
minReviewedPercent: 100
|
|
42
42
|
unreviewedMax: 0
|
|
43
43
|
# The whole code, not only the new code. Every finding of the HFS canon reaches Sonar through ONE entry, `starci app lint`
|
|
44
|
-
# (packages/hfs, contract changes hfs-sonar-import and hfs-lint-entry)
|
|
45
|
-
#
|
|
44
|
+
# (packages/hfs, contract changes hfs-sonar-import and hfs-lint-entry). CI runs it per side with --side and --sonar,
|
|
45
|
+
# then merges rules by id and joins issues into ONE file, reports/lint.sonar.json, named by sonar.externalIssuesReportPaths; the gate holds the open-issue count of
|
|
46
46
|
# the whole project at zero. The file carries three engines:
|
|
47
47
|
# starci-hfs the repository findings of `starci app check` (managed files, tree, pins, CI, contracts; the rule id is the finding code)
|
|
48
48
|
# eslint ESLint's json over the repository (the BE and FE canon plugins alike, per-file and project-graph rules)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// A finding names the file, the line and the pattern, never the value.
|
|
8
8
|
import fs from 'node:fs';
|
|
9
9
|
import path from 'node:path';
|
|
10
|
-
import { FORBIDDEN_FILES,
|
|
10
|
+
import { FORBIDDEN_FILES, secretHitsInFile } from '../../lib/secret-patterns.mjs';
|
|
11
11
|
import { isSopsEnvelope } from '../../lib/sops-envelope.mjs';
|
|
12
12
|
import { found, readText } from './read.mjs';
|
|
13
13
|
|
|
@@ -34,20 +34,17 @@ export function untrackedSecretFindings({ repoRoot, files, repo }) {
|
|
|
34
34
|
* no sops envelope, or a line that matches a secret pattern. `text` is the file's text, or null when it cannot be read (binary, too
|
|
35
35
|
* large, absent). The whole-tree check reads the work tree and the commit hook (`starci app hygiene`) reads the staged blob: one judgement.
|
|
36
36
|
*/
|
|
37
|
-
export function secretFileFindings({ file, text }) {
|
|
37
|
+
export function secretFileFindings({ file, text, manifestText }) {
|
|
38
38
|
const being = FORBIDDEN_FILES.find((rule) => rule.test(file));
|
|
39
39
|
if (being) return [found(PLAINTEXT_SECRET, file, `${file} is a plaintext secret by being (${being.name}); a secret is committed only as a sops envelope at .starcistacks/<env>/secrets/<slug>.enc`, { pattern: being.name })];
|
|
40
40
|
if (text === null || text === undefined || NOT_SCANNED.test(file)) return [];
|
|
41
41
|
if (file.endsWith('.enc')) return isSopsEnvelope(text) ? [] : [found(PLAINTEXT_SECRET, file, `${file} is named like a sealed secret but is not a sops envelope; encrypt the value with sops and commit only the envelope`, { pattern: 'sops-not-envelope' })];
|
|
42
42
|
const findings = [];
|
|
43
|
-
const lines = text.split(/\r?\n/);
|
|
44
43
|
const seen = new Set();
|
|
45
|
-
for (const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
findings.push(found(PLAINTEXT_SECRET, file, `${file}:${index + 1} holds a plaintext secret (${pattern}); seal it with sops at .starcistacks/<env>/secrets/<slug>.enc and read it by *_FILE`, { line: index + 1, pattern }));
|
|
50
|
-
}
|
|
44
|
+
for (const { line, pattern } of secretHitsInFile(file, text, { manifestText })) {
|
|
45
|
+
if (seen.has(pattern)) continue;
|
|
46
|
+
seen.add(pattern);
|
|
47
|
+
findings.push(found(PLAINTEXT_SECRET, file, `${file}:${line} holds a plaintext secret (${pattern}); seal it with sops at .starcistacks/<env>/secrets/<slug>.enc and read it by *_FILE`, { line, pattern }));
|
|
51
48
|
}
|
|
52
49
|
return findings;
|
|
53
50
|
}
|
|
@@ -62,7 +59,8 @@ export function secretFindings({ repoRoot, files, resolver }) {
|
|
|
62
59
|
findings.push(found(PLAINTEXT_SECRET, file, `${file} is a plaintext secret file tracked in ${slot.slot}${destination}`, { slot: slot.slot, goesTo: slot.goesTo }));
|
|
63
60
|
continue;
|
|
64
61
|
}
|
|
65
|
-
|
|
62
|
+
const manifestText = /(?:^|\/)README\.md$/.test(file) ? readText(repoRoot, path.posix.join(path.posix.dirname(file), '.starcistacks/application-stacks.yaml')) : undefined;
|
|
63
|
+
findings.push(...secretFileFindings({ file, text: readText(repoRoot, file), manifestText }));
|
|
66
64
|
}
|
|
67
65
|
return findings;
|
|
68
66
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { parseYaml } from '../../engine/yaml.mjs';
|
|
2
|
+
|
|
1
3
|
// secret-patterns.mjs — the one list of secret shapes the runtime refuses to carry: the push secret scan
|
|
2
4
|
// (scripts/supervisor/push-mains.mjs scanDiff) refuses an outgoing range that adds one, and the typed-log
|
|
3
5
|
// redaction (scripts/kernel/typed-logs.mjs redactText) blanks the value before a log row is stored.
|
|
@@ -102,3 +104,78 @@ export function secretHits(file, text) {
|
|
|
102
104
|
}
|
|
103
105
|
return names;
|
|
104
106
|
}
|
|
107
|
+
|
|
108
|
+
const BADGE_BEGIN = '<!-- >>> starci app sync (managed block; do not edit) >>> -->';
|
|
109
|
+
const BADGE_END = '<!-- <<< starci app sync <<< -->';
|
|
110
|
+
|
|
111
|
+
/** Provider-shaped credentials remain refused even where the keyword heuristic admits public badge tokens. */
|
|
112
|
+
function blankBadgeValue(value) {
|
|
113
|
+
return secretHits('badge.mjs', value).length ? value : ' '.repeat(value.length);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Only scalar values at the two block-mapping service paths qualify; every other YAML substring remains scanned. */
|
|
117
|
+
function manifestBadgeText(text) {
|
|
118
|
+
try { parseYaml(text); } catch { return text; }
|
|
119
|
+
const parents = [];
|
|
120
|
+
return text.split('\n').map(line => {
|
|
121
|
+
if (/^\s*(?:#.*)?$/.test(line)) return line;
|
|
122
|
+
const indent = /^ */.exec(line)[0].length;
|
|
123
|
+
while (parents.length && parents.at(-1).indent >= indent) parents.pop();
|
|
124
|
+
const match = /^( *)(?:([A-Za-z0-9_-]+)|"([A-Za-z0-9_-]+)"|'([A-Za-z0-9_-]+)'):(.*)$/.exec(line);
|
|
125
|
+
if (!match) { parents.push({ indent, key: null }); return line; }
|
|
126
|
+
match[5] = match[5].trimStart();
|
|
127
|
+
const key = match[2] ?? match[3] ?? match[4];
|
|
128
|
+
const keys = [...parents.map(parent => parent.key), key].join('.');
|
|
129
|
+
const container = /^(?:#.*)?$/.test(match[5].trim());
|
|
130
|
+
const nestedScalar = parents.some(parent => parent.container === false);
|
|
131
|
+
parents.push({ indent, key, container });
|
|
132
|
+
if (nestedScalar) return line;
|
|
133
|
+
if (!['services.codecov.badgeToken', 'services.sonar.badgeToken'].includes(keys)) return line;
|
|
134
|
+
const scalar = /^(?:"([A-Za-z0-9_-]{6,128})"|'([A-Za-z0-9_-]{6,128})'|([A-Za-z0-9_-]{6,128}))(?=\s*(?:#|$))/.exec(match[5]);
|
|
135
|
+
if (!scalar) return line;
|
|
136
|
+
const start = line.length - match[5].length;
|
|
137
|
+
return line.slice(0, start) + blankBadgeValue(scalar[0]) + match[5].slice(scalar[0].length);
|
|
138
|
+
}).join('\n');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Unreadable manifests admit only the default badge hosts; readable Sonar declarations select their own hosts. */
|
|
142
|
+
function badgeHosts(manifestText) {
|
|
143
|
+
const hosts = new Set(['codecov.io']);
|
|
144
|
+
let doc;
|
|
145
|
+
try { doc = parseYaml(manifestText); } catch { hosts.add('sonarcloud.io'); return hosts; }
|
|
146
|
+
const sonar = doc?.services?.sonar;
|
|
147
|
+
if (sonar?.provider === 'sonarcloud') hosts.add('sonarcloud.io');
|
|
148
|
+
else for (const host of [sonar?.host?.public, sonar?.host?.local]) {
|
|
149
|
+
try { hosts.add(new URL(host).host); } catch { /* Invalid hosts admit nothing. */ }
|
|
150
|
+
}
|
|
151
|
+
return hosts;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Only token query values in managed Markdown badge images on declared hosts are blanked; links and other parameters remain scanned. */
|
|
155
|
+
function readmeBadgeText(text, manifestText) {
|
|
156
|
+
const begin = text.indexOf(BADGE_BEGIN), end = text.indexOf(BADGE_END, begin + BADGE_BEGIN.length);
|
|
157
|
+
if (begin < 0 || end < 0) return text;
|
|
158
|
+
const hosts = badgeHosts(manifestText);
|
|
159
|
+
const start = begin + BADGE_BEGIN.length;
|
|
160
|
+
const block = text.slice(start, end).replace(/!\[[^\]\n]*\]\((https?:\/\/[^\s)]+)\)/g, (image, address) => {
|
|
161
|
+
let url;
|
|
162
|
+
try { url = new URL(address); } catch { return image; }
|
|
163
|
+
if (!hosts.has(url.host) || url.username || url.password) return image;
|
|
164
|
+
const badgePath = url.host === 'codecov.io' ? /\/graph\/badge\.svg$/.test(url.pathname) : url.pathname === '/api/project_badges/measure';
|
|
165
|
+
if (!badgePath) return image;
|
|
166
|
+
const fragment = address.indexOf('#');
|
|
167
|
+
const queryEnd = fragment < 0 ? address.length : fragment;
|
|
168
|
+
const safe = address.slice(0, queryEnd).replace(/([?&]token=)([^&#)\s]*)/g, (_, prefix, value) => prefix + blankBadgeValue(value));
|
|
169
|
+
return image.replace(address, () => safe + address.slice(queryEnd));
|
|
170
|
+
});
|
|
171
|
+
return text.slice(0, start) + block + text.slice(end);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Whole-file secret judgement exempts only declared public badge values and preserves original line numbers and every provider shape. */
|
|
175
|
+
export function secretHitsInFile(file, fullText, { manifestText } = {}) {
|
|
176
|
+
const normalized = file.replace(/\\/g, '/');
|
|
177
|
+
let text = fullText;
|
|
178
|
+
if (/(?:^|\/)\.starcistacks\/application-stacks\.yaml$/.test(normalized)) text = manifestBadgeText(text);
|
|
179
|
+
if (/(?:^|\/)README\.md$/.test(normalized)) text = readmeBadgeText(text, manifestText);
|
|
180
|
+
return text.split(/\r?\n/).flatMap((line, index) => secretHits(file, line).map(pattern => ({ line: index + 1, pattern })));
|
|
181
|
+
}
|