Skip to content

fix(#313): Service-token auth docs, job polling denial logs, tests - #314

Merged
mottych merged 2 commits into
devfrom
feature/issue-313-service-token-docs-logging-tests
Apr 15, 2026
Merged

fix(#313): Service-token auth docs, job polling denial logs, tests#314
mottych merged 2 commits into
devfrom
feature/issue-313-service-token-docs-logging-tests

Conversation

@mottych

@mottych mottych commented Apr 13, 2026

Copy link
Copy Markdown
Owner

Summary

Closes the PurposePath_AI side of #313: document the coaching vs BFF auth boundary, improve CloudWatch-friendly denial logging for async job polling, and add regression tests for service_enrichment JWT access to GET /api/v1/ai/jobs/{jobId}.

Notes

  • The reported 403 on https://api.dev.purposepath.app/.../execute-async is expected to be fixed in PurposePath_Api (BFF policies), not coaching.
  • Coaching continues to return 401 with detail for invalid polling tokens; denials now include async_job_auth.denied denial_reason=....

Validation

  • uv run pytest tests/unit/api/routes/test_ai_job_status_route.py tests/unit/api/routes/test_ai_execute_async.py -v
  • ruff check/format + mypy on touched Python files

mottych added 2 commits April 12, 2026 20:45
- Document coaching vs api.{env} BFF 403 vs coaching 401 in email-insights §4.6.1

- Log async_job_auth.denied with denial_reason; user_auth.denied for inactive users

- Add v2 async_execute.started has_bearer_header for observability

- Unit tests: GET /ai/jobs accepts service_enrichment JWT (snake/camel token type)

Made-with: Cursor
@mottych
mottych merged commit b4a0cad into dev Apr 15, 2026
1 check passed
@mottych
mottych deleted the feature/issue-313-service-token-docs-logging-tests branch April 15, 2026 02:18
mottych added a commit that referenced this pull request Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant