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

Why does 'Automatic Device Provisioning' not include the device defaults property #3596

Open
fix-all opened this issue Dec 18, 2023 · 7 comments

Comments

@fix-all
Copy link

fix-all commented Dec 18, 2023

AbstractAutoProvisioningEventSender.sendAutoProvisioningEvent.sendEvent
set new RegistrationAssertion(deviceId), Without using the Auto-Provisioning device object.

KafkaBasedEventSender.sendEvent.addDefaults, The RegistrationAssertion device.getDefaults() is null.

@sophokles73
Copy link
Contributor

It is hard to tell what the issue is that you are facing. Can you elaborate and/or provide a code snippet that illustrates the problem?

@fix-all
Copy link
Author

fix-all commented Dec 20, 2023

It is hard to tell what the issue is that you are facing. Can you elaborate and/or provide a code snippet that illustrates the problem?

ok,
I added additional properties to the device in 'CA' and registered the device using 'Auto-Provisioning'. These properties are set in the device's defaults attribute, and I want to retrieve the device defaults attribute in 'hono.{tenant}.event'. However, 'AbstractAutoProvisioningEventSender.sendAutoProvisioningEvent.eventSender.sendEvent' does not pass the registered device object; instead, it uses 'new RegistrationAssertion(deviceId)'. As a result, 'KafkaBasedEventSender.sendEvent.addDefaults' cannot access the defaults attribute of the registered device.

@sophokles73
Copy link
Contributor

Are you talking about (auto-)registering a new edge device B which connects via a gateway device A that is already registered in the system?
Or are you talking about a new device A which should be auto-registered based on the tenant's trust anchor definition?

@fix-all
Copy link
Author

fix-all commented Dec 21, 2023

Are you talking about (auto-)registering a new edge device B which connects via a gateway device A that is already registered in the system? Or are you talking about a new device A which should be auto-registered based on the tenant's trust anchor definition?

Yes, I'm referring to the auto-registration based on the tenant's trust anchor definition.
The following is a notification emitted by the 'hono.event.testTenant' topic after successful registration. The notification includes the 'types' property of the 'defaults' attribute for 'testTenant', but does not include the 'defaults' attribute for the new device.

header: 
	[ key 1:  tenant_id, value 1: datang ]
	[ key 2:  types, value 2: {"obu":{}} ] 
	[ key 3:  orig_adapter, value 3: hono-device-registry ] 
	[ key 4:  device_id, value 4: test:obu002 ]
	[ key 5:  qos, value 5: 1 ]
	[ key 6:  hono_registration_status, value 6: NEW ]
	[ key 7:  content-type, value 7: application/vnd.eclipse-hono-device-provisioning-notification ]
	[ key 8:  orig_address, value 8: event ]
	[ key 9:  creation-time, value 9: 1702609334479 ]
	[ key 10:  traceparent, value 10: 00-13afddcfc23ff877edf3e18393621517-605de170bef2cfce-00 ]

Because the 'AbstractAutoProvisioningEventSender.sendAutoProvisioningEvent' method does not take the object of the new device as a parameter, and the 'eventSender.sendEvent()' method uses 'new RegistrationAssertion(deviceId)' as second parameter, so the 'defaults' property of the registrated device is not included.

@sophokles73
Copy link
Contributor

sophokles73 commented Dec 22, 2023

Ok, you have defined the types default property for the tenant that the device is being auto-provisioned to, right? And then device test:obu002 is being auto-provisioned to this tenant when it first connects, right?

but does not include the 'defaults' attribute for the new device.

Where should these default properties come from? There is no device information available yet in the registry, that's the whole point of doing auto-registration, isn't it?

@fix-all
Copy link
Author

fix-all commented Dec 24, 2023

I have expanded the auto-provisioned functionality, adding some default information to the certificate for the device. I believe it is better to use the object of device registration rather than 'new RegistrationAssertion(deviceId),' as I want to obtain more information from the automatic registration notification events.

@sophokles73
Copy link
Contributor

Ok, so what is this issue all about then?

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

No branches or pull requests

2 participants