Skip to content

Conversation

giusebar
Copy link
Contributor

@giusebar giusebar commented Aug 13, 2025

Devices registering to COS for devices might require the generation of certificates to be used in their apps (e.g. a TCP server running on the robot or a websocket).
This PR adds the generation of self-signed TLS certificates when a GET request is received on the api/v1/devices/<uuid>/certificate endpoint.
The cert and key are then sent in the response.

Tests and openapi have been updated accordingly.

An example of the agent registering and retrieving certificates is available in canonical/cos-registration-agent#53.

@Guillaumebeuzeboc
Copy link
Collaborator

I am not sure about the logic. It appears to be opposed of what was done before.
Previously, the cos-registration-agent was creating its UUID if not provided and simply registering it to the server.
Same for the public/private RSA key we were using for the ros2bag-filserver.
Here the logic is the opposite.
We have been using the POST api/v1/devices to store information to the server. And here we are requesting an information from the server.
Maybe we could add an additional endpoint to request a certificate generation (something like GET api/v1/devices/UUID/certificate). This way we don't have one endpoint that does too many things.

@giusebar
Copy link
Contributor Author

I am not sure about the logic. It appears to be opposed of what was done before. Previously, the cos-registration-agent was creating its UUID if not provided and simply registering it to the server. Same for the public/private RSA key we were using for the ros2bag-filserver. Here the logic is the opposite. We have been using the POST api/v1/devices to store information to the server. And here we are requesting an information from the server. Maybe we could add an additional endpoint to request a certificate generation (something like GET api/v1/devices/UUID/certificate). This way we don't have one endpoint that does too many things.

This has been addressed and changed after discussion, from commit 536e4c4

@giusebar giusebar merged commit 8daba25 into main Aug 27, 2025
4 of 5 checks passed
@giusebar giusebar deleted the feat/add-generation-of-device-tls-cert branch August 27, 2025 07:01
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