Welcome to mirror list, hosted at ThFree Co, Russian Federation.

evidence.rb « security « reports « ci « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ed7446444470baed147fd2b1cc1b8b779be3de2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# frozen_string_literal: true

FactoryBot.define do
  factory :ci_reports_security_evidence, class: '::Gitlab::Ci::Reports::Security::Evidence' do
    data do
      {
        summary: 'Credit card detected',
        request: {
          headers: [{ name: 'Accept', value: '*/*' }],
          method: 'GET',
          url: 'http://goat:8080/WebGoat/logout',
          body: nil
        },
        response: {
          headers: [{ name: 'Content-Length', value: '0' }],
          reason_phrase: 'OK',
          status_code: 200,
          body: nil
        },
        source: {
          id: 'assert:Response Body Analysis',
          name: 'Response Body Analysis',
          url: 'htpp://hostname/documentation'
        },
        supporting_messages: [
          {
            name: 'Origional',
            request: {
              headers: [{ name: 'Accept', value: '*/*' }],
              method: 'GET',
              url: 'http://goat:8080/WebGoat/logout',
              body: ''
            }
          },
          {
            name: 'Recorded',
            request: {
              headers: [{ name: 'Accept', value: '*/*' }],
              method: 'GET',
              url: 'http://goat:8080/WebGoat/logout',
              body: ''
            },
            response: {
              headers: [{ name: 'Content-Length', value: '0' }],
              reason_phrase: 'OK',
              status_code: 200,
              body: ''
            }
          }
        ]
      }
    end

    skip_create

    initialize_with do
      ::Gitlab::Ci::Reports::Security::Evidence.new(**attributes)
    end
  end
end