openwisp / openwisp/openwisp-controller
[feature:gsoc26] Integrate Certificate Templates into REST API
@stktyagi is already working on this.
Since May 15, 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.
With the AbstractTemplate model extended to support type="cert", the new ca and blueprint_cert relational fields must be exposed via the REST API. Without this, programmatic management of PKI templates is impossible, blocking third-party integrations and automation scripts.
Describe the solution you'd like
I will update the API serializers and existing endpoints to natively support the new template type:
-
Template Serializer: update the API serializers to conditionally expose the
caandblueprint_certfields. The validation logic must enforce thatcais strictly required whentype="cert", but ignored for other template types. -
Blueprint Validation: ensure the serializer's validation prevents a certificate assigned to a
DeviceCertificatefrom being selected as ablueprint_cert. -
Device Serializer: ensure the Device API serializer correctly handles assignments, transparently creating or destroying
DeviceCertificaterelationships when templates are patched. -
Organization Scoping: ensure that existing OpenWISP multi-tenant RBAC and organization scoping are strictly applied to both the
caandblueprint_certfields during API creation and updates.
Requirements from the GSoC proposal
- Expose the new
Certificatetemplate type within the current REST API template endpoints. - Do not introduce new API endpoints unless the plan changes during implementation.
- Reuse OpenWISP's existing role-based access control.
Tests from the GSoC proposal
- Creating a certificate template via the REST API.
- Template serializer includes
caandblueprint_certfields. - Validation rejects certificate templates without CA.
- Existing RBAC and organization scoping apply.
- Assigning or removing certificate templates through the API triggers the same lifecycle behavior tracked in #1358.
Measurable outcomes: 7
Implementation points: 6, 7
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.