Add hawkBit firmware management extension - #34
Conversation
|
Would be nice to get this merged fairly quickly as I want to deploy the extension to staging for a custom project. Happy to go through the additions/changes if needed. |
… + method renames.
…t already exists, e.g. overwrite the securityToken on re-provision.
wborn
left a comment
There was a problem hiding this comment.
This PR is being reviewed with AI first.
The overall extension structure and hawkBit integration look good. No definite blocking issues were identified, but there are a few lifecycle, security, and documentation points worth clarifying.
Inline comments contain the details.
| Asset<?> asset = assetEvent.getAsset(); | ||
| Optional<String> targetInfoAttributeName = getTargetInfoAttributeName(asset); | ||
|
|
||
| if (targetInfoAttributeName.isEmpty()) { |
There was a problem hiding this comment.
The behavior when firmwareTarget or firmwareMetadata is removed from an existing asset or attribute does not appear to be documented. Currently, removing either marker stops synchronization but leaves the corresponding hawkBit target or metadata entry in place, whereas deleting the asset or attribute removes it.
Is that intentional? It would be useful to document the expected lifecycle when these meta items are removed and add tests covering those transitions.
| try { | ||
| Map<String, String> targetInfo = new LinkedHashMap<>(); | ||
| targetInfo.put("controllerId", target.controllerId()); | ||
| targetInfo.put("securityToken", target.securityToken()); |
There was a problem hiding this comment.
This stores the hawkBit target security token in a normal asset attribute. Users who can read this asset can therefore obtain a credential that can authenticate as the target against the DDI API.
Is exposing the target credential to users with normal asset read access intentional? If not, a more restricted provisioning mechanism may be appropriate.
|
|
||
| ### Firmware Targets | ||
|
|
||
| To sync an OpenRemote asset as a hawkBit target, add the `firmwareTarget` meta item to one attribute of the asset. |
There was a problem hiding this comment.
firmwareTarget requires a TEXT attribute because the service writes the JSON target information into it, but the README currently says it can be added to “one attribute”. Could the TEXT requirement be documented here and ideally validated by the service so a misconfigured asset fails clearly?
Closes #33
Adds a hawkBit firmware extension that connects OpenRemote Manager to the hawkBit Management API, exposes firmware management endpoints, and syncs selected OpenRemote assets as hawkBit targets.
Core Functionality
controllerIdandsecurityToken.Core Files
HawkbitFirmwareService.java: Starts the integration, configures the hawkBit client, registers API resources, and handles asset/attribute sync.HawkbitResponseProxy.java: Copies hawkBit responses back through OpenRemote while preserving status, body, and media type.manager/hawkbit/*Client.java: RESTEasy clients for hawkBit Management API resources.manager/resource/*ResourceImpl.java: OpenRemote API resource implementations that authorize requests and proxy them to hawkBit.model/resource/*Resource.java: Public OpenRemote firmware endpoint definitions and role requirements.FirmwareMetaItemType.java: DefinesfirmwareTargetandfirmwareMetadatameta items.FirmwareModelProvider.java: Registers firmware meta items with the OpenRemote model.README.md: Documents setup, limitations, API coverage, deployment examples, and proxy configuration.Caveats
HAWKBIT_REALM.Testing
Notes