Skip to content

Add public recipe read endpoint by slug #1136

Description

@dgee2

Goal

Add a public (unauthenticated) endpoint that serves a recipe by its slug, enabling public sharing of published recipes.

Spec reference

docs/specs/recipe-creation-target-architecture.md — §"Public recipe endpoints"

Implementation notes

  • GET /public/recipe/{slug} — in the /public route group from E6.5; no RequireAuthorization()
  • Resolves active RecipePublication by slug (where UnpublishedAtUtc IS NULL)
  • Returns RecipeDetail DTO (same shape as authenticated detail)
  • 404 if no active publication for slug
  • Emits RecipeViewed outbox event (unauthenticated variant): { recipeId, viewerUserId: null, isAuthenticated: false, timestamp }

Acceptance criteria

  • Valid slug returns RecipeDetail without authentication
  • Unpublished slug returns 404
  • RecipeViewed outbox event written with isAuthenticated: false

Testing

  • Integration tests: valid slug, unpublished slug, never-published slug all handled correctly
  • Integration test: RecipeViewed event written on public read

Part of#1103

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

    .NETPull requests that update .net codeenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions