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

Require Recog ~>3.0, and bump for release of dap 1.3.0 #95

Merged
merged 2 commits into from
Oct 7, 2022

Conversation

mkienow-r7
Copy link
Contributor

This PR bumps the recog dependency for version ~>3.0, updates gems and prepares for the release of dap 1.3.0.

Testing

  • Ruby rspec
$ bundle exec rspec spec
...
Finished in 0.05199 seconds (files took 1.09 seconds to load)
99 examples, 0 failures
  • bats integration tests
$ docker rmi dap_testing:latest
$ docker build -t dap_testing -f Dockerfile.testing .
$ docker run --rm --name dap_testing -it -e DAP_EXECUTABLE=dap dap_testing /bin/bash -l -c "rvm use 2.4.5 && gem build dap && gem install dap*.gem && bundle update --bundler && bundle exec rspec spec && find /opt/bats_testing -name \*.bats | grep -v test/test_helper/ | xargs -n1 bats"
Using /usr/local/rvm/gems/ruby-2.4.5
WARNING:  licenses is empty, but is recommended.  Use a license identifier from
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
WARNING:  open-ended dependency on rspec (>= 0, development) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on cucumber (>= 0, development) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on aruba (>= 0, development) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on nokogiri (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on oj (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on htmlentities (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on net-dns (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on bit-struct (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on geoip-c (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on recog (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on maxmind-db (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  See https://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: dap
  Version: 1.3.0
  File: dap-1.3.0.gem
Successfully installed dap-1.3.0
Parsing documentation for dap-1.3.0
Installing ri documentation for dap-1.3.0
Done installing documentation for dap after 4 seconds
1 gem installed
Fetching gem metadata from https://rubygems.org/.
Fetching gem metadata from https://rubygems.org/......
Resolving dependencies...
Resolving dependencies...
Using concurrent-ruby 1.1.10
Using minitest 5.15.0
Using thread_safe 0.3.6
Using childprocess 4.1.0
Using builder 3.2.4
Using middleware 0.1.0
Using thor 1.2.1
Using cucumber-tag-expressions 2.0.4
Using cucumber-cucumber-expressions 10.3.0
Using rspec-support 3.9.4
Using diff-lcs 1.3
Using ffi 1.15.5
Using multi_test 0.1.2
Using bit-struct 0.17
Using bundler 2.3.23
Using geoip-c 0.9.1
Using htmlentities 4.3.4
Using maxmind-db 1.0.0
Using mini_portile2 2.4.0
Using net-dns 0.9.0
Using oj 3.13.21
Using i18n 1.12.0
Using tzinfo 1.2.10
Using rspec-core 3.9.3
Using sys-uname 1.2.2
Using rspec-expectations 3.9.4
Using rspec-mocks 3.9.1
Using nokogiri 1.10.10
Using activesupport 5.2.8.1
Using recog 3.0.2
Using rspec 3.9.0
Using protobuf-cucumber 3.10.8
Using cucumber-messages 12.4.0
Using cucumber-gherkin 13.0.0
Using cucumber-html-formatter 6.0.3
Using cucumber-core 7.0.0
Using cucumber-wire 3.0.0
Using cucumber 4.0.1
Using aruba 0.6.2
Bundle updated!

Dap::Filter::FilterDecodeGquicVersionsResult
  .decode
    testing gquic valid input base64 encoded output from the real world
      returns an hash w/ versions as list of versions
    testing gquic valid input artifical example
      returns an hash w/ versions as list of versions
    testing gquic valid versions with invalid versions
      returns an hash w/ versions as list of versions
    testing valid string but not gquic versions
      returns nil
    testing valid string with Q in it but not gquic versions
      returns nil
    testing gquic empty string input
      returns nil
    testing gquic nil input
      returns nil

Dap::Filter::FilterDecodeHTTPReply
  .decode
    decoding non-HTTP response
      returns an empty hash
    decoding uncompressed response
      correctly sets status code
      correctly sets status message
      correctly sets body
      correctly extracts http_raw_headers
      extracts Date http header
      extracts Last-Modified http header
    decoding binary response
      correctly sets http_raw_body base64
    decoding gzip compressed response
      correctly decompresses body
    decoding valid chunked responses
      correctly dechunks body
      finds normal headers
      finds trailing headers
    decoding bogus chunked responses
Skipping impossibly large 255-byte #2 chunk, at offset 14/35
      reads the partial body
Skipping impossibly large 255-byte #2 chunk, at offset 14/35
      finds normal headers
    decoding truncated, chunked responses
Skipping impossibly large 6-byte #3 chunk, at offset 35/35
      reads the partial body
Skipping impossibly large 6-byte #3 chunk, at offset 35/35
      finds normal headers
    decoding responses that are missing the "reason phrase", an RFC anomaly
      decodes anyway

Dap::Filter::FilterHTMLLinks
  .process
    lowercase
      extracted the correct links
    uppercase
      extracted the correct links
    scattercase
      extracted the correct links
    repeated less than symbol
      extracted the correct links

Dap::Filter::FilterDecodeLdapSearchResult
  .decode
    testing full ldap response message
      returns Hash as expected
      returns expected value
    testing invalid ldap response message
      returns error message as expected

Dap::Filter::FilterCopy
  .process
    copy one json field to another
      copies and leaves the original field

Dap::Filter::FilterFlatten
  .process
    flatten nested json
      has new flattened nested document keys
    ignore unnested keys
      is the same as the original document

Dap::Filter::FilterExpand
  .process
    expand unnested json
      has new expanded keys
    ignore all but specified unnested json
      has new expanded keys
    ignore nested json
      is the same as the original document

Dap::Filter::FilterRenameSubkeyMatch
  .process
    with subkeys
      renames keys as expected
    without subkeys
      produces unchanged output without errors

Dap::Filter::FilterMatchRemove
  .process
    with similar keys
      removes the expected keys

Dap::Filter::FilterMatchSelect
  .process
    with similar keys
      selects the expected keys

Dap::Filter::FilterSelect
  .process
    with similar keys
      selects the expected keys

Dap::Filter::FilterMatchSelectKey
  .process
    with similar keys
      selects the expected keys

Dap::Filter::FilterMatchSelectValue
  .process
    with similar keys
      selects the expected keys

Dap::Filter::FilterTransform
  .process
    invalid transform
      fails
    reverse
      ASCII
        is reversed
      UTF-8
        is reversed
    int default
      valid int
        is the correct int
      invalid int
        is the correct int
    int different base
      is the correct int
    float
      valid float
        is the correct float
      invalid float
        is the correct float
    json
      valid json
        is the correct JSON
      invalid json
        raises on invalid JSON
    stripping
      lstrip
        lstripped
      rstrip
        rstripped
      strip
        stripped

Dap::Filter::FilterFieldReplace
  .process
    replaced correctly

Dap::Filter::FilterFieldReplaceAll
  .process
    replaced correctly

Dap::Filter::FilterFieldSplitPeriod
  .process
    splitting on period boundary
      splits correctly

Dap::Filter::FilterFieldSplitLine
  .process
    splitting on newline boundary
      splits correctly

Dap::Filter::FilterDecodeDNSVersionReply
  .decode
    parsing empty string
      returns an empty hash
    parsing a partial response
      returns an empty hash
    parsing TCP DNS response
      returns the correct version
    parsing UDP DNS response
      returns the correct version

Dap::Input::InputJSON
  .read_record
    decoding input json
      parses values starting with a colon (:) as a string

Dap::Proto::IPMI::Channel_Auth_Reply
  .valid?
    testing with valid rmcp version and message length
      returns true as expected
    testing with invalid data
      returns false as expected

Dap::Proto::LDAP
  .decode_elem_length
    testing lengths shorter than 128 bits
      returns a Fixnum
      returns value correctly
    testing lengths greater than 128 bits
      returns a Fixnum
      returns value correctly
    testing with 3 byte length
      returns a Fixnum
      returns value correctly
    testing invalid length
      returns nil as expected
  .split_messages
    testing full message
      returns Array as expected
      returns SearchResultEntry value as expected
      returns SearchResultDone value as expected
    testing invalid message
      returns Array as expected
    testing short message
      returns Array as expected
    testing message length greater than total data length
      returns Array as expected
      returns empty Array as expected
    testing empty ASN.1 Sequence
      returns Array as expected
      returns empty Array as expected
  .parse_ldapresult
    testing valid data
      returns Hash as expected
      returns results as expected
    testing invalid data
      returns Hash as expected
      returns empty Hash as expected
  .parse_messages
    testing SearchResultEntry
      returns Array as expected
      returns SearchResultEntry value as expected
    testing SearchResultDone
      returns Array as expected
      returns SearchResultDone value as expected
    testing SearchResultDone - edge case #1
      returns Array as expected
      returns operationsError as expected
    testing UnhandledTag
      returns Array as expected
      returns UnhandledTag value as expected
    testing empty ASN.1 Sequence
      returns Array as expected
      returns error value as expected

Dap::Utils::Misc
  .flatten_hash
    with mixed nested data
      flattens properly

Finished in 0.07839 seconds (files took 0.47172 seconds to load)
99 examples, 0 failures

1..25
ok 1 rename
ok 2 not_exists
ok 3 split_comma
ok 4 field_split_line
ok 5 # skip not_empty
ok 6 field_split_tab
ok 7 truncate
ok 8 insert
ok 9 field_split_array
ok 10 exists
ok 11 split_line
ok 12 select
ok 13 remove
ok 14 include
ok 15 transform
ok 16 recog_match
ok 17 recog_nomatch
ok 18 # skip recog_invalid_arg
ok 19 geo_ip yields valid fields
ok 20 geo_ip_org yields valid fields
ok 21 geo_ip_asn
ok 22 geo_ip2_city
ok 23 geo_ip2_asn
ok 24 geo_ip2_isp
ok 25 geo_ip2_legacy_compat
1..2
ok 1 reads json
ok 2 reads lines

@mkienow-r7 mkienow-r7 force-pushed the feature/bump-recog-3.0.2 branch from 0d82ee8 to 7c948fe Compare October 7, 2022 04:59
Copy link

@egalinkin-r7 egalinkin-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM. Made the most minor comment of all time.

@@ -6,7 +6,7 @@ gem 'net-dns'
gem 'bit-struct'
gem 'geoip-c'
gem 'maxmind-db', '~> 1.0.0'
gem 'recog', '>= 2.3.21'
gem 'recog', '~> 3.0'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably fine, just highlighting the dropping of the patch version. The Gemfile.lock specifies recog 3.0.2 (which this covers)

Copy link
Contributor Author

@mkienow-r7 mkienow-r7 Oct 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped the patch value to make this more flexible for future versions. The recog dependency is specified to be a version that is >= 3.0.0 but < 4.0 so that it accepts all 3 minor and patch versions. Running bundle install finds gems that meet the specified requirements, in this case recog 3.0.2 is fetched since it is the latest version, and then the snapshot of all of the gems and versions installed is written to the Gemfile.lock file.

@mkienow-r7 mkienow-r7 merged commit 6580ae7 into rapid7:master Oct 7, 2022
@mkienow-r7 mkienow-r7 deleted the feature/bump-recog-3.0.2 branch October 7, 2022 19:44
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.

2 participants