Skip to content

fix: preserve validation errors for numeric auth token options - #454

Open
Shubham-Padkonde wants to merge 1 commit into
cloudinary:masterfrom
Shubham-Padkonde:fix/auth-token-invalid-numeric-errors
Open

Shubham-Padkonde wants to merge 1 commit into
cloudinary:masterfrom
Shubham-Padkonde:fix/auth-token-invalid-numeric-errors

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Invalid non-string values for start_time, duration, or expiration fail inside _ensure_int's exception handler: concatenating the value with a string raises TypeError, masking the intended ValueError. For example, generate_auth_token(acl="*", duration=[300]) never reaches the documented validation error.

Format the value into the existing error message so invalid lists, dictionaries, and complex numbers consistently raise ValueError. Add regression coverage for all three numeric options, including the existing invalid-string behavior.

Validation: 150 auth-token and URL utility tests pass on Python 3.13, both without Django and with Django 5.2 installed. The new regression fails before the change. git diff --check passes. The full test suite was attempted but stopped at the first live API setup because this environment has no Cloudinary test account/network access for that run; live API coverage is not claimed.

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