iteration-cli 0.15.0 → 0.16.1
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/README.md +10 -2
- package/dist/cli.js +1120 -575
- package/dist/cursor-hook-entry.js +6 -2
- package/dist/launcher.js +155 -149
- package/package.json +3 -3
package/dist/launcher.js
CHANGED
|
@@ -7583,20 +7583,25 @@ var exportSchema = object({
|
|
|
7583
7583
|
});
|
|
7584
7584
|
var uuid3 = uuid2();
|
|
7585
7585
|
var identifier2 = string2().regex(/^[A-Za-z0-9_:./-]{1,255}$/);
|
|
7586
|
+
function consoleWriter(line, level) {
|
|
7587
|
+
if (level === "info") console.info(line);
|
|
7588
|
+
else console.error(line);
|
|
7589
|
+
}
|
|
7586
7590
|
var loggingContext = () => ({});
|
|
7587
|
-
|
|
7588
|
-
|
|
7591
|
+
var logWriter = consoleWriter;
|
|
7592
|
+
function configureCollectorLogging(context2, write = consoleWriter) {
|
|
7593
|
+
loggingContext = context2;
|
|
7594
|
+
logWriter = write;
|
|
7589
7595
|
}
|
|
7590
7596
|
function writeLog(line, level) {
|
|
7591
|
-
|
|
7592
|
-
else console.error(line);
|
|
7597
|
+
logWriter(line, level);
|
|
7593
7598
|
}
|
|
7594
|
-
function createLogger(
|
|
7599
|
+
function createLogger(context2, write = writeLog) {
|
|
7595
7600
|
return (entry) => {
|
|
7596
7601
|
write(
|
|
7597
7602
|
JSON.stringify({
|
|
7598
7603
|
...entry,
|
|
7599
|
-
...
|
|
7604
|
+
...context2,
|
|
7600
7605
|
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7601
7606
|
pid: process.pid,
|
|
7602
7607
|
...loggingContext()
|
|
@@ -9427,7 +9432,7 @@ var messages$r = {
|
|
|
9427
9432
|
ja: (props) => `AWS Access Key Id: ${props.ID} \u304C\u307F\u3064\u304B\u308A\u307E\u3057\u305F`
|
|
9428
9433
|
}
|
|
9429
9434
|
};
|
|
9430
|
-
var reportAWSAccessKey = ({ t, source, context, options }) => {
|
|
9435
|
+
var reportAWSAccessKey = ({ t, source, context: context2, options }) => {
|
|
9431
9436
|
const AWSAccessKeyIDPattern = /\b(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}\b/g;
|
|
9432
9437
|
const results = source.content.matchAll(AWSAccessKeyIDPattern);
|
|
9433
9438
|
for (const result of results) {
|
|
@@ -9441,7 +9446,7 @@ var reportAWSAccessKey = ({ t, source, context, options }) => {
|
|
|
9441
9446
|
if (allowedResults.length > 0) {
|
|
9442
9447
|
continue;
|
|
9443
9448
|
}
|
|
9444
|
-
|
|
9449
|
+
context2.report({
|
|
9445
9450
|
message: t("AWSAccessKeyID", {
|
|
9446
9451
|
ID: match
|
|
9447
9452
|
}),
|
|
@@ -9449,7 +9454,7 @@ var reportAWSAccessKey = ({ t, source, context, options }) => {
|
|
|
9449
9454
|
});
|
|
9450
9455
|
}
|
|
9451
9456
|
};
|
|
9452
|
-
var reportAWSSecretAccessKey = ({ t, source, context, options }) => {
|
|
9457
|
+
var reportAWSSecretAccessKey = ({ t, source, context: context2, options }) => {
|
|
9453
9458
|
const AWS = "(?:AWS|aws|Aws)?_?";
|
|
9454
9459
|
const QUOTE = `["']?`;
|
|
9455
9460
|
const CONNECT = "\\s*(?::|=>|=)\\s*";
|
|
@@ -9466,7 +9471,7 @@ var reportAWSSecretAccessKey = ({ t, source, context, options }) => {
|
|
|
9466
9471
|
if (allowedResults.length > 0) {
|
|
9467
9472
|
continue;
|
|
9468
9473
|
}
|
|
9469
|
-
|
|
9474
|
+
context2.report({
|
|
9470
9475
|
message: t("AWSSecretAccessKey", {
|
|
9471
9476
|
KEY: match
|
|
9472
9477
|
}),
|
|
@@ -9474,7 +9479,7 @@ var reportAWSSecretAccessKey = ({ t, source, context, options }) => {
|
|
|
9474
9479
|
});
|
|
9475
9480
|
}
|
|
9476
9481
|
};
|
|
9477
|
-
var reportAWSAccountID = ({ t, source, context, options }) => {
|
|
9482
|
+
var reportAWSAccountID = ({ t, source, context: context2, options }) => {
|
|
9478
9483
|
const AWS = "(AWS|aws|Aws)?_?";
|
|
9479
9484
|
const QUOTE = `("|')?`;
|
|
9480
9485
|
const CONNECT = "\\s*(:|=>|=)\\s*";
|
|
@@ -9488,7 +9493,7 @@ var reportAWSAccountID = ({ t, source, context, options }) => {
|
|
|
9488
9493
|
if (allowedResults.length > 0) {
|
|
9489
9494
|
continue;
|
|
9490
9495
|
}
|
|
9491
|
-
|
|
9496
|
+
context2.report({
|
|
9492
9497
|
message: t("AWSAccountID", {
|
|
9493
9498
|
ID: match
|
|
9494
9499
|
}),
|
|
@@ -9507,19 +9512,19 @@ var creator$s = {
|
|
|
9507
9512
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-aws/README.md"
|
|
9508
9513
|
}
|
|
9509
9514
|
},
|
|
9510
|
-
create(
|
|
9515
|
+
create(context2, options) {
|
|
9511
9516
|
const normalizedOptions = {
|
|
9512
9517
|
allows: options.allows || [],
|
|
9513
9518
|
enableIDScanRule: options.enableIDScanRule ?? false
|
|
9514
9519
|
};
|
|
9515
|
-
const t =
|
|
9520
|
+
const t = context2.createTranslator(messages$r);
|
|
9516
9521
|
return {
|
|
9517
9522
|
file(source) {
|
|
9518
9523
|
if (normalizedOptions.enableIDScanRule) {
|
|
9519
|
-
reportAWSAccessKey({ t, source, context, options: normalizedOptions });
|
|
9520
|
-
reportAWSAccountID({ t, source, context, options: normalizedOptions });
|
|
9524
|
+
reportAWSAccessKey({ t, source, context: context2, options: normalizedOptions });
|
|
9525
|
+
reportAWSAccountID({ t, source, context: context2, options: normalizedOptions });
|
|
9521
9526
|
}
|
|
9522
|
-
reportAWSSecretAccessKey({ t, source, context, options: normalizedOptions });
|
|
9527
|
+
reportAWSSecretAccessKey({ t, source, context: context2, options: normalizedOptions });
|
|
9523
9528
|
}
|
|
9524
9529
|
};
|
|
9525
9530
|
}
|
|
@@ -9720,7 +9725,7 @@ async function verifyPkcs12Mac(pfxBytes, password) {
|
|
|
9720
9725
|
}
|
|
9721
9726
|
}
|
|
9722
9727
|
var GCP_SERVICE_ACCOUNT_P12_PASSWORD = "notasecret";
|
|
9723
|
-
async function reportIfFoundPrivateKeyP12Format({ source, context, t }) {
|
|
9728
|
+
async function reportIfFoundPrivateKeyP12Format({ source, context: context2, t }) {
|
|
9724
9729
|
if (!source.filePath) {
|
|
9725
9730
|
return;
|
|
9726
9731
|
}
|
|
@@ -9732,7 +9737,7 @@ async function reportIfFoundPrivateKeyP12Format({ source, context, t }) {
|
|
|
9732
9737
|
if (!isGcpServiceAccountP12) {
|
|
9733
9738
|
return;
|
|
9734
9739
|
}
|
|
9735
|
-
|
|
9740
|
+
context2.report({
|
|
9736
9741
|
message: t("PrivateKeyP12", {
|
|
9737
9742
|
FILE_NAME: path17.basename(source.filePath)
|
|
9738
9743
|
}),
|
|
@@ -9751,7 +9756,7 @@ var messages$q = {
|
|
|
9751
9756
|
ja: (props) => `GCP\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u79D8\u5BC6\u9375(json): ${props.FILE_NAME} \u304C\u307F\u3064\u304B\u308A\u307E\u3057\u305F`
|
|
9752
9757
|
}
|
|
9753
9758
|
};
|
|
9754
|
-
function reportIfFoundPrivateKeyJSONFormat({ source, context, t }) {
|
|
9759
|
+
function reportIfFoundPrivateKeyJSONFormat({ source, context: context2, t }) {
|
|
9755
9760
|
try {
|
|
9756
9761
|
const credentialObject = JSON.parse(source.content);
|
|
9757
9762
|
const PRIVATE_KEY_PATTERN = /-----BEGIN\s?(DSA|RSA|EC|PGP|OPENSSH)?\s?PRIVATE KEY/gm;
|
|
@@ -9759,7 +9764,7 @@ function reportIfFoundPrivateKeyJSONFormat({ source, context, t }) {
|
|
|
9759
9764
|
if (!isGCPServiceAccountPrivateKeyJSON) {
|
|
9760
9765
|
return;
|
|
9761
9766
|
}
|
|
9762
|
-
|
|
9767
|
+
context2.report({
|
|
9763
9768
|
message: t("PrivateKeyJSON", {
|
|
9764
9769
|
FILE_NAME: source.filePath ? path3.basename(source.filePath) : ""
|
|
9765
9770
|
}),
|
|
@@ -9779,17 +9784,17 @@ var creator$r = {
|
|
|
9779
9784
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-gcp/README.md"
|
|
9780
9785
|
}
|
|
9781
9786
|
},
|
|
9782
|
-
create(
|
|
9783
|
-
const t =
|
|
9787
|
+
create(context2, options) {
|
|
9788
|
+
const t = context2.createTranslator(messages$q);
|
|
9784
9789
|
({
|
|
9785
9790
|
allows: options.allows || []
|
|
9786
9791
|
});
|
|
9787
9792
|
return {
|
|
9788
9793
|
file(source) {
|
|
9789
9794
|
if (source.ext === ".p12") {
|
|
9790
|
-
return reportIfFoundPrivateKeyP12Format({ source, context, t });
|
|
9795
|
+
return reportIfFoundPrivateKeyP12Format({ source, context: context2, t });
|
|
9791
9796
|
} else if (source.ext === ".json") {
|
|
9792
|
-
return reportIfFoundPrivateKeyJSONFormat({ source, context, t });
|
|
9797
|
+
return reportIfFoundPrivateKeyJSONFormat({ source, context: context2, t });
|
|
9793
9798
|
}
|
|
9794
9799
|
}
|
|
9795
9800
|
};
|
|
@@ -9809,7 +9814,7 @@ var messages$p = {
|
|
|
9809
9814
|
ja: (props) => `npm access token: ${props.TOKEN} \u304C\u307F\u3064\u304B\u308A\u307E\u3057\u305F`
|
|
9810
9815
|
}
|
|
9811
9816
|
};
|
|
9812
|
-
function reportIfFoundXOauthGitHubToken({ source, options, context, t }) {
|
|
9817
|
+
function reportIfFoundXOauthGitHubToken({ source, options, context: context2, t }) {
|
|
9813
9818
|
const XOAuthPattern = /https?:\/\/(.{1,256}):x-oauth-basic@github.com\//g;
|
|
9814
9819
|
const results = source.content.matchAll(XOAuthPattern);
|
|
9815
9820
|
for (const result of results) {
|
|
@@ -9820,7 +9825,7 @@ function reportIfFoundXOauthGitHubToken({ source, options, context, t }) {
|
|
|
9820
9825
|
if (allowedResults.length > 0) {
|
|
9821
9826
|
continue;
|
|
9822
9827
|
}
|
|
9823
|
-
|
|
9828
|
+
context2.report({
|
|
9824
9829
|
message: t("PackageJSON_xOauthToken", {
|
|
9825
9830
|
TOKEN: match
|
|
9826
9831
|
}),
|
|
@@ -9828,7 +9833,7 @@ function reportIfFoundXOauthGitHubToken({ source, options, context, t }) {
|
|
|
9828
9833
|
});
|
|
9829
9834
|
}
|
|
9830
9835
|
}
|
|
9831
|
-
function reportIfFound_AuthTokenInNpmrc({ source, options, context, t }) {
|
|
9836
|
+
function reportIfFound_AuthTokenInNpmrc({ source, options, context: context2, t }) {
|
|
9832
9837
|
const AuthTokenPattern = /_authToken=([^$].*)/g;
|
|
9833
9838
|
const results = source.content.matchAll(AuthTokenPattern);
|
|
9834
9839
|
for (const result of results) {
|
|
@@ -9839,7 +9844,7 @@ function reportIfFound_AuthTokenInNpmrc({ source, options, context, t }) {
|
|
|
9839
9844
|
if (allowedResults.length > 0) {
|
|
9840
9845
|
continue;
|
|
9841
9846
|
}
|
|
9842
|
-
|
|
9847
|
+
context2.report({
|
|
9843
9848
|
message: t("Npmrc_authToken", {
|
|
9844
9849
|
TOKEN: match
|
|
9845
9850
|
}),
|
|
@@ -9847,7 +9852,7 @@ function reportIfFound_AuthTokenInNpmrc({ source, options, context, t }) {
|
|
|
9847
9852
|
});
|
|
9848
9853
|
}
|
|
9849
9854
|
}
|
|
9850
|
-
function reportIfFound_NPM_ACCESS_TOKEN({ source, options, context, t }) {
|
|
9855
|
+
function reportIfFound_NPM_ACCESS_TOKEN({ source, options, context: context2, t }) {
|
|
9851
9856
|
const NPM_ACCESS_TOKEN_PATTERN = new RegExp("(?<!\\p{L})npm_[A-Za-z0-9_]{36}(?![A-Za-z0-9_])", "gu");
|
|
9852
9857
|
const results = source.content.matchAll(NPM_ACCESS_TOKEN_PATTERN);
|
|
9853
9858
|
for (const result of results) {
|
|
@@ -9858,7 +9863,7 @@ function reportIfFound_NPM_ACCESS_TOKEN({ source, options, context, t }) {
|
|
|
9858
9863
|
if (allowedResults.length > 0) {
|
|
9859
9864
|
continue;
|
|
9860
9865
|
}
|
|
9861
|
-
|
|
9866
|
+
context2.report({
|
|
9862
9867
|
message: t("NPM_ACCESS_TOKEN", {
|
|
9863
9868
|
TOKEN: match
|
|
9864
9869
|
}),
|
|
@@ -9889,19 +9894,19 @@ var creator$q = {
|
|
|
9889
9894
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-npm/README.md"
|
|
9890
9895
|
}
|
|
9891
9896
|
},
|
|
9892
|
-
create(
|
|
9893
|
-
const t =
|
|
9897
|
+
create(context2, options) {
|
|
9898
|
+
const t = context2.createTranslator(messages$p);
|
|
9894
9899
|
const normalizedOptions = {
|
|
9895
9900
|
allows: options.allows || []
|
|
9896
9901
|
};
|
|
9897
9902
|
return {
|
|
9898
9903
|
file(source) {
|
|
9899
9904
|
if (isPackageFile(source.filePath)) {
|
|
9900
|
-
reportIfFoundXOauthGitHubToken({ source, options: normalizedOptions, context, t });
|
|
9905
|
+
reportIfFoundXOauthGitHubToken({ source, options: normalizedOptions, context: context2, t });
|
|
9901
9906
|
} else if (isNpmrc(source.filePath)) {
|
|
9902
|
-
reportIfFound_AuthTokenInNpmrc({ source, options: normalizedOptions, context, t });
|
|
9907
|
+
reportIfFound_AuthTokenInNpmrc({ source, options: normalizedOptions, context: context2, t });
|
|
9903
9908
|
}
|
|
9904
|
-
reportIfFound_NPM_ACCESS_TOKEN({ source, options: normalizedOptions, context, t });
|
|
9909
|
+
reportIfFound_NPM_ACCESS_TOKEN({ source, options: normalizedOptions, context: context2, t });
|
|
9905
9910
|
}
|
|
9906
9911
|
};
|
|
9907
9912
|
}
|
|
@@ -9916,7 +9921,7 @@ var messages$o = {
|
|
|
9916
9921
|
ja: (props) => `Slack\u306EIncoming Webhooks: ${props.TOKEN} \u304C\u307F\u3064\u304B\u308A\u307E\u3057\u305F`
|
|
9917
9922
|
}
|
|
9918
9923
|
};
|
|
9919
|
-
function reportIfFoundRawPrivateKey$1({ source, options, context, t }) {
|
|
9924
|
+
function reportIfFoundRawPrivateKey$1({ source, options, context: context2, t }) {
|
|
9920
9925
|
const SLACK_TOKEN_PATTERN = /\b(?:xoxb|xoxp|xapp|xoxa|xoxo|xoxr)-(?:\d-)?(?:[a-zA-Z0-9]{1,40}-)+[a-zA-Z0-9]{1,40}\b/g;
|
|
9921
9926
|
const results = source.content.matchAll(SLACK_TOKEN_PATTERN);
|
|
9922
9927
|
for (const result of results) {
|
|
@@ -9927,7 +9932,7 @@ function reportIfFoundRawPrivateKey$1({ source, options, context, t }) {
|
|
|
9927
9932
|
if (allowedResults.length > 0) {
|
|
9928
9933
|
continue;
|
|
9929
9934
|
}
|
|
9930
|
-
|
|
9935
|
+
context2.report({
|
|
9931
9936
|
message: t("SLACK_TOKEN", {
|
|
9932
9937
|
TOKEN: match
|
|
9933
9938
|
}),
|
|
@@ -9935,7 +9940,7 @@ function reportIfFoundRawPrivateKey$1({ source, options, context, t }) {
|
|
|
9935
9940
|
});
|
|
9936
9941
|
}
|
|
9937
9942
|
}
|
|
9938
|
-
function reportIfFoundIncomingWebhook({ source, options, context, t }) {
|
|
9943
|
+
function reportIfFoundIncomingWebhook({ source, options, context: context2, t }) {
|
|
9939
9944
|
const IncomingWebhooksPattern = /https:\/\/hooks\.slack\.com\/services\/T[a-zA-Z0-9]{1,40}\/B[a-zA-Z0-9]{1,40}\/[a-zA-Z0-9]{1,40}/gi;
|
|
9940
9945
|
const results = source.content.matchAll(IncomingWebhooksPattern);
|
|
9941
9946
|
for (const result of results) {
|
|
@@ -9946,7 +9951,7 @@ function reportIfFoundIncomingWebhook({ source, options, context, t }) {
|
|
|
9946
9951
|
if (allowedResults.length > 0) {
|
|
9947
9952
|
continue;
|
|
9948
9953
|
}
|
|
9949
|
-
|
|
9954
|
+
context2.report({
|
|
9950
9955
|
message: t("IncomingWebhook", {
|
|
9951
9956
|
URL: match
|
|
9952
9957
|
}),
|
|
@@ -9965,15 +9970,15 @@ var creator$p = {
|
|
|
9965
9970
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-slack/README.md"
|
|
9966
9971
|
}
|
|
9967
9972
|
},
|
|
9968
|
-
create(
|
|
9969
|
-
const t =
|
|
9973
|
+
create(context2, options) {
|
|
9974
|
+
const t = context2.createTranslator(messages$o);
|
|
9970
9975
|
const normalizedOptions = {
|
|
9971
9976
|
allows: options.allows || []
|
|
9972
9977
|
};
|
|
9973
9978
|
return {
|
|
9974
9979
|
file(source) {
|
|
9975
|
-
reportIfFoundRawPrivateKey$1({ source, options: normalizedOptions, context, t });
|
|
9976
|
-
reportIfFoundIncomingWebhook({ source, options: normalizedOptions, context, t });
|
|
9980
|
+
reportIfFoundRawPrivateKey$1({ source, options: normalizedOptions, context: context2, t });
|
|
9981
|
+
reportIfFoundIncomingWebhook({ source, options: normalizedOptions, context: context2, t });
|
|
9977
9982
|
}
|
|
9978
9983
|
};
|
|
9979
9984
|
}
|
|
@@ -10038,7 +10043,7 @@ function isLikelyRealPassword(password) {
|
|
|
10038
10043
|
return false;
|
|
10039
10044
|
return true;
|
|
10040
10045
|
}
|
|
10041
|
-
function reportIfFoundBasicAuth({ source, options, context, t }) {
|
|
10046
|
+
function reportIfFoundBasicAuth({ source, options, context: context2, t }) {
|
|
10042
10047
|
const URL_PATTERN = /(?<protocol>(?:https?|ftp|ftps)):\/\/(?<user>[-a-zA-Z0-9_]{1,256}):(?<password>[-a-zA-Z0-9_]{1,256})@[-a-zA-Z0-9%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b/g;
|
|
10043
10048
|
const results = source.content.matchAll(URL_PATTERN);
|
|
10044
10049
|
for (const result of results) {
|
|
@@ -10057,7 +10062,7 @@ function reportIfFoundBasicAuth({ source, options, context, t }) {
|
|
|
10057
10062
|
if (allowedResults.length > 0) {
|
|
10058
10063
|
continue;
|
|
10059
10064
|
}
|
|
10060
|
-
|
|
10065
|
+
context2.report({
|
|
10061
10066
|
message: t("BasicAuth", {
|
|
10062
10067
|
CREDENTIAL: match
|
|
10063
10068
|
}),
|
|
@@ -10076,14 +10081,14 @@ var creator$o = {
|
|
|
10076
10081
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-basicauth/README.md"
|
|
10077
10082
|
}
|
|
10078
10083
|
},
|
|
10079
|
-
create(
|
|
10080
|
-
const t =
|
|
10084
|
+
create(context2, options) {
|
|
10085
|
+
const t = context2.createTranslator(messages$n);
|
|
10081
10086
|
const normalizedOptions = {
|
|
10082
10087
|
allows: options.allows || []
|
|
10083
10088
|
};
|
|
10084
10089
|
return {
|
|
10085
10090
|
file(source) {
|
|
10086
|
-
reportIfFoundBasicAuth({ source, options: normalizedOptions, context, t });
|
|
10091
|
+
reportIfFoundBasicAuth({ source, options: normalizedOptions, context: context2, t });
|
|
10087
10092
|
}
|
|
10088
10093
|
};
|
|
10089
10094
|
}
|
|
@@ -10105,8 +10110,8 @@ var creator$n = {
|
|
|
10105
10110
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-openai/README.md"
|
|
10106
10111
|
}
|
|
10107
10112
|
},
|
|
10108
|
-
create(
|
|
10109
|
-
const t =
|
|
10113
|
+
create(context2) {
|
|
10114
|
+
const t = context2.createTranslator(messages$m);
|
|
10110
10115
|
return {
|
|
10111
10116
|
file(source) {
|
|
10112
10117
|
const pattern = /sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20}/g;
|
|
@@ -10115,7 +10120,7 @@ var creator$n = {
|
|
|
10115
10120
|
const index = match.index ?? 0;
|
|
10116
10121
|
const matchString = match[0] ?? "";
|
|
10117
10122
|
const range = [index, index + matchString.length];
|
|
10118
|
-
|
|
10123
|
+
context2.report({
|
|
10119
10124
|
message: t("OPENAI_TOKEN", {
|
|
10120
10125
|
TOKEN: matchString
|
|
10121
10126
|
}),
|
|
@@ -10143,8 +10148,8 @@ var creator$m = {
|
|
|
10143
10148
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-anthropic/README.md"
|
|
10144
10149
|
}
|
|
10145
10150
|
},
|
|
10146
|
-
create(
|
|
10147
|
-
const t =
|
|
10151
|
+
create(context2) {
|
|
10152
|
+
const t = context2.createTranslator(messages$l);
|
|
10148
10153
|
return {
|
|
10149
10154
|
file(source) {
|
|
10150
10155
|
const pattern = new RegExp("(?<!\\p{L})sk-ant-api0\\d-[A-Za-z0-9_-]{90,128}AA(?![A-Za-z0-9_-])", "gu");
|
|
@@ -10153,7 +10158,7 @@ var creator$m = {
|
|
|
10153
10158
|
const index = match.index ?? 0;
|
|
10154
10159
|
const matchString = match[0] ?? "";
|
|
10155
10160
|
const range = [index, index + matchString.length];
|
|
10156
|
-
|
|
10161
|
+
context2.report({
|
|
10157
10162
|
message: t("ANTHROPIC_API_KEY", {
|
|
10158
10163
|
KEY: matchString
|
|
10159
10164
|
}),
|
|
@@ -10181,8 +10186,8 @@ var creator$l = {
|
|
|
10181
10186
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-groq/README.md"
|
|
10182
10187
|
}
|
|
10183
10188
|
},
|
|
10184
|
-
create(
|
|
10185
|
-
const t =
|
|
10189
|
+
create(context2, options) {
|
|
10190
|
+
const t = context2.createTranslator(messages$k);
|
|
10186
10191
|
const normalizedOptions = {
|
|
10187
10192
|
allows: options?.allows ?? []
|
|
10188
10193
|
};
|
|
@@ -10198,7 +10203,7 @@ var creator$l = {
|
|
|
10198
10203
|
continue;
|
|
10199
10204
|
}
|
|
10200
10205
|
const range = [index, index + matchString.length];
|
|
10201
|
-
|
|
10206
|
+
context2.report({
|
|
10202
10207
|
message: t("GROQ_API_KEY", {
|
|
10203
10208
|
KEY: matchString
|
|
10204
10209
|
}),
|
|
@@ -10226,8 +10231,8 @@ var creator$k = {
|
|
|
10226
10231
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-huggingface/README.md"
|
|
10227
10232
|
}
|
|
10228
10233
|
},
|
|
10229
|
-
create(
|
|
10230
|
-
const t =
|
|
10234
|
+
create(context2, options) {
|
|
10235
|
+
const t = context2.createTranslator(messages$j);
|
|
10231
10236
|
const normalizedOptions = {
|
|
10232
10237
|
allows: options?.allows ?? []
|
|
10233
10238
|
};
|
|
@@ -10243,7 +10248,7 @@ var creator$k = {
|
|
|
10243
10248
|
continue;
|
|
10244
10249
|
}
|
|
10245
10250
|
const range = [index, index + matchString.length];
|
|
10246
|
-
|
|
10251
|
+
context2.report({
|
|
10247
10252
|
message: t("HUGGINGFACE_USER_ACCESS_TOKEN", {
|
|
10248
10253
|
TOKEN: matchString
|
|
10249
10254
|
}),
|
|
@@ -10271,8 +10276,8 @@ var creator$j = {
|
|
|
10271
10276
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-linear/README.md"
|
|
10272
10277
|
}
|
|
10273
10278
|
},
|
|
10274
|
-
create(
|
|
10275
|
-
const t =
|
|
10279
|
+
create(context2) {
|
|
10280
|
+
const t = context2.createTranslator(messages$i);
|
|
10276
10281
|
return {
|
|
10277
10282
|
file(source) {
|
|
10278
10283
|
const pattern = new RegExp("(?<!\\p{L})lin_api_[a-zA-Z0-9_]{32,128}(?![a-zA-Z0-9_])", "gu");
|
|
@@ -10281,7 +10286,7 @@ var creator$j = {
|
|
|
10281
10286
|
const index = match.index ?? 0;
|
|
10282
10287
|
const matchString = match[0] ?? "";
|
|
10283
10288
|
const range = [index, index + matchString.length];
|
|
10284
|
-
|
|
10289
|
+
context2.report({
|
|
10285
10290
|
message: t("LINEAR_API_TOKEN", {
|
|
10286
10291
|
ID: matchString
|
|
10287
10292
|
}),
|
|
@@ -10298,7 +10303,7 @@ var messages$h = {
|
|
|
10298
10303
|
ja: (props) => `Notion integration \u30C8\u30FC\u30AF\u30F3: ${props.TOKEN} \u304C\u307F\u3064\u304B\u308A\u307E\u3057\u305F`
|
|
10299
10304
|
}
|
|
10300
10305
|
};
|
|
10301
|
-
function reportIfFoundToken({ source, options, context, t }) {
|
|
10306
|
+
function reportIfFoundToken({ source, options, context: context2, t }) {
|
|
10302
10307
|
const NOTION_INTEGRATION_TOKEN_PATTERN = new RegExp("(?<!\\p{L})ntn_[0-9]{11}[A-Za-z0-9]{35}(?![A-Za-z0-9])", "gu");
|
|
10303
10308
|
const results = source.content.matchAll(NOTION_INTEGRATION_TOKEN_PATTERN);
|
|
10304
10309
|
for (const result of results) {
|
|
@@ -10309,7 +10314,7 @@ function reportIfFoundToken({ source, options, context, t }) {
|
|
|
10309
10314
|
if (allowedResults.length > 0) {
|
|
10310
10315
|
continue;
|
|
10311
10316
|
}
|
|
10312
|
-
|
|
10317
|
+
context2.report({
|
|
10313
10318
|
message: t("NOTION_INTEGRATION_TOKEN", {
|
|
10314
10319
|
TOKEN: match
|
|
10315
10320
|
}),
|
|
@@ -10328,14 +10333,14 @@ var creator$i = {
|
|
|
10328
10333
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-notion/README.md"
|
|
10329
10334
|
}
|
|
10330
10335
|
},
|
|
10331
|
-
create(
|
|
10332
|
-
const t =
|
|
10336
|
+
create(context2, options) {
|
|
10337
|
+
const t = context2.createTranslator(messages$h);
|
|
10333
10338
|
const normalizedOptions = {
|
|
10334
10339
|
allows: options.allows ?? []
|
|
10335
10340
|
};
|
|
10336
10341
|
return {
|
|
10337
10342
|
file(source) {
|
|
10338
|
-
reportIfFoundToken({ source, options: normalizedOptions, context, t });
|
|
10343
|
+
reportIfFoundToken({ source, options: normalizedOptions, context: context2, t });
|
|
10339
10344
|
}
|
|
10340
10345
|
};
|
|
10341
10346
|
}
|
|
@@ -10360,7 +10365,7 @@ function validateBase64KeyContent(base64Content) {
|
|
|
10360
10365
|
}
|
|
10361
10366
|
return true;
|
|
10362
10367
|
}
|
|
10363
|
-
function reportIfFoundRawPrivateKey({ source, options, context, t }) {
|
|
10368
|
+
function reportIfFoundRawPrivateKey({ source, options, context: context2, t }) {
|
|
10364
10369
|
const results = source.content.matchAll(PEM_CONTENT_PATTERN);
|
|
10365
10370
|
for (const result of results) {
|
|
10366
10371
|
const index = result.index || 0;
|
|
@@ -10375,7 +10380,7 @@ function reportIfFoundRawPrivateKey({ source, options, context, t }) {
|
|
|
10375
10380
|
if (!validateBase64KeyContent(base64Content)) {
|
|
10376
10381
|
continue;
|
|
10377
10382
|
}
|
|
10378
|
-
|
|
10383
|
+
context2.report({
|
|
10379
10384
|
message: t("PrivateKey", {
|
|
10380
10385
|
KEY: match
|
|
10381
10386
|
}),
|
|
@@ -10394,14 +10399,14 @@ var creator$h = {
|
|
|
10394
10399
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-privatekey/README.md"
|
|
10395
10400
|
}
|
|
10396
10401
|
},
|
|
10397
|
-
create(
|
|
10398
|
-
const t =
|
|
10402
|
+
create(context2, options) {
|
|
10403
|
+
const t = context2.createTranslator(messages$g);
|
|
10399
10404
|
const normalizedOptions = {
|
|
10400
10405
|
allows: options.allows || []
|
|
10401
10406
|
};
|
|
10402
10407
|
return {
|
|
10403
10408
|
file(source) {
|
|
10404
|
-
reportIfFoundRawPrivateKey({ source, options: normalizedOptions, context, t });
|
|
10409
|
+
reportIfFoundRawPrivateKey({ source, options: normalizedOptions, context: context2, t });
|
|
10405
10410
|
}
|
|
10406
10411
|
};
|
|
10407
10412
|
}
|
|
@@ -10412,7 +10417,7 @@ var messages$f = {
|
|
|
10412
10417
|
ja: (props) => `Sendgrid API\u30AD\u30FC\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\uFF1A ${props.KEY}`
|
|
10413
10418
|
}
|
|
10414
10419
|
};
|
|
10415
|
-
function reportIfFoundKey$3({ source, options, context, t }) {
|
|
10420
|
+
function reportIfFoundKey$3({ source, options, context: context2, t }) {
|
|
10416
10421
|
const SENDGRID_KEY_PATTERN = new RegExp("(?<!\\p{L})SG\\.\\w{1,128}\\.\\w{1,128}([-_]?)\\w{1,128}(?!\\w)", "gu");
|
|
10417
10422
|
const results = source.content.matchAll(SENDGRID_KEY_PATTERN);
|
|
10418
10423
|
for (const result of results) {
|
|
@@ -10426,7 +10431,7 @@ function reportIfFoundKey$3({ source, options, context, t }) {
|
|
|
10426
10431
|
if (allowedResults.length > 0) {
|
|
10427
10432
|
continue;
|
|
10428
10433
|
}
|
|
10429
|
-
|
|
10434
|
+
context2.report({
|
|
10430
10435
|
message: t("SENDGRID_KEY", {
|
|
10431
10436
|
KEY: match
|
|
10432
10437
|
}),
|
|
@@ -10445,14 +10450,14 @@ var creator$g = {
|
|
|
10445
10450
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-sendgrid/README.md"
|
|
10446
10451
|
}
|
|
10447
10452
|
},
|
|
10448
|
-
create(
|
|
10449
|
-
const t =
|
|
10453
|
+
create(context2, options) {
|
|
10454
|
+
const t = context2.createTranslator(messages$f);
|
|
10450
10455
|
const normalizedOptions = {
|
|
10451
10456
|
allows: options.allows || []
|
|
10452
10457
|
};
|
|
10453
10458
|
return {
|
|
10454
10459
|
file(source) {
|
|
10455
|
-
reportIfFoundKey$3({ source, options: normalizedOptions, context, t });
|
|
10460
|
+
reportIfFoundKey$3({ source, options: normalizedOptions, context: context2, t });
|
|
10456
10461
|
}
|
|
10457
10462
|
};
|
|
10458
10463
|
}
|
|
@@ -10463,7 +10468,7 @@ var messages$e = {
|
|
|
10463
10468
|
ja: (props) => `Shopify API\u30AD\u30FC\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\uFF1A ${props.KEY}`
|
|
10464
10469
|
}
|
|
10465
10470
|
};
|
|
10466
|
-
function reportIfFoundKey$2({ source, options, context, t }) {
|
|
10471
|
+
function reportIfFoundKey$2({ source, options, context: context2, t }) {
|
|
10467
10472
|
const SHOPIFY_KEY_PATTERN = new RegExp("(?<!\\p{L})(shppa|shpca|shpat|shpss)_[a-zA-Z0-9]{32,64}(?![a-zA-Z0-9])", "gu");
|
|
10468
10473
|
const results = source.content.matchAll(SHOPIFY_KEY_PATTERN);
|
|
10469
10474
|
for (const result of results) {
|
|
@@ -10474,7 +10479,7 @@ function reportIfFoundKey$2({ source, options, context, t }) {
|
|
|
10474
10479
|
if (allowedResults.length > 0) {
|
|
10475
10480
|
continue;
|
|
10476
10481
|
}
|
|
10477
|
-
|
|
10482
|
+
context2.report({
|
|
10478
10483
|
message: t("SHOPIFY_KEY", {
|
|
10479
10484
|
KEY: match
|
|
10480
10485
|
}),
|
|
@@ -10493,14 +10498,14 @@ var creator$f = {
|
|
|
10493
10498
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-shopify/README.md"
|
|
10494
10499
|
}
|
|
10495
10500
|
},
|
|
10496
|
-
create(
|
|
10497
|
-
const t =
|
|
10501
|
+
create(context2, options) {
|
|
10502
|
+
const t = context2.createTranslator(messages$e);
|
|
10498
10503
|
const normalizedOptions = {
|
|
10499
10504
|
allows: options.allows || []
|
|
10500
10505
|
};
|
|
10501
10506
|
return {
|
|
10502
10507
|
file(source) {
|
|
10503
|
-
reportIfFoundKey$2({ source, options: normalizedOptions, context, t });
|
|
10508
|
+
reportIfFoundKey$2({ source, options: normalizedOptions, context: context2, t });
|
|
10504
10509
|
}
|
|
10505
10510
|
};
|
|
10506
10511
|
}
|
|
@@ -10530,7 +10535,7 @@ var messageIdMap$1 = {
|
|
|
10530
10535
|
rk_test: "STRIPE_RESTRICTED_KEY_TEST"
|
|
10531
10536
|
};
|
|
10532
10537
|
var STRIPE_KEY_PATTERN = new RegExp("(?<!\\p{L})(?<prefix>sk_live|sk_test|rk_live|rk_test)_[a-zA-Z0-9]{24,99}(?![a-zA-Z0-9])", "gu");
|
|
10533
|
-
function reportIfFound$2({ source, options, context, t }) {
|
|
10538
|
+
function reportIfFound$2({ source, options, context: context2, t }) {
|
|
10534
10539
|
const results = source.content.matchAll(STRIPE_KEY_PATTERN);
|
|
10535
10540
|
for (const result of results) {
|
|
10536
10541
|
const index = result.index ?? 0;
|
|
@@ -10544,7 +10549,7 @@ function reportIfFound$2({ source, options, context, t }) {
|
|
|
10544
10549
|
if (allowedResults.length > 0) {
|
|
10545
10550
|
continue;
|
|
10546
10551
|
}
|
|
10547
|
-
|
|
10552
|
+
context2.report({
|
|
10548
10553
|
message: t(messageIdMap$1[prefix], {
|
|
10549
10554
|
KEY: match
|
|
10550
10555
|
}),
|
|
@@ -10563,14 +10568,14 @@ var creator$e = {
|
|
|
10563
10568
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-stripe/README.md"
|
|
10564
10569
|
}
|
|
10565
10570
|
},
|
|
10566
|
-
create(
|
|
10567
|
-
const t =
|
|
10571
|
+
create(context2, options) {
|
|
10572
|
+
const t = context2.createTranslator(messages$d);
|
|
10568
10573
|
const normalizedOptions = {
|
|
10569
10574
|
allows: options.allows ?? []
|
|
10570
10575
|
};
|
|
10571
10576
|
return {
|
|
10572
10577
|
file(source) {
|
|
10573
|
-
reportIfFound$2({ source, options: normalizedOptions, context, t });
|
|
10578
|
+
reportIfFound$2({ source, options: normalizedOptions, context: context2, t });
|
|
10574
10579
|
}
|
|
10575
10580
|
};
|
|
10576
10581
|
}
|
|
@@ -10589,7 +10594,7 @@ var typeMap = /* @__PURE__ */ new Map([
|
|
|
10589
10594
|
["ghr", "refresh tokens"],
|
|
10590
10595
|
["github_pat", "fine-grained personal access tokens"]
|
|
10591
10596
|
]);
|
|
10592
|
-
function reportIfFoundKey$1({ pattern, source, options, context, t }) {
|
|
10597
|
+
function reportIfFoundKey$1({ pattern, source, options, context: context2, t }) {
|
|
10593
10598
|
const results = source.content.matchAll(pattern);
|
|
10594
10599
|
for (const result of results) {
|
|
10595
10600
|
const index = result.index || 0;
|
|
@@ -10604,7 +10609,7 @@ function reportIfFoundKey$1({ pattern, source, options, context, t }) {
|
|
|
10604
10609
|
if (allowedResults.length > 0) {
|
|
10605
10610
|
continue;
|
|
10606
10611
|
}
|
|
10607
|
-
|
|
10612
|
+
context2.report({
|
|
10608
10613
|
message: t("GITHUB_TOKEN", {
|
|
10609
10614
|
KEY: match,
|
|
10610
10615
|
typeName
|
|
@@ -10624,7 +10629,7 @@ var creator$d = {
|
|
|
10624
10629
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-github/README.md"
|
|
10625
10630
|
}
|
|
10626
10631
|
},
|
|
10627
|
-
create(
|
|
10632
|
+
create(context2, options) {
|
|
10628
10633
|
const CLASSIC_GITHUB_TOKEN_PATTERN = new RegExp("(?<!\\p{L})(?<type>ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{36}(?![A-Za-z0-9_])", "gu");
|
|
10629
10634
|
const FINE_GRAINED_GITHUB_TOKEN_PATTERN = new RegExp("(?<!\\p{L})(?<type>github_pat)_[A-Za-z0-9_]{82}(?![A-Za-z0-9_])", "gu");
|
|
10630
10635
|
const GITHUB_APP_INSTALLATION_TOKEN_PATTERN = new RegExp("(?<!\\p{L})(?<type>ghs)_[0-9]{1,20}_[A-Za-z0-9_-]{1,1000}\\.[A-Za-z0-9_-]{1,10000}\\.[A-Za-z0-9_-]{1,1000}(?![A-Za-z0-9_-])", "gu");
|
|
@@ -10633,14 +10638,14 @@ var creator$d = {
|
|
|
10633
10638
|
FINE_GRAINED_GITHUB_TOKEN_PATTERN,
|
|
10634
10639
|
GITHUB_APP_INSTALLATION_TOKEN_PATTERN
|
|
10635
10640
|
];
|
|
10636
|
-
const t =
|
|
10641
|
+
const t = context2.createTranslator(messages$c);
|
|
10637
10642
|
const normalizedOptions = {
|
|
10638
10643
|
allows: options.allows || []
|
|
10639
10644
|
};
|
|
10640
10645
|
return {
|
|
10641
10646
|
file(source) {
|
|
10642
10647
|
for (const pattern of patterns) {
|
|
10643
|
-
reportIfFoundKey$1({ pattern, source, options: normalizedOptions, context, t });
|
|
10648
|
+
reportIfFoundKey$1({ pattern, source, options: normalizedOptions, context: context2, t });
|
|
10644
10649
|
}
|
|
10645
10650
|
}
|
|
10646
10651
|
};
|
|
@@ -10652,7 +10657,7 @@ var messages$b = {
|
|
|
10652
10657
|
ja: (props) => `GitLab Personal Access Token\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: ${props.KEY}`
|
|
10653
10658
|
}
|
|
10654
10659
|
};
|
|
10655
|
-
function reportIfFoundKey({ pattern, source, options, context, t }) {
|
|
10660
|
+
function reportIfFoundKey({ pattern, source, options, context: context2, t }) {
|
|
10656
10661
|
const results = source.content.matchAll(pattern);
|
|
10657
10662
|
for (const result of results) {
|
|
10658
10663
|
const index = result.index ?? 0;
|
|
@@ -10662,7 +10667,7 @@ function reportIfFoundKey({ pattern, source, options, context, t }) {
|
|
|
10662
10667
|
if (allowedResults.length > 0) {
|
|
10663
10668
|
continue;
|
|
10664
10669
|
}
|
|
10665
|
-
|
|
10670
|
+
context2.report({
|
|
10666
10671
|
message: t("GITLAB_PERSONAL_ACCESS_TOKEN", {
|
|
10667
10672
|
KEY: match
|
|
10668
10673
|
}),
|
|
@@ -10681,17 +10686,17 @@ var creator$c = {
|
|
|
10681
10686
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-gitlab/README.md"
|
|
10682
10687
|
}
|
|
10683
10688
|
},
|
|
10684
|
-
create(
|
|
10689
|
+
create(context2, options) {
|
|
10685
10690
|
const GITLAB_PERSONAL_ACCESS_TOKEN_PATTERN = new RegExp("(?<!\\p{L})glpat-[A-Za-z0-9_-]{20,128}(?![A-Za-z0-9_-])", "gu");
|
|
10686
10691
|
const patterns = [GITLAB_PERSONAL_ACCESS_TOKEN_PATTERN];
|
|
10687
|
-
const t =
|
|
10692
|
+
const t = context2.createTranslator(messages$b);
|
|
10688
10693
|
const normalizedOptions = {
|
|
10689
10694
|
allows: options.allows ?? []
|
|
10690
10695
|
};
|
|
10691
10696
|
return {
|
|
10692
10697
|
file(source) {
|
|
10693
10698
|
for (const pattern of patterns) {
|
|
10694
|
-
reportIfFoundKey({ pattern, source, options: normalizedOptions, context, t });
|
|
10699
|
+
reportIfFoundKey({ pattern, source, options: normalizedOptions, context: context2, t });
|
|
10695
10700
|
}
|
|
10696
10701
|
}
|
|
10697
10702
|
};
|
|
@@ -10707,7 +10712,7 @@ var messages$a = {
|
|
|
10707
10712
|
ja: (props) => `Grafana Service Account \u30C8\u30FC\u30AF\u30F3: ${props.TOKEN} \u304C\u307F\u3064\u304B\u308A\u307E\u3057\u305F`
|
|
10708
10713
|
}
|
|
10709
10714
|
};
|
|
10710
|
-
function reportIfFound$1({ pattern, messageId, source, options, context, t }) {
|
|
10715
|
+
function reportIfFound$1({ pattern, messageId, source, options, context: context2, t }) {
|
|
10711
10716
|
const results = source.content.matchAll(pattern);
|
|
10712
10717
|
for (const result of results) {
|
|
10713
10718
|
const index = result.index ?? 0;
|
|
@@ -10717,7 +10722,7 @@ function reportIfFound$1({ pattern, messageId, source, options, context, t }) {
|
|
|
10717
10722
|
continue;
|
|
10718
10723
|
}
|
|
10719
10724
|
const range = [index, index + match.length];
|
|
10720
|
-
|
|
10725
|
+
context2.report({
|
|
10721
10726
|
message: t(messageId, {
|
|
10722
10727
|
TOKEN: match
|
|
10723
10728
|
}),
|
|
@@ -10736,8 +10741,8 @@ var creator$b = {
|
|
|
10736
10741
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-grafana/README.md"
|
|
10737
10742
|
}
|
|
10738
10743
|
},
|
|
10739
|
-
create(
|
|
10740
|
-
const t =
|
|
10744
|
+
create(context2, options) {
|
|
10745
|
+
const t = context2.createTranslator(messages$a);
|
|
10741
10746
|
const normalizedOptions = {
|
|
10742
10747
|
allows: options?.allows ?? []
|
|
10743
10748
|
};
|
|
@@ -10750,7 +10755,7 @@ var creator$b = {
|
|
|
10750
10755
|
messageId: "GRAFANA_CLOUD_API_TOKEN",
|
|
10751
10756
|
source,
|
|
10752
10757
|
options: normalizedOptions,
|
|
10753
|
-
context,
|
|
10758
|
+
context: context2,
|
|
10754
10759
|
t
|
|
10755
10760
|
});
|
|
10756
10761
|
reportIfFound$1({
|
|
@@ -10758,7 +10763,7 @@ var creator$b = {
|
|
|
10758
10763
|
messageId: "GRAFANA_SERVICE_ACCOUNT_TOKEN",
|
|
10759
10764
|
source,
|
|
10760
10765
|
options: normalizedOptions,
|
|
10761
|
-
context,
|
|
10766
|
+
context: context2,
|
|
10762
10767
|
t
|
|
10763
10768
|
});
|
|
10764
10769
|
}
|
|
@@ -10791,8 +10796,8 @@ var creator$a = {
|
|
|
10791
10796
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-1password/README.md"
|
|
10792
10797
|
}
|
|
10793
10798
|
},
|
|
10794
|
-
create(
|
|
10795
|
-
const t =
|
|
10799
|
+
create(context2, options) {
|
|
10800
|
+
const t = context2.createTranslator(messages$9);
|
|
10796
10801
|
const normalizedOptions = {
|
|
10797
10802
|
allows: options?.allows ?? []
|
|
10798
10803
|
};
|
|
@@ -10812,7 +10817,7 @@ var creator$a = {
|
|
|
10812
10817
|
continue;
|
|
10813
10818
|
}
|
|
10814
10819
|
const range = [index, index + matchString.length];
|
|
10815
|
-
|
|
10820
|
+
context2.report({
|
|
10816
10821
|
message: t("OPS_TOKEN", {
|
|
10817
10822
|
TOKEN: matchString
|
|
10818
10823
|
}),
|
|
@@ -10894,7 +10899,7 @@ function isLikelyRealCredential(username, password) {
|
|
|
10894
10899
|
return false;
|
|
10895
10900
|
return true;
|
|
10896
10901
|
}
|
|
10897
|
-
function reportMongoDBConnectionString({ source, options, context, t }) {
|
|
10902
|
+
function reportMongoDBConnectionString({ source, options, context: context2, t }) {
|
|
10898
10903
|
const MONGODB_PATTERN = /mongodb(?:\+srv)?:\/\/(?:(?<username>[^:\/\s]{1,100}):(?<password>[^@\/\s]{1,200})@)?(?<host>[^\/\s?]{1,100})(?:\/(?<database>[^?\s]{0,100}))?(?:\?(?<options>[^\s]{0,500}))?/gi;
|
|
10899
10904
|
const results = source.content.matchAll(MONGODB_PATTERN);
|
|
10900
10905
|
for (const result of results) {
|
|
@@ -10911,7 +10916,7 @@ function reportMongoDBConnectionString({ source, options, context, t }) {
|
|
|
10911
10916
|
if (allowedResults.length > 0) {
|
|
10912
10917
|
continue;
|
|
10913
10918
|
}
|
|
10914
|
-
|
|
10919
|
+
context2.report({
|
|
10915
10920
|
message: t("MongoDBConnection", {
|
|
10916
10921
|
URI: match
|
|
10917
10922
|
}),
|
|
@@ -10919,7 +10924,7 @@ function reportMongoDBConnectionString({ source, options, context, t }) {
|
|
|
10919
10924
|
});
|
|
10920
10925
|
}
|
|
10921
10926
|
}
|
|
10922
|
-
function reportMySQLConnectionString({ source, options, context, t }) {
|
|
10927
|
+
function reportMySQLConnectionString({ source, options, context: context2, t }) {
|
|
10923
10928
|
const MYSQL_URI_PATTERN = /(?:jdbc:)?mysql(?:x)?:\/\/(?:(?<username>[^:\/\s]{1,100}):(?<password>[^@\/\s]{1,200})@)?(?<host>[^\/\s?]{1,100})(?:\/(?<database>[^?\s]{0,100}))?(?:\?(?<options>[^\s]{0,500}))?/gi;
|
|
10924
10929
|
const results = source.content.matchAll(MYSQL_URI_PATTERN);
|
|
10925
10930
|
for (const result of results) {
|
|
@@ -10936,7 +10941,7 @@ function reportMySQLConnectionString({ source, options, context, t }) {
|
|
|
10936
10941
|
if (allowedResults.length > 0) {
|
|
10937
10942
|
continue;
|
|
10938
10943
|
}
|
|
10939
|
-
|
|
10944
|
+
context2.report({
|
|
10940
10945
|
message: t("MySQLConnection", {
|
|
10941
10946
|
URI: match
|
|
10942
10947
|
}),
|
|
@@ -10944,7 +10949,7 @@ function reportMySQLConnectionString({ source, options, context, t }) {
|
|
|
10944
10949
|
});
|
|
10945
10950
|
}
|
|
10946
10951
|
}
|
|
10947
|
-
function reportPostgreSQLConnectionString({ source, options, context, t }) {
|
|
10952
|
+
function reportPostgreSQLConnectionString({ source, options, context: context2, t }) {
|
|
10948
10953
|
const POSTGRESQL_URI_PATTERN = /postgres(?:ql)?:\/\/(?:(?<username>[^:\/\s]{1,100}):(?<password>[^@\/\s]{1,200})@)?(?<host>[^\/\s?]{1,100})(?:\/(?<database>[^?\s]{0,100}))?(?:\?(?<options>[^\s]{0,500}))?/gi;
|
|
10949
10954
|
const results = source.content.matchAll(POSTGRESQL_URI_PATTERN);
|
|
10950
10955
|
for (const result of results) {
|
|
@@ -10961,7 +10966,7 @@ function reportPostgreSQLConnectionString({ source, options, context, t }) {
|
|
|
10961
10966
|
if (allowedResults.length > 0) {
|
|
10962
10967
|
continue;
|
|
10963
10968
|
}
|
|
10964
|
-
|
|
10969
|
+
context2.report({
|
|
10965
10970
|
message: t("PostgreSQLConnection", {
|
|
10966
10971
|
URI: match
|
|
10967
10972
|
}),
|
|
@@ -10980,16 +10985,16 @@ var creator$9 = {
|
|
|
10980
10985
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-database-connection-string/README.md"
|
|
10981
10986
|
}
|
|
10982
10987
|
},
|
|
10983
|
-
create(
|
|
10988
|
+
create(context2, options) {
|
|
10984
10989
|
const normalizedOptions = {
|
|
10985
10990
|
allows: options.allows || []
|
|
10986
10991
|
};
|
|
10987
|
-
const t =
|
|
10992
|
+
const t = context2.createTranslator(messages$8);
|
|
10988
10993
|
return {
|
|
10989
10994
|
file(source) {
|
|
10990
|
-
reportMongoDBConnectionString({ source, options: normalizedOptions, context, t });
|
|
10991
|
-
reportMySQLConnectionString({ source, options: normalizedOptions, context, t });
|
|
10992
|
-
reportPostgreSQLConnectionString({ source, options: normalizedOptions, context, t });
|
|
10995
|
+
reportMongoDBConnectionString({ source, options: normalizedOptions, context: context2, t });
|
|
10996
|
+
reportMySQLConnectionString({ source, options: normalizedOptions, context: context2, t });
|
|
10997
|
+
reportPostgreSQLConnectionString({ source, options: normalizedOptions, context: context2, t });
|
|
10993
10998
|
}
|
|
10994
10999
|
};
|
|
10995
11000
|
}
|
|
@@ -11022,8 +11027,8 @@ var creator$8 = {
|
|
|
11022
11027
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-hashicorp-vault/README.md"
|
|
11023
11028
|
}
|
|
11024
11029
|
},
|
|
11025
|
-
create(
|
|
11026
|
-
const t =
|
|
11030
|
+
create(context2, options) {
|
|
11031
|
+
const t = context2.createTranslator(messages$7);
|
|
11027
11032
|
const normalizedOptions = {
|
|
11028
11033
|
allows: options?.allows ?? []
|
|
11029
11034
|
};
|
|
@@ -11037,7 +11042,7 @@ var creator$8 = {
|
|
|
11037
11042
|
continue;
|
|
11038
11043
|
}
|
|
11039
11044
|
const range = [index, index + matchString.length];
|
|
11040
|
-
|
|
11045
|
+
context2.report({
|
|
11041
11046
|
message: t(messageId, {
|
|
11042
11047
|
TOKEN: matchString
|
|
11043
11048
|
}),
|
|
@@ -11094,8 +11099,8 @@ var creator$7 = {
|
|
|
11094
11099
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-vercel/README.md"
|
|
11095
11100
|
}
|
|
11096
11101
|
},
|
|
11097
|
-
create(
|
|
11098
|
-
const t =
|
|
11102
|
+
create(context2, options) {
|
|
11103
|
+
const t = context2.createTranslator(messages$6);
|
|
11099
11104
|
const normalizedOptions = {
|
|
11100
11105
|
allows: options?.allows ?? []
|
|
11101
11106
|
};
|
|
@@ -11113,7 +11118,7 @@ var creator$7 = {
|
|
|
11113
11118
|
continue;
|
|
11114
11119
|
}
|
|
11115
11120
|
const range = [index, index + matchString.length];
|
|
11116
|
-
|
|
11121
|
+
context2.report({
|
|
11117
11122
|
message: t(messageId, {
|
|
11118
11123
|
ID: matchString
|
|
11119
11124
|
}),
|
|
@@ -11141,8 +11146,8 @@ var creator$6 = {
|
|
|
11141
11146
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-databricks/README.md"
|
|
11142
11147
|
}
|
|
11143
11148
|
},
|
|
11144
|
-
create(
|
|
11145
|
-
const t =
|
|
11149
|
+
create(context2, options) {
|
|
11150
|
+
const t = context2.createTranslator(messages$5);
|
|
11146
11151
|
const normalizedOptions = {
|
|
11147
11152
|
allows: options?.allows ?? []
|
|
11148
11153
|
};
|
|
@@ -11158,7 +11163,7 @@ var creator$6 = {
|
|
|
11158
11163
|
continue;
|
|
11159
11164
|
}
|
|
11160
11165
|
const range = [index, index + matchString.length];
|
|
11161
|
-
|
|
11166
|
+
context2.report({
|
|
11162
11167
|
message: t("DATABRICKS_PERSONAL_ACCESS_TOKEN", {
|
|
11163
11168
|
ID: matchString
|
|
11164
11169
|
}),
|
|
@@ -11175,7 +11180,7 @@ var messages$4 = {
|
|
|
11175
11180
|
ja: (props) => `Docker Personal Access Token: ${props.TOKEN} \u304C\u307F\u3064\u304B\u308A\u307E\u3057\u305F`
|
|
11176
11181
|
}
|
|
11177
11182
|
};
|
|
11178
|
-
function reportIfFoundDockerPAT({ source, options, context, t }) {
|
|
11183
|
+
function reportIfFoundDockerPAT({ source, options, context: context2, t }) {
|
|
11179
11184
|
const DOCKER_PAT_PATTERN = new RegExp("(?<!\\p{L})dckr_pat_[a-zA-Z0-9_-]{27}(?![a-zA-Z0-9_-])", "gu");
|
|
11180
11185
|
const results = source.content.matchAll(DOCKER_PAT_PATTERN);
|
|
11181
11186
|
for (const result of results) {
|
|
@@ -11186,7 +11191,7 @@ function reportIfFoundDockerPAT({ source, options, context, t }) {
|
|
|
11186
11191
|
if (allowedResults.length > 0) {
|
|
11187
11192
|
continue;
|
|
11188
11193
|
}
|
|
11189
|
-
|
|
11194
|
+
context2.report({
|
|
11190
11195
|
message: t("DOCKER_PERSONAL_ACCESS_TOKEN", {
|
|
11191
11196
|
TOKEN: match
|
|
11192
11197
|
}),
|
|
@@ -11205,14 +11210,14 @@ var creator$5 = {
|
|
|
11205
11210
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-docker/README.md"
|
|
11206
11211
|
}
|
|
11207
11212
|
},
|
|
11208
|
-
create(
|
|
11209
|
-
const t =
|
|
11213
|
+
create(context2, options) {
|
|
11214
|
+
const t = context2.createTranslator(messages$4);
|
|
11210
11215
|
const normalizedOptions = {
|
|
11211
11216
|
allows: options.allows || []
|
|
11212
11217
|
};
|
|
11213
11218
|
return {
|
|
11214
11219
|
file(source) {
|
|
11215
|
-
reportIfFoundDockerPAT({ source, options: normalizedOptions, context, t });
|
|
11220
|
+
reportIfFoundDockerPAT({ source, options: normalizedOptions, context: context2, t });
|
|
11216
11221
|
}
|
|
11217
11222
|
};
|
|
11218
11223
|
}
|
|
@@ -11234,8 +11239,8 @@ var creator$4 = {
|
|
|
11234
11239
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-figma/README.md"
|
|
11235
11240
|
}
|
|
11236
11241
|
},
|
|
11237
|
-
create(
|
|
11238
|
-
const t =
|
|
11242
|
+
create(context2, options) {
|
|
11243
|
+
const t = context2.createTranslator(messages$3);
|
|
11239
11244
|
const normalizedOptions = {
|
|
11240
11245
|
allows: options?.allows ?? []
|
|
11241
11246
|
};
|
|
@@ -11251,7 +11256,7 @@ var creator$4 = {
|
|
|
11251
11256
|
continue;
|
|
11252
11257
|
}
|
|
11253
11258
|
const range = [index, index + matchString.length];
|
|
11254
|
-
|
|
11259
|
+
context2.report({
|
|
11255
11260
|
message: t("FIGMA_PERSONAL_ACCESS_TOKEN", {
|
|
11256
11261
|
ID: matchString
|
|
11257
11262
|
}),
|
|
@@ -11282,7 +11287,7 @@ var messageIdMap = {
|
|
|
11282
11287
|
cfat: "CLOUDFLARE_ACCOUNT_API_TOKEN"
|
|
11283
11288
|
};
|
|
11284
11289
|
var CLOUDFLARE_TOKEN_PATTERN = new RegExp("(?<!\\p{L})(?<prefix>cfk|cfut|cfat)_[A-Za-z0-9]{40}[0-9a-f]{8}(?![A-Za-z0-9])", "gu");
|
|
11285
|
-
function reportIfFound({ source, options, context, t }) {
|
|
11290
|
+
function reportIfFound({ source, options, context: context2, t }) {
|
|
11286
11291
|
const results = source.content.matchAll(CLOUDFLARE_TOKEN_PATTERN);
|
|
11287
11292
|
for (const result of results) {
|
|
11288
11293
|
const index = result.index ?? 0;
|
|
@@ -11296,7 +11301,7 @@ function reportIfFound({ source, options, context, t }) {
|
|
|
11296
11301
|
if (allowedResults.length > 0) {
|
|
11297
11302
|
continue;
|
|
11298
11303
|
}
|
|
11299
|
-
|
|
11304
|
+
context2.report({
|
|
11300
11305
|
message: t(messageIdMap[prefix], {
|
|
11301
11306
|
TOKEN: match
|
|
11302
11307
|
}),
|
|
@@ -11315,14 +11320,14 @@ var creator$3 = {
|
|
|
11315
11320
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-cloudflare/README.md"
|
|
11316
11321
|
}
|
|
11317
11322
|
},
|
|
11318
|
-
create(
|
|
11319
|
-
const t =
|
|
11323
|
+
create(context2, options) {
|
|
11324
|
+
const t = context2.createTranslator(messages$2);
|
|
11320
11325
|
const normalizedOptions = {
|
|
11321
11326
|
allows: options.allows ?? []
|
|
11322
11327
|
};
|
|
11323
11328
|
return {
|
|
11324
11329
|
file(source) {
|
|
11325
|
-
reportIfFound({ source, options: normalizedOptions, context, t });
|
|
11330
|
+
reportIfFound({ source, options: normalizedOptions, context: context2, t });
|
|
11326
11331
|
}
|
|
11327
11332
|
};
|
|
11328
11333
|
}
|
|
@@ -11371,8 +11376,8 @@ var creator$2 = {
|
|
|
11371
11376
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-tailscale/README.md"
|
|
11372
11377
|
}
|
|
11373
11378
|
},
|
|
11374
|
-
create(
|
|
11375
|
-
const t =
|
|
11379
|
+
create(context2, options) {
|
|
11380
|
+
const t = context2.createTranslator(messages$1);
|
|
11376
11381
|
const normalizedOptions = {
|
|
11377
11382
|
allows: options.allows ?? []
|
|
11378
11383
|
};
|
|
@@ -11390,7 +11395,7 @@ var creator$2 = {
|
|
|
11390
11395
|
continue;
|
|
11391
11396
|
}
|
|
11392
11397
|
const messageId = messageIdByType[type] ?? "TAILSCALE_KEY";
|
|
11393
|
-
|
|
11398
|
+
context2.report({
|
|
11394
11399
|
message: t(messageId, {
|
|
11395
11400
|
KEY: matchString
|
|
11396
11401
|
}),
|
|
@@ -11552,8 +11557,8 @@ var creator$1 = {
|
|
|
11552
11557
|
url: "https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-filter-comments/README.md"
|
|
11553
11558
|
}
|
|
11554
11559
|
},
|
|
11555
|
-
create(
|
|
11556
|
-
const t =
|
|
11560
|
+
create(context2) {
|
|
11561
|
+
const t = context2.createTranslator(messages);
|
|
11557
11562
|
return {
|
|
11558
11563
|
file(source) {
|
|
11559
11564
|
const state = new CommentState(source);
|
|
@@ -11570,7 +11575,7 @@ var creator$1 = {
|
|
|
11570
11575
|
}
|
|
11571
11576
|
}
|
|
11572
11577
|
state.getIgnoringMessages().forEach((message) => {
|
|
11573
|
-
|
|
11578
|
+
context2.ignore({
|
|
11574
11579
|
message: t("IGNORE_MESSAGE"),
|
|
11575
11580
|
range: [message.startIndex, message.endIndex],
|
|
11576
11581
|
targetRuleId: message.ruleId
|
|
@@ -11711,9 +11716,10 @@ var SCAN_PAUSE_OUTBOX_BYTES = 32 * 1024 * 1024;
|
|
|
11711
11716
|
var UTF8_DECODER = new TextDecoder("utf-8", { fatal: true });
|
|
11712
11717
|
|
|
11713
11718
|
// src/logger.ts
|
|
11714
|
-
|
|
11719
|
+
var context = () => ({
|
|
11715
11720
|
runtimeVersion: process.env.ITERATION_RUNTIME_VERSION ?? null
|
|
11716
|
-
})
|
|
11721
|
+
});
|
|
11722
|
+
configureCollectorLogging(context);
|
|
11717
11723
|
|
|
11718
11724
|
// src/runtime.ts
|
|
11719
11725
|
import { promises as fs2 } from "node:fs";
|