When strict transformations are enabled, token-based access fails with a 401
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, nodejs
Research direction
Start in lib/utils/index.js around line 880 and reproduce the cloudinary.url call with both auth_token and sign_url enabled. Trace why the generated URL contains the token but lacks the signature path parameter. Done means the resulting URL includes the expected signature and works with strict transformations.
Written by the indexing model from the issue text.
Description
Describe the bug in a sentence or two.
When I set both the auth_token and sign_url parameters on cloudinary.url, the resulting URL is given a token but is not signed. Thus, if I have strict transformations enabled, I still get a 401 from the resulting URL.
Issue Type (Can be multiple)
[ ] Build - Can’t install or import the SDK
[ ] Babel - Babel errors or cross browser issues
[ ] Performance - Performance issues
[x] Behaviour - Functions aren’t working as expected (Such as generate URL)
[ ] Documentation - Inconsistency between the docs and behaviour
[ ] Incorrect Types - For typescript users who are having problems with our d.ts files
[ ] Other (Specify)
Steps to reproduce
Any basic call to cloudinary.url, e.g.:
cloudinary.url('my_image', {
type: 'upload',
auth_token: { key: '<encryption-key>', duration: 300 },
sign_url: true,
})
This gives me:
https://res.cloudinary.com/<env>/image/upload/my_image?__cld_token__=exp=1234~hmac=<snip>&_a=BAMCkGUm0
The URL is missing the signature path param, so if I have strict transformations, the URL doesn't work.
Seems like this conditional is preventing it: https://github.com/cloudinary/cloudinary_npm/blob/d12a63fefdd0209ed71c3a641a9d3166126c09d8/lib/utils/index.js#L880
I'm not sure if there's a different reason for it, but as a new user to the platform, my gut feeling says this part might need to change.
Versions and Libraries (fill in the version numbers)
Cloudinary_NPM SDK version 2.5.1
Node - 18.13.0
NPM - 0.0.0
PNPM - 9.4.0
- Dominant language
- JavaScript
- Stars
- 672
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudinary/cloudinary_npm
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
cloudinary/cloudinary_npm#746 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
cloudinary/cloudinary_npm#739 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
cloudinary/cloudinary_npm#734 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
cloudinary/cloudinary_npm#713 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
cloudinary/cloudinary_npm#712 · 1 comment ·
All issues in cloudinary/cloudinary_npm
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
discovery:other factory-active task-identify-harness-labels-done task-identify-issue-type-done
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
vercel/ai#25068 · 4 comments ·
Maintainers usually reply within 1 day
-
needs-triage typo
Difficulty 1/5 Under an hour Newbie friendliness 88/100
llm-d-incubation/llm-d-scaling-manager#122 ·
Maintainers usually reply within 1 day
-
create-strapi-app doesn't await writing license.txt, so a failed write skips its error handlingOpenflag: invalid template issue: bug severity: low source: cli status: pending reproduction version: 5
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
strapi/strapi#28637 · 1 comment ·
Maintainers usually reply within 2 days
-
meta
Difficulty 1/5 Under an hour Newbie friendliness 88/100
matrix-org/matrix.org#3774 ·
Maintainers usually reply within 1 day