Commit bc75edc
authored
Handle permission denied error in Nexus HandleScheduleCommand (temporalio#8442)
## What changed?
Nexus HandleScheduleCommand handles PermissionDenied by failing the WFT.
## Why?
We want to distinguish between Nexus endpoint not found and caller
namespace unauthorized errors.
## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Handle `PermissionDenied` from endpoint lookup by failing the workflow
task and add a targeted unit test.
>
> - **Workflow command handling**
(`components/nexusoperations/workflow/commands.go`):
> - On `GetByName` error `PermissionDenied`, return
`FailWorkflowTaskError` with cause
`WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_NEXUS_OPERATION_ATTRIBUTES` and
an authorization message, instead of propagating the error.
> - **Tests** (`components/nexusoperations/workflow/commands_test.go`):
> - Extend fake endpoint registry to simulate `PermissionDenied` for a
specific endpoint name.
> - Add test "caller namespace unauthorized" asserting WFT failure and
no history events.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7585f5a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 13dcce5 commit bc75edc
File tree
2 files changed
+26
-1
lines changed- components/nexusoperations/workflow
2 files changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
171 | 191 | | |
172 | 192 | | |
173 | 193 | | |
| |||
0 commit comments