fix: certificate course_id integrity and revocation challenge period (#141, #146) - #273
Open
victor-2017 wants to merge 1 commit into
Open
Conversation
- Hamplard-Hub#141: Remove course_id parameter from issue_certificate; derive it from enrollment_reference lookup, preventing caller-supplied spoofing - Hamplard-Hub#146: Add configurable challenge period to revocation; revoked certificates remain valid during the challenge window, giving holders time to dispute via challenge_revocation() - Init now accepts revocation_challenge_period parameter - Admin can configure challenge period via set_revocation_challenge_period - Add enrollment_ref tracking and counter for enrollment references - 13 new tests covering both issues, all 219 tests passing
|
@victor-2017 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #141
Closes #146
Changes
#141 — Certificate course_id integrity:
course_idparameter fromissue_certificate(); the caller no longer supplies the course_idenrollment_ref: Stringfield toEnrollmentstruct andDataKey::EnrollmentByRef(String)mappingissue_certificate()now derivescourse_idfrom the enrollment reference stored inDataKey::EnrollmentByRef, preventing caller-supplied spoofingcounter_to_string()andgenerate_enrollment_ref()helpers for deterministic enrollment ref generationinit()now acceptsrevocation_challenge_period: u32parameter#146 — Revocation challenge period:
revocation_deadline: Option<u32>field toCertificatestructrevoke_certificate()now sets a pending revocation with a configurable challenge window (default: 17,280 ledger sequences ~ 24 hours)verify_certificate()returnstrue(certificate remains valid)challenge_revocation(student, certificate_id)— allows the certificate holder to dispute within the challenge window, restoring the certificateset_revocation_challenge_period()andget_revocation_challenge_period()for admin configurationTests