openwisp / openwisp/openwisp-controller
[feature:gsoc26] Introduce DeviceCertificate relational model for standalone certificates
@stktyagi is already working on this.
Since May 26, 2026.
- Dominant language
- Python
- Stars
- 773
- Forks
- 315
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 14
Description
Is your feature request related to a problem? Please describe.
Currently, there is no robust relational way to track which standalone X.509 certificates belong to which device configurations, or which template originally generated them. Relying on string-matching the common_name to bind certificates to devices is fragile and prone to edge-case collisions, especially in large-scale deployments.
Describe the solution you'd like
I will introduce a DeviceCertificate intermediate Many-To-Many (M2M) model to act as a strict relational bridge. This directly mirrors OpenWISP's proven VpnClient architecture, enforcing strong Foreign Key constraints between the device configuration, the template, and the generated physical certificate.
Create a DeviceCertificate model with the following fields:
config: ForeignKey to theConfigmodel, the device's configuration.template: ForeignKey to theTemplatemodel, the template that triggered creation.cert: OneToOneField to thedjango_x509.Certmodel, the actual generated X.509 certificate.auto_cert: BooleanField to track whether the certificate is auto-managed by the system.- Enforce
unique_together = ('config', 'template')at the database level to ensure a single device configuration cannot generate multiple conflicting certificates from the same template.
Relationship with lifecycle issue
This issue tracks the relational model described in the proposal. The lifecycle behavior that uses this model, including assignment, generation, revocation, renewal, and config status updates, is tracked in #1358.
Measurable outcome: 3
Implementation point: 2, 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.