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

Implement bridge-device functionality for onboarding non-OCF compliant devices #420

Merged
merged 50 commits into from
Feb 3, 2024

Conversation

jkralik
Copy link
Member

@jkralik jkralik commented Jan 15, 2024

Implement a bridge-device service facilitating access to bridged devices, incorporating extensions beyond the OCF specification for local access. Notable distinctions include the use of a single opened UDP (potentially DTLS in the future) for Plgd bridged devices, contrasting with OCF bridged devices that utilize individual UDP/DTLS/TCP/TCP-TLS for both IPv4 and IPv6.

Key Points:

  • Access devices by including the query parameter di=<deviceID> in the request.
  • The discovery resource (/oic/res) without the di parameter provides links for all devices. Each link contains a deviceID, specifying the required value for the di query parameter.
  • Accessing another device without the di parameter results in failure.

Features:

  • Enables setting a Certificate Authority (CA) for cloud connection for each bridged device.
  • Implements a cloud connector for each bridged device with certificate validation for cloud connections.
  • Supports custom loggers.
  • Provides an API for configuring update/get/observe handlers for resources.
  • Supports both IPv4 and IPv6.

To Be Implemented:

  • Deployment of a DTLS server with a shared certificate and pre-shared key for all devices.
  • Introduction of Access Control Lists (ACLs) for each bridged device.
  • Integration of ownership and provision states.
  • Implementation of a Certificate Signing Request (CSR) resource and identity certificate for each bridged device.
  • Incorporation of additional OCF-related functionalities.

NOTE

The bridge-device is compatible with client-application 0.10.0 or later.

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2024

Codecov Report

Attention: 725 lines in your changes are missing coverage. Please review.

Comparison is base (e22e783) 70.47% compared to head (221b966) 71.77%.

Files Patch % Lines
bridge/net/network.go 79.62% 30 Missing and 24 partials ⚠️
test/coap-gateway/service/service.go 57.81% 40 Missing and 14 partials ⚠️
bridge/service/service.go 56.14% 40 Missing and 10 partials ⚠️
bridge/resources/resource.go 73.88% 34 Missing and 13 partials ⚠️
test/client/client.go 60.34% 36 Missing and 10 partials ⚠️
test/coap-gateway/service/resourceDirectory.go 30.15% 41 Missing and 3 partials ⚠️
test/coap-gateway/defaultHandler.go 65.85% 42 Missing ⚠️
bridge/device/cloud/manager.go 85.81% 26 Missing and 13 partials ⚠️
client/options.go 10.81% 33 Missing ⚠️
test/coap-gateway/service/signIn.go 28.20% 24 Missing and 4 partials ⚠️
... and 35 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #420      +/-   ##
==========================================
+ Coverage   70.47%   71.77%   +1.30%     
==========================================
  Files          80      124      +44     
  Lines        4576     7101    +2525     
==========================================
+ Hits         3225     5097    +1872     
- Misses        935     1434     +499     
- Partials      416      570     +154     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Danielius1922 Danielius1922 force-pushed the jkralik/feature/bridge-device branch from a63d60b to 4ece331 Compare January 19, 2024 14:31
jkralik and others added 12 commits February 1, 2024 14:56
- tests for sign up, sing in, sign off, publish resources and
refresh token
Go test runs tests from different packages in different binaries
and these run in parallel. It's possible that the test bridge
service in different tests execute at the same time, which would
cause failures ("bind address already in use") if the port was
not random.
@jkralik jkralik force-pushed the jkralik/feature/bridge-device branch from 7fa196d to f117737 Compare February 1, 2024 14:58
@jkralik jkralik force-pushed the jkralik/feature/bridge-device branch from f1a6368 to 9e994f5 Compare February 2, 2024 07:46
@jkralik jkralik changed the title Jkralik/feature/bridge device Implement bridge-device functionality for onboarding non-OCF compliant devices Feb 3, 2024
@jkralik jkralik requested a review from Danielius1922 February 3, 2024 10:26
@jkralik jkralik marked this pull request as ready for review February 3, 2024 10:49
@Danielius1922
Copy link
Member

Danielius1922 commented Feb 3, 2024

Copy link

sonarqubecloud bot commented Feb 3, 2024

DEVSIM_NET_HOST_PATH = $(shell pwd)/.tmp/devsim-net-host
CERT_TOOL_IMAGE ?= ghcr.io/plgd-dev/hub/cert-tool:vnext
# supported values: ECDSA-SHA256, ECDSA-SHA384, ECDSA-SHA512
CERT_TOOL_SIGN_ALG ?= ECDSA-SHA256
# supported values: P256, P384, P521
CERT_TOOL_ELLIPTIC_CURVE ?= P256
DEVSIM_IMAGE ?= ghcr.io/iotivity/iotivity-lite/cloud-server-discovery-resource-observable-debug:vnext
HUB_TEST_DEVICE_IMAGE = ghcr.io/plgd-dev/hub/test-cloud-server:vnext-pr1202
Copy link
Member

Choose a reason for hiding this comment

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

TODO: update to vnext after

@Danielius1922 Danielius1922 merged commit 1107a03 into main Feb 3, 2024
12 checks passed
@Danielius1922 Danielius1922 deleted the jkralik/feature/bridge-device branch February 3, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants