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

Parse IdentityEntries into MonitoredIdentities #458

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

linus-sun
Copy link
Collaborator

@linus-sun linus-sun commented Sep 18, 2024

Summary

Per specification here, this PR implements the following:

  • JSON tagging for the IdentityEntry struct (part of structured JSON output for use in custom notification handling)
  • the MonitoredIdentity struct for notification handling
  • the NotificationPlatform interface to be extended by custom notification platforms
  • the CreateMonitoredIdentities function to parse a list of IdentityEntries into a list of MonitoredIdentities, for use in creating structured output of found identities from a run of rekor-monitor.

Release Note

NONE

Documentation

none needed for this PR, changes to documentation will be made in future respective PRs which implement API changes

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 59.57447% with 19 lines in your changes missing coverage. Please review.

Project coverage is 56.19%. Comparing base (d271ec7) to head (432d364).
Report is 103 commits behind head on main.

Files with missing lines Patch % Lines
pkg/rekor/identity.go 59.57% 16 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #458      +/-   ##
==========================================
- Coverage   64.02%   56.19%   -7.84%     
==========================================
  Files           4        9       +5     
  Lines         303      694     +391     
==========================================
+ Hits          194      390     +196     
- Misses         78      239     +161     
- Partials       31       65      +34     

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

@linus-sun linus-sun changed the title Linussun/parse json Parse IdentityEntries into MonitoredIdentities Sep 18, 2024
@@ -87,14 +87,26 @@ type MonitoredValues struct {

// IdentityEntry holds a certificate subject, issuer, OID extension and associated value, and log entry metadata
type IdentityEntry struct {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm also open to a refactoring of IdentityEntry into pkg/identity, which would move this code into there as well- more broadly, what should the specifications be determining if code should go in pkg/rekor/identity vs pkg/identity?

@linus-sun linus-sun force-pushed the linussun/parse-json branch 2 times, most recently from b88f627 to 311c533 Compare September 18, 2024 23:17
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.

1 participant