Commit cdc3d08
Raise clear error when signing without
* Fix: raise clear error when signing without api_secret
Add guards to cloudinary_url() and api_sign_request() to raise
ValueError("Must supply api_secret") instead of opaque TypeError when
attempting to sign without a configured secret. This matches the behavior
of other signing paths (sign_request, Search.to_url, etc.) and provides
clear guidance to OAuth-only configurations.
Changes:
- cloudinary_url(): Guard signing block to validate api_secret before use
- api_sign_request(): Guard function entry to validate api_secret parameter
- Add 7 comprehensive test cases covering all scenarios
Fixes spec: cloudinary-url-sign-without-secret.md
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* CI: skip duplicate test runs on PR creation
Prevent workflow from running twice (once on push, once on PR) by adding
a condition that skips push events when they have an associated PR.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* CI: run tests on all branch pushes, once per same-repo PR
The previous condition (github.event.pull_request == null) did not work:
github.event.pull_request is always null on push events regardless of whether
a PR exists, so the redundant run was never skipped.
Correct condition keeps on: [push, pull_request] and runs tests on every
branch push while avoiding the duplicate when a same-repo PR exists:
- push event: always runs (push to any branch, PR or not). On a push event
github.event.pull_request.head.repo.fork dereferences to an empty string
(falsy, no error), so the negation is true.
- same-repo PR: skipped, since that push already triggered a run.
- fork PR: runs via pull_request, since forks can't trigger a push here.
Verified against GitHub docs: dereferencing a missing context property
yields an empty string rather than an error.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>api_secret
1 parent bd50a65 commit cdc3d08
3 files changed
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| 645 | + | |
| 646 | + | |
645 | 647 | | |
646 | 648 | | |
647 | 649 | | |
| |||
875 | 877 | | |
876 | 878 | | |
877 | 879 | | |
| 880 | + | |
| 881 | + | |
878 | 882 | | |
879 | 883 | | |
880 | 884 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
1591 | 1592 | | |
1592 | 1593 | | |
1593 | 1594 | | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1594 | 1643 | | |
1595 | 1644 | | |
1596 | 1645 | | |
0 commit comments