Skip to content

M1: Desired-state GET/PUT (CAS) #28

Open

Description

@charlesgreen

Context

PRD: docs/PRD.md §§5, 6.6, 7. Key helpers already include desired/{name}.json.

Goal

Named desired-state documents workers can reconcile against (JumpCloud/Orbit pattern), with CAS on PUT.

Out of scope

  • Worker reconciliation loop (CLI/device side)
  • Notify when desired-state changes
  • UI

API

Method Path Behavior
GET /v1/orgs/{org}/projects/{project}/desired/{name} 200 body + ETag; 404 if missing
PUT /v1/orgs/{org}/projects/{project}/desired/{name} Honor If-Match; return new ETag; 412 on conflict

Document JSON envelope (at least name, org_id, project_id, body, timestamps).

Acceptance criteria

  • GET/PUT round-trip against memory Store
  • CAS conflict → 412
  • Path org/project enforced with auth scope
  • Keys use existing DesiredKey helper
  • httptest tests; make check green

Dependencies

Prefer after “Wire jobs API + auth middleware into serve path”.

How to hand to Aixgo Code

Apply ax:go after auth is on the serve path.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions