Skip to content

Implement websocket-based certificate verification flow #5

@onlydustapp

Description

@onlydustapp

Overview

Implement a certificate verification flow that leverages WebSocket for real-time updates. This feature will enable employers to initiate certificate verification and allow graduates to approve the sign-off using a secret key. The backend will support two main endpoints: one for initiating the verification and another for processing the approval.

Objectives & Flow

  1. Employer Initiates Verification

    • Endpoint: POST /api/verify/initiate
    • Request Structure:
      {
        "certificate_id": "uuidv4_string",
      }
      
    • Response Structure:
      {
        "verification_id": "new_uuidv4",
        "graduate_link": "https://localhost:3000/verify/:verification_id",     
       }
  2. Graduate Approval

    • Endpoint: POST /api/verify/approve
    • Request Structure:
      {
        "verification_id": "uuid_from_link",
        "approval_key": "user_input_key"
      }
    • WebSocket Event: Emit an event with the user inputted key.

# Technical Considerations

  • WebSocket Connection: Ensure a stable WebSocket connection for real-time notifications.
  • Security: Securely handle and store secret keys and hashes.
  • Scalability: Design the endpoints and WebSocket flow to support concurrent verifications without performance degradation.

Definition of Done

  • Employers can initiate verification and receive a proper response with a verification ID, a graduate link, and WebSocket connection details.
  • Graduates can approve the verification using a secret key.
  • Successful approvals correctly trigger real-time WebSocket events to notify employers.
  • Code and integration tests are added to ensure the feature works as expected.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions