thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
211 stars 55 forks source link

feat(remote-access): support reading child connection string from stdin #2874

Closed reubenmiller closed 1 month ago

reubenmiller commented 1 month ago

Proposed changes

Support reading the c8y message/connection string from standard input when using the convention --child -. Typically - refers to standard input (e.g. see gnu coreutil cat)

This improves compatibility with other components such as systemd sockets where the socket data is feed via stdin.

Types of changes

Paste Link to the issue

https://github.com/thin-edge/thin-edge.io/issues/2859

Checklist

Further comments

reubenmiller commented 1 month ago

@jarhodes314 Can you please take over this PR to add some unit tests? We're still working out a way to run some unit tests for the Cumulocity IoT Cloud Remote Access feature but this will be covered in a different PR.

github-actions[bot] commented 1 month ago

Robot Results

:white_check_mark: Passed :x: Failed :next_track_button: Skipped Total Pass % :stopwatch: Duration
433 0 3 433 100 56m57.268367s
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.3%. Comparing base (77a9f56) to head (9c1bafe). Report is 7 commits behind head on main.

Additional details and impacted files | [Files](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2874?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge) | Coverage Δ | | |---|---|---| | [plugins/c8y\_remote\_access\_plugin/src/input.rs](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2874?src=pr&el=tree&filepath=plugins%2Fc8y_remote_access_plugin%2Fsrc%2Finput.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge#diff-cGx1Z2lucy9jOHlfcmVtb3RlX2FjY2Vzc19wbHVnaW4vc3JjL2lucHV0LnJz) | `81.1% <100.0%> (+3.8%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2874/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge)