-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
DAMEK86
commented
Apr 17, 2024
- create initial certs, even if no remote SKI is provided
- auto register remote SKI if provided, otherwise skip it
- gitignore: ignore created cert files
- create initial certs, even if no remote SKI is provided - auto register remote SKI if provided, otherwise skip it - gitignore: ignore created cert files
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 agree this helps a bit, but I do have some notes. Could you please check them?
@@ -30,11 +30,6 @@ func main() { | |||
|
|||
flag.Parse() | |||
|
|||
if len(os.Args) == 1 || remoteSki == nil || *remoteSki == "" { |
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.
Without providing an SKI the service can not run meaningful right now. One would have to also integrate accepting any (because there is no UX to deny them) incoming remote pairing requests.
Otherwise block should stay.
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.
the current implementation isn't able to generate the cert and print the SKI for pairing without knowing the remote ski.
The idea behind that is providing an easier startup for pairing the cemd with a other eebus device.
Therefore the cemd ski is needed if the target is not auto accept the ski.
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.
Then I suggest simply moving this code block before configuration, err := eebusapi.NewConfiguration
demo := democem.NewDemoCem(configuration, *remoteSki) | ||
demo := democem.NewDemoCem(configuration) | ||
|
||
if len(os.Args) > 1 && *remoteSki != "" { |
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.
We shouldn't check of the amount of args here, but rather:
if remoteSki != nil && *remoteSki != "" {
If the nil check above stays, this could also be removed here
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.
nil in general isn't needed, because the default remoteSki
value is an empty string.
Let's improve the demos of eebus-go as this repository will now be archived |