You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cdk): normalize after cursor case + colon-truncation in approval-scope guard (#360)
* fix(cdk): normalize after cursor case and fix colon-truncation in approval-scope guard
Two correctness bugs in the task API handlers:
1. get-task-events: a lower-case `after` ULID cursor passed validation
(isValidUlid uppercases before matching) but was used verbatim in the
DynamoDB key condition `event_id > :after`. Stored event_ids are
upper-case Crockford Base32 and DDB compares raw bytes, so a lower-case
cursor sorts after every stored id and the query returns zero events —
a consumer using a contract-valid lower-case cursor silently skips the
rest of the event stream. Fix: upper-case the cursor before the query.
2. create-task-core: the degenerate-pattern guard for bash_pattern:/
write_path: scopes used scope.split(':', 2)[1], which truncates the
value at the next colon. A value whose leading colon-segment is short
or wildcard-heavy (e.g. "ab:cdefgh") was truncated to a degenerate
fragment and spuriously rejected with a 400. Fix: take everything after
the first colon via slice(indexOf(':') + 1).
Adds regression tests for both paths.
* chore(cdk): apply eslint --fix formatting to create-task-core test Resolves the CI 'Fail build on mutation' step: the build runs eslint --fix, which reformats the 'returns 400 for invalid repo' test (splitting the arrow body onto its own line). The autofix was never committed, so a clean build tree diverged from the checkout. Commit the formatted file so the build is a no-op mutation-wise.
---------
Co-authored-by: bgagent <bgagent@noreply.github.com>
Co-authored-by: Alain Krok <alkrok@amazon.com>
0 commit comments