Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Matchers (and a lot of syntax cleanup) #87

Merged
merged 1 commit into from
Feb 27, 2021
Merged

Conversation

jcran
Copy link
Member

@jcran jcran commented Feb 27, 2021

This PR moves all checks to modern hash style (no more hashrockets!) and enables multiple-matchers within a single check.

The key changes:

  • match_type and match_content are now within an array of hashes, called :matches
  • match_logic now accepts a value of :any or :all

Additionally, the :match_details field is now called :description

While backward compatibility is maintained with the previous format, this matches: format is preferred for new checks.

An example is below:

      [
        {
          type: "fingerprint",
          category: "service",
          vendor: "Some",
          product: "Product",
          website: "https://www.somewhere.co.uk/",
          match_logic: :all,
          matches: [
            {
              match_type: :content_title,
              match_content: /The Title of the Page/i
            },
            {
              match_type: :content_body,
              match_content: /any body string/i
            }, 
            {
              match_type: :content_code,
              match_content: 200
            }  
          ],
          description: "just an example check",
          paths: [ { path: "#{url}", follow_redirects: true } ]
        }
      ]
    ```

@jcran jcran changed the title enable new multi-match format while maintaining backward compatibility Multi-Matchers (and a lot of syntax cleanup) Feb 27, 2021
@jcran jcran merged commit 7a61708 into main Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant