Skip to content

Authorize milestone release commands by escrow role #1214

Description

@mikewheeleer

Summary

Service endpoints must not allow an arbitrary authenticated user to trigger a value-moving release.

Why this matters

This closes a correctness, security, or operability gap in the TalentTrust backend and makes the behavior explicit under retries, chain inconsistency, authorization, and failure.

Requirements

  • Repository scope: Talenttrust/Talenttrust-Backend only.
  • Resolve the escrow role from canonical contract metadata; enforce actor authorization before enqueueing work; audit denied attempts.
  • Preserve tenant isolation, structured errors, auditability, and existing API compatibility unless this issue explicitly requires a contract change.
  • Add focused unit and integration coverage for the new behavior.

Technical guidance

  • Follow the repository's existing service, queue, persistence, logging, authentication, and error-envelope conventions.
  • Keep side effects bounded and make retries, ordering, authorization, and failure handling explicit.
  • Document non-obvious operational and security decisions in the PR.

Edge cases — each must have a test

  • authorized owner
  • unauthorized user
  • missing role
  • role changed during request
  • tenant mismatch

Acceptance criteria

  • Every requirement and edge case above is implemented and tested
  • Unit and integration tests cover success, failure, retry, authorization, and boundary paths
  • Existing tests pass with no regressions
  • Errors and logs are structured and do not leak secrets or internal stack details
  • npm run lint, npm test, and npm run build passes locally
  • Code follows existing conventions with no duplication or dead code
  • Documentation or concise comments explain non-obvious decisions
  • PR description explains the approach, includes test evidence and security notes, and references Closes #

Out of scope

  • client-side-only authorization

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveStellar Wave Program task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions