Skip to content

Commit b686269

Browse files
committed
Lint warnings/errors fixed/suppressed
1 parent 27238bb commit b686269

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/cryptography/signature_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ func TestExportCertificate(t *testing.T) {
468468

469469
t.Run("export to existing file", func(t *testing.T) {
470470
exportPath := filepath.Join(localTestingDir, "existing.pem")
471-
err := os.WriteFile(exportPath, []byte("existing"), 0644)
471+
err := os.WriteFile(exportPath, []byte("existing"), 0600)
472472
assert.Nil(err)
473473

474474
err = exportCertificate("test", exportPath)

cmd/cryptography/utils_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ func TestDetectKeyType(t *testing.T) {
170170
assert := assert.New(t)
171171

172172
t.Run("detect PKCS1 key", func(t *testing.T) {
173+
// #nosec G101 -- This is a test string, not actual credentials
173174
key := "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA...\n-----END RSA PRIVATE KEY-----"
174175
keyType, err := detectKeyType(key)
175176
assert.Nil(err)
@@ -202,7 +203,7 @@ func TestDetectKeyType(t *testing.T) {
202203
// This will panic with index out of range due to missing PEM markers
203204
// The function should be improved to handle this case gracefully
204205
assert.Panics(func() {
205-
detectKeyType(key)
206+
_, _ = detectKeyType(key)
206207
})
207208
})
208209
}
@@ -352,6 +353,7 @@ func TestGetUnlockedKeyring(t *testing.T) {
352353
})
353354

354355
t.Run("unlock keyring with invalid key", func(t *testing.T) {
356+
// #nosec G101 -- This is a test string, not actual credentials
355357
invalidKey := "-----BEGIN PGP PRIVATE KEY BLOCK-----\ninvalid\n-----END PGP PRIVATE KEY BLOCK-----"
356358
passphrase := []byte("test")
357359

0 commit comments

Comments
 (0)