- CertificateVerifyView: GET /certificates/verify/{serial}/ — AllowAny
- Re-computes SHA-256 from stored PDF and compares to archived hash
- Returns {valid, serial_number, course_title, issued_at, hash} — no PII
- Returns 404 for non-completed or non-existent certificates
- 7 integration tests: hash match, tampered hash, missing file, PII exclusion, 404 cases
Co-Authored-By: Paperclip <noreply@paperclip.ing>
12 lines
406 B
Python
12 lines
406 B
Python
from django.urls import path
|
|
|
|
from .views import CertificateDetailView, CertificateVerifyView, MyCertificatesView
|
|
|
|
app_name = "certificates"
|
|
|
|
urlpatterns = [
|
|
path("", MyCertificatesView.as_view(), name="my-certificates"),
|
|
path("<uuid:cert_id>/", CertificateDetailView.as_view(), name="certificate-detail"),
|
|
path("verify/<str:serial_number>/", CertificateVerifyView.as_view(), name="verify"),
|
|
]
|