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

Encoding guesser #1472

Merged
merged 9 commits into from Jan 18, 2024
Merged

Encoding guesser #1472

merged 9 commits into from Jan 18, 2024

Conversation

m-brophy
Copy link
Contributor

@m-brophy m-brophy commented Nov 7, 2023

Description of the PR

This PR enables guac to detect the encoding of a compressed file from the internal bytes of the document, for use if this information isn't supplied separately

Fixes #1237

http.DetectContentType is used but this does not handle bz2 or zst encoding so this capability has been added

these docs were used as a reference for detection of these types: https://www.ietf.org/rfc/rfc8878.txt and https://www.ietf.org/rfc/rfc5655.txt

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

@m-brophy m-brophy force-pushed the encoding_guesser branch 2 times, most recently from 70583ac to 759a0b6 Compare November 9, 2023 12:49
Copy link
Contributor

@lumjjb lumjjb left a comment

Choose a reason for hiding this comment

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

minor nits, can we refactor the guesser to its own package? else LGTM!

pkg/handler/processor/process/process.go Outdated Show resolved Hide resolved
pkg/handler/processor/process/process.go Outdated Show resolved Hide resolved
@lumjjb
Copy link
Contributor

lumjjb commented Dec 7, 2023

Hey @m-brophy ! Just checking back on this! The PR looks almost ready to merge with some minor nits.

@m-brophy
Copy link
Contributor Author

Hey @m-brophy ! Just checking back on this! The PR looks almost ready to merge with some minor nits.

Thanks @lumjjb I'll look to get this done asap

@m-brophy
Copy link
Contributor Author

Hi @lumjjb, changes made, branch rebased, CI tests all successful if you want to take another look now.

Signed-off-by: m-brophy <mbrophy@redhat.com>
Signed-off-by: m-brophy <mbrophy@redhat.com>
Signed-off-by: m-brophy <mbrophy@redhat.com>
Signed-off-by: m-brophy <mbrophy@redhat.com>
Signed-off-by: m-brophy <mbrophy@redhat.com>
Signed-off-by: m-brophy <mbrophy@redhat.com>
Signed-off-by: m-brophy <mbrophy@redhat.com>
Signed-off-by: m-brophy <mbrophy@redhat.com>
@m-brophy
Copy link
Contributor Author

Hey @lumjjb I just rebased this ready to merge if you're happy to do that

Copy link
Contributor

@lumjjb lumjjb left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @m-brophy

@lumjjb lumjjb added the needs-review Needs writer LGTM label Jan 18, 2024
Signed-off-by: Jeff Mendoza <jlm@jlm.name>
Copy link
Collaborator

@jeffmendoza jeffmendoza left a comment

Choose a reason for hiding this comment

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

Addressed some minor style nits.

@kodiakhq kodiakhq bot merged commit 237ff8c into guacsec:main Jan 18, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review Needs writer LGTM size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Implement guesser for document encoding
3 participants