Service Layer medium complexity backend
3
Dependencies
2
Dependents
0
Entities
0
Integrations

Description

Backend service that generates JWT-signed snapshot URLs for shareable peer mentor profile cards via POST /api/v1/profiles/{userId}/share-link. Serializes a static profile snapshot at share time, writes it to S3-compatible object storage, and returns the signed URL with a configurable TTL (default 7 days). Sensitive fields are excluded from the snapshot by default.

Feature: Share Profile

profile-share-service

Responsibilities

  • Accept a share request with optional contact detail inclusion flag and serialize the user profile into a static JSON snapshot
  • Write the snapshot blob to object storage and generate a JWT-signed public URL with configurable TTL
  • Persist share link metadata (token hash, snapshot key, user ID, expiry) to the profile-share-links-table for revocation and audit
  • Support share link revocation by deleting the snapshot object and invalidating the token record
  • Exclude sensitive fields (personal phone number) from snapshots unless the user explicitly opts in

Interfaces

generateShareLink(userId: string, includeContact: bool): Promise<ShareLinkResult>
revokeShareLink(linkId: string): Promise<void>
validateToken(token: string): Promise<ProfileSnapshot>
buildSnapshot(userId: string, includeContact: bool): Promise<ProfileSnapshot>

Relationships

Dependencies (3)

Components this component depends on

Dependents (2)

Components that depend on this component