Adds creator auditing for custom workflow-run states - #179
Open
raylrui wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds creator auditing and authorization for custom workflow-run states.
Changes:
- Persists and exposes normalized state creator emails.
- Enforces JWT authentication and creator-only comment updates.
- Extends WRSC v1.1.0 schemas, events, hashing, examples, and tests.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
WorkflowRunStateChange.schema.yaml |
Defines optional createdBy. |
WorkflowRunStateChange.schema.json |
Adds generated createdBy property. |
WRSC__example1.json |
Updates event version. |
WRSC__example2.json |
Demonstrates creator auditing. |
viewsets/state.py |
Adds authentication and ownership checks. |
tests/test_state_viewset.py |
Tests auditing and authorization. |
tests/test_event_bridge.py |
Tests WRSC creator emission. |
serializers/state.py |
Exposes state creators. |
models/state.py |
Adds creator persistence. |
0024_state_created_by.py |
Migrates the nullable field. |
workflow_manager_proc/tests/test_workflow_run.py |
Tests WRSC mapping and hashing. |
workflow_manager_proc/services/workflow_run.py |
Maps and hashes createdBy. |
domain/event/wrsc.py |
Adds createdBy to the generated model. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolve #174
Adds creator auditing and JWT-based authorization for custom workflow-run states (
DEPRECATED,RESOLVED, andCANCELLED).Changes
State.created_byfield with no data backfill.emailclaim when creating custom states.created_byis populated.created_byis null.createdByin state history and workflow-runcurrentStateresponses.createdBy; ownership always comes from the JWT.WRSC Changes
createdByto the WRSC schema and generated Pydantic model.1.0.0to1.1.0.createdByin WRSC event hashing.createdByfrom emitted events.Migration
Existing states retain
created_by = null. No ownership is inferred or backfilled.Compatibility Notes
emailclaim.createdByremains optional in WRSC for backward compatibility.