(t *testing.T, filePath string)
| 70 | } |
| 71 | |
| 72 | func loadX509Cert(t *testing.T, filePath string) *x509.Certificate { |
| 73 | t.Helper() |
| 74 | certFile, _ := os.Open(filePath) |
| 75 | certRaw, _ := io.ReadAll(certFile) |
| 76 | block, _ := pem.Decode([]byte(certRaw)) |
| 77 | if block == nil { |
| 78 | t.Fatalf("pem.Decode(%v) = nil. Want a value.", certRaw) |
| 79 | } |
| 80 | cert, err := x509.ParseCertificate(block.Bytes) |
| 81 | if err != nil { |
| 82 | t.Fatalf("x509.ParseCertificate(%v) failed %v", block.Bytes, err.Error()) |
| 83 | } |
| 84 | return cert |
| 85 | } |
| 86 | |
| 87 | func TestSPIFFEBundleMapFailures(t *testing.T) { |
| 88 | filePaths := []string{ |
no test coverage detected