()
| 379 | } |
| 380 | |
| 381 | func (s *testSuite) TestArgumentsInViolations() { |
| 382 | schema := &v12.CraftingSchema{ |
| 383 | Policies: &v12.Policies{ |
| 384 | Attestation: []*v12.PolicyAttachment{ |
| 385 | { |
| 386 | Policy: &v12.PolicyAttachment_Ref{Ref: "file://testdata/with_arguments.yaml"}, |
| 387 | With: map[string]string{"email_array": "foobar@chainloop.dev"}, |
| 388 | }, |
| 389 | }, |
| 390 | }, |
| 391 | } |
| 392 | |
| 393 | s.Run("arguments in violations", func() { |
| 394 | verifier := NewPolicyVerifier(schema.Policies, nil, &s.logger) |
| 395 | statement := loadStatement("testdata/statement.json", &s.Suite) |
| 396 | |
| 397 | res, err := verifier.VerifyStatement(context.TODO(), statement) |
| 398 | s.NoError(err) |
| 399 | s.Len(res, 1) |
| 400 | s.Equal(map[string]string{"email_array": "foobar@chainloop.dev"}, res[0].GetWith()) |
| 401 | }) |
| 402 | } |
| 403 | |
| 404 | func (s *testSuite) TestMaterialSelectionCriteria() { |
| 405 | attNoFilterPolicyTyped := &v12.PolicyAttachment{ |
nothing calls this directly
no test coverage detected