Skip to content

[CT-02] Implement revoke_document handler #534

@mftee

Description

@mftee

Problem

The POST /revoke endpoint returns a hardcoded NOT_FOUND with not yet implemented. There is no way to record that a previously anchored document has been revoked, which is a required step in the document lifecycle.

Proposed Solution

Implement the revoke_document handler inside contract/module/revoke/. The revocation must be anchored on Stellar and recorded in Redis so that downstream systems can detect revoked documents.

Acceptance Criteria

  • Handler validates the document_hash using HashValidator::validate_sha256
  • Checks Redis for an existing revocation record — if one already exists returns 409 with a already revoked error
  • Anchors the revocation event on Stellar using StellarClient with a memo containing REVOKE: and the first 20 characters of the hash
  • Stores the revocation record in Redis under key revoke:{document_hash} with fields: reason, revoked_by, txHash, and revoked_at (Unix timestamp)
  • Returns 200 with a RevokeResponse containing transaction_id and revoked_at
  • Returns 400 for invalid hash format
  • Implementation files live inside contract/module/revoke/

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions