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

Update register remote service API #46

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

DerAndereAndi
Copy link
Member

Change RegisterRemoteSKI api call with a 2nd argument to provide the SHIP-ID if known. If provided (as a non empty string), upon SHIP handshake it will check the reported SHIP-ID from the remote service, and if it differs, will close the connection. The SHIP-ID is also made available via mDNS, and therefor should be known at all times.

The implementation of ServiceShipIDUpdate of HubReaderInterface is called to report the SHIP-ID, if it wasn’t known yet.

Change `RegisterRemoteSKI` api call with a 2nd argument to provide the SHIP-ID if known. If provided (as a non empty string), upon SHIP handshake it will check the reported SHIP-ID from the remote service, and if it differs, will close the connection. The SHIP-ID is also made available via mDNS, and therefor should be known at all times.

The implementation of `ServiceShipIDUpdate` of `HubReaderInterface` is called to report the SHIP-ID, if it wasn’t known yet.
@DerAndereAndi DerAndereAndi added enhancement New feature or request HUB Connection management related topics labels Dec 24, 2024
@coveralls
Copy link

Coverage Status

coverage: 93.345% (+0.04%) from 93.304%
when pulling 45edf34 on feature/register-improvements
into d388b85 on dev.

DerAndereAndi added a commit to enbility/eebus-go that referenced this pull request Dec 24, 2024
Change `RegisterRemoteSKI` api call with a 2nd argument to provide the SHIP-ID if known. If provided (as a non empty string), upon SHIP handshake it will check the reported SHIP-ID from the remote service, and if it differs, will close the connection. The SHIP-ID is also made available via mDNS, and therefor should be known at all times.

Requires enbility/ship-go#46
Copy link
Contributor

@sthelen-enqs sthelen-enqs left a comment

Choose a reason for hiding this comment

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

Changes LGTM.
It might be nice to have tests that verify that a ShipId mismatch causes an error/cancels the connection but that might require some deeper changes to the mocks so I wouldn't consider that a blocker right now.

@DerAndereAndi
Copy link
Member Author

@sthelen-enqs on SHIP level the test already exists: https://github.com/enbility/ship-go/blob/dev/ship/hs_access_test.go#L158-L175

So one could think of an additional system level test.

@DerAndereAndi DerAndereAndi merged commit dd44eeb into dev Jan 22, 2025
6 checks passed
@DerAndereAndi DerAndereAndi deleted the feature/register-improvements branch January 22, 2025 14:42
@DerAndereAndi DerAndereAndi added this to the Version 0.7 milestone Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HUB Connection management related topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants