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

[filebeat] Add base64Decode template functions to httpjson #28385

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

marc-gr
Copy link
Contributor

@marc-gr marc-gr commented Oct 13, 2021

What does this PR do?

Adds template functions to decode base64 strings.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 13, 2021

func base64DecodeNoPad(enc string) string {
dec, _ := base64.RawStdEncoding.DecodeString(enc)
return string(dec)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe emit and obviously incorrect string if err != nil? (also above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure here, what would you suggest? maybe a no-op is better in this case (and document accordingly)?

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-13T08:05:13.610+0000

  • Duration: 93 min 48 sec

  • Commit: 38557b8

Test stats 🧪

Test Results
Failed 0
Passed 7699
Skipped 1201
Total 8900

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

Copy link
Member

@P1llus P1llus left a comment

Choose a reason for hiding this comment

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

LGTM, also agree that maybe some sort of check would be nice

@marc-gr marc-gr merged commit 6ad8689 into elastic:master Oct 14, 2021
@marc-gr marc-gr deleted the add-decode-funcs branch October 14, 2021 11:53
mergify bot pushed a commit that referenced this pull request Oct 14, 2021
marc-gr added a commit that referenced this pull request Oct 14, 2021
(cherry picked from commit 6ad8689)

Co-authored-by: Marc Guasch <[email protected]>
Icedroid pushed a commit to Icedroid/beats that referenced this pull request Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.16.0 Automated backport with mergify enhancement Filebeat Filebeat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants