chore: fix some typos (#2666)

This commit is contained in:
redismongo
2024-04-04 05:50:47 -07:00
committed by GitHub
parent a8132839f8
commit f1957fec59
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ If you think that something should be included outside of these guidelines, plea
### Adding New Token Formats to an Existing Scanner
In some instances, services will update their token format, requiring a new regex to properly detect secrets in addition to supporting the previous token format. Accomodating this can be done without adding a net-new detector. [We provide a `Versioner` interface](https://github.com/trufflesecurity/trufflehog/blob/e18cfd5e0af1469a9f05b8d5732bcc94c39da49c/pkg/detectors/detectors.go#L30) that can be implemented.
In some instances, services will update their token format, requiring a new regex to properly detect secrets in addition to supporting the previous token format. Accommodating this can be done without adding a net-new detector. [We provide a `Versioner` interface](https://github.com/trufflesecurity/trufflehog/blob/e18cfd5e0af1469a9f05b8d5732bcc94c39da49c/pkg/detectors/detectors.go#L30) that can be implemented.
1. Create two new directories `v1` and `v2`. Move the existing detector and tests into `v1`, and add new files to `v2`.
Ex: `<packagename>/<old_files>` -> `<packagename>/v1/<old_files>`, `<packagename>/v2/<new_files>`
+1 -1
View File
@@ -42,7 +42,7 @@ If you think that something should be included outside of these guidelines, plea
### Adding New Token Formats to an Existing Scanner
In some instances, services will update their token format, requiring a new regex to properly detect secrets in addition to supporting the previous token format. Accomodating this can be done without adding a net-new detector. [We provide a `Versioner` interface](https://github.com/trufflesecurity/trufflehog/blob/e18cfd5e0af1469a9f05b8d5732bcc94c39da49c/pkg/detectors/detectors.go#L30) that can be implemented.
In some instances, services will update their token format, requiring a new regex to properly detect secrets in addition to supporting the previous token format. Accommodating this can be done without adding a net-new detector. [We provide a `Versioner` interface](https://github.com/trufflesecurity/trufflehog/blob/e18cfd5e0af1469a9f05b8d5732bcc94c39da49c/pkg/detectors/detectors.go#L30) that can be implemented.
1. Create two new directories `v1` and `v2`. Move the existing detector and tests into `v1`, and add new files to `v2`.
Ex: `<packagename>/<old_files>` -> `<packagename>/v1/<old_files>`, `<packagename>/v2/<new_files>`
@@ -75,7 +75,7 @@ func TestCoinbaseWaaS_Pattern(t *testing.T) {
shouldMatch: true,
match: "organizations/7eead2d5-fa48-4423-8f40-c70d8ce398ae/apiKeys/7b9516b6-d82e-44e8-bed5-89b160452ed9:-----BEGIN ECDSA PRIVATE KEY-----\nMHcCAQEEINQdZMbF2r07KF0mxfLYt9Y1PNaC0C6UpZ31MxD4NEE8oAoGCCqGSM49\nAwEHoUQDQgAEeRFgMrQEHI/APWaziRH90jN7EozjdbPVxvzc1F4zqWTeCtLASwqA\nqnMugYX2epqsFhGn82xNXu2NwgORc6embQ==\n-----END ECDSA PRIVATE KEY-----\n",
},
// TODO: Is it worth supporting case-insensitve headers?
// TODO: Is it worth supporting case-insensitive headers?
// https://github.com/coinbase/waas-sdk-react-native/blob/bbaf597e73d02ecaf64161061e71b85d9eeeb9d6/example/src/.coinbase_cloud_api_key.json#L4
// {
// name: "valid_result_case_insensitive",
@@ -100,7 +100,7 @@ func verifyMatch(ctx context.Context, client *http.Client, token string) (bool,
return false, nil, err
}
// Credential not loaded. Not sure this can happend but it should be labeled unverified.
// Credential not loaded. Not sure this can happened but it should be labeled unverified.
if credentials == nil {
return false, nil, nil
}
@@ -122,7 +122,7 @@ func (s Scanner) verify(ctx context.Context, token string) (bool, map[string]str
return false, nil, fmt.Errorf("unexpected error description '%s' for %s", errInfo.Error, req.URL)
}
} else {
return false, nil, fmt.Errorf("unexpected respones %d for %s", res.StatusCode, req.URL)
return false, nil, fmt.Errorf("unexpected response %d for %s", res.StatusCode, req.URL)
}
}
+1 -1
View File
@@ -118,7 +118,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
ctx = context.Background()
}
// Disable pool + retries to prevent flooding the server with failed login attemps.
// Disable pool + retries to prevent flooding the server with failed login attempts.
db.SetConnMaxLifetime(time.Second)
db.SetMaxOpenConns(1)