Refactor MDM service to return a payload from check-ins#764
Refactor MDM service to return a payload from check-ins#764jessepeterson merged 3 commits intomicromdm:mainfrom
Conversation
|
Hey Jesse,
|
| ) | ||
|
|
||
| func (svc *MDMService) Checkin(ctx context.Context, event CheckinEvent) error { | ||
| func (svc *MDMService) Checkin(ctx context.Context, event CheckinEvent) ([]byte, error) { |
There was a problem hiding this comment.
Thoughts on adding a function comment to explain what the returned []byte represents and what it can be used for?
There was a problem hiding this comment.
I realize there might be many functions which don't currently adhere to this standard of commenting but I think it would still be of value here.
There was a problem hiding this comment.
Sure. I met you half-way. All of the implementors of the interface I add a small comment to. But I also added documentation to the main interface.
There was a problem hiding this comment.
I walked this back, actually. In the document you posted:
There is one exception to this rule; you don’t need to document methods that implement an interface. Specifically don’t do this:
So I removed those. :)
Done, hopefully more clear now. |
|
Note, I haven't yet tested this commit myself. |
Currently all of the Checkin messages don't return a response—they all succeed without any return value. However, certain Check-in messages require returning a payload such as
UserAuthenticate,GetBootstrapToken,DeclarativeManagement, etc.This PR adjusts the check-in interface to allow for returning payload data on a Check-in message which gets returned to the client verbatim (much like the
Acknolwedgeinterface method already does). Note this PR does not implement any of the above; rather it just makes it possible for them to be implemented.