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

fix(output): handle --unix-timestamp flag #4079

Merged
merged 2 commits into from
May 24, 2024

Conversation

pedrooot
Copy link
Member

Context

Fixes #4077

Description

Modify FindingOutput class to make timestamp an int or datetime.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@pedrooot pedrooot requested review from a team as code owners May 23, 2024 15:53
@sergargar sergargar changed the title fix(output): handle --unix-timestamp flag fix(output): handle --unix-timestamp flag May 23, 2024
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

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

Great catch @pedrooot 👏

@@ -29,7 +29,7 @@ class FindingOutput(BaseModel):
"""

auth_method: str
timestamp: datetime
timestamp: Union[int, datetime]
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test creating a FindingOutput with the unix timestamp?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Member Author

Choose a reason for hiding this comment

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

Done ✅

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.29%. Comparing base (eb7f56f) to head (c131ece).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4079      +/-   ##
==========================================
+ Coverage   86.27%   86.29%   +0.02%     
==========================================
  Files         790      790              
  Lines       24729    24729              
==========================================
+ Hits        21335    21340       +5     
+ Misses       3394     3389       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

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

Great work @pedrooot 👏

@jfagoagas jfagoagas merged commit 3aa2832 into master May 24, 2024
10 of 11 checks passed
@jfagoagas jfagoagas deleted the PRWLR-3779-unix-timestamp-not-working-on-outputs branch May 24, 2024 08:38
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.

[Bug]: Unix timestamp not working
2 participants