-
Notifications
You must be signed in to change notification settings - Fork 88
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
[scd] minimal implementation for the dss report handler #1012
[scd] minimal implementation for the dss report handler #1012
Conversation
16424fa
to
edbc846
Compare
edbc846
to
2666bdf
Compare
2666bdf
to
9382bf3
Compare
1c3ee2a
to
7e5f91d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the two comments I've left.
Also, have you tried invoking this endpoint locally to validate it works as expected? Just for safety before merging.
Otherwise LGTM
pkg/scd/dss_report_handler.go
Outdated
) | ||
|
||
// DSSReporting takes care of handling a DSS report. | ||
type DSSReporting interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: name the interface DSSReportHandler
and the function inside Handle
, that is more aligned with Go best practices
(incidentally that will remove the mixed case Dss
:) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering this but avoided it, because we already have some files called *_handlers
that seem to be specifically about handling REST calls?
This interfaces is about handling things after they traversed the MakeDssReport
function in dss_report_handler
and it feels a bit weird to pass that to an interface called DSSReportHandler?
(Having things in a separate package would make it clearer: I'm open to suggestions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True that. That's a reason why I'm not a fan of defining interfaces ahead of time without it being actually in use TBH (c.f. as well this). But that's (still) nitpicking so I'm good merging it as it is. I leave it up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pointer. I'm still thinking too much in terms of Java interfaces -> i did some renaming to get closer to the recommendations.
Yes, I wrote a tiny test scenario. I'll run it again now to be sure |
7e5f91d
to
7f25f6e
Compare
An implementation for the dss report handler that simply logs the report as a Json string.
(This is to have a version to develop a simple test scenario against, but the goal would be to have something that we can possibly ship)