Skip to content

feat: add pull-based attestation request workflow#235

Merged
Haroldwonder merged 2 commits intoHaroldwonder:mainfrom
Mozez155:link-2
Mar 27, 2026
Merged

feat: add pull-based attestation request workflow#235
Haroldwonder merged 2 commits intoHaroldwonder:mainfrom
Mozez155:link-2

Conversation

@Mozez155
Copy link
Copy Markdown

closes #123

Subjects can now request attestations from registered issuers on-chain,
creating a pull-based flow instead of requiring issuers to know subjects
in advance.

New types (types.rs):

  • AttestationRequest struct: id, subject, issuer, claim_type, timestamp,
    expires_at, status, rejection_reason
  • RequestStatus enum: Pending / Fulfilled / Rejected
  • ATTESTATION_REQUEST_TTL_SECS constant (7 days)

New error variants (errors.rs):

  • RequestAlreadyProcessed, RequestExpired, DuplicateRequest

New storage keys + methods (storage.rs):

  • AttestationRequest(String), IssuerRequests(Address)
  • set/get_attestation_request, get/add_issuer_request

New events (events.rs):

  • attestation_requested (req), request_fulfilled (req_ok),
    request_rejected (req_no)

New contract entry points (lib.rs):

  • request_attestation — subject auth; deduplicates pending requests
  • fulfill_request — issuer auth; creates standard attestation + audit log
  • reject_request — issuer auth; stores reason, validates length
  • get_pending_requests — paginated; filters expired/processed entries
  • get_attestation_request — direct lookup by ID

21 tests covering the full lifecycle: happy paths, wrong-issuer, duplicate,
expiry, already-processed, reason-too-long, event emission, and pagination.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 26, 2026

@Mozez155 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! 🚀

Learn more about application limits

@Haroldwonder Haroldwonder merged commit 822e528 into Haroldwonder:main Mar 27, 2026
0 of 3 checks passed
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.

Feature: Add subject self-service attestation request

2 participants