Skip to content

feat: add secure, cname, secureDistribution and privateCdn plugin options #82#83

Merged
raae merged 6 commits into
cloudinary-community:mainfrom
olavea:Be-able-to-pass-in-a-custom-cname-into-the-config-#82
Oct 14, 2023
Merged

feat: add secure, cname, secureDistribution and privateCdn plugin options #82#83
raae merged 6 commits into
cloudinary-community:mainfrom
olavea:Be-able-to-pass-in-a-custom-cname-into-the-config-#82

Conversation

@olavea

@olavea olavea commented Oct 5, 2023

Copy link
Copy Markdown
Collaborator
  • cname, secureDistribution and privateCdn are consumed by generateUrl to create both a secure_url and a url
  • Using camel case for plugin options, because that is the existing pattern
  • No validation that the combination cname, secureDistribution and privateCdn plugin options is correct
  • Did not add missing test in gatsby-node.test.js for getNodeData, will make hacktoberfest issue
  • Added happy path tests in utils.test.js for CNAME and Private CDN
  • Manually tested happy paths for CNAME and Private CDN using demo site

@olavea olavea self-assigned this Oct 5, 2023
BREAKING CHANGE:
- secure_url (https) on sourced Cloudinary media nodes  removed, use url instead
- for unsecure url (http) set plugin option secure to false
@olavea olavea force-pushed the Be-able-to-pass-in-a-custom-cname-into-the-config-#82 branch from 37dc2a1 to f10ce2a Compare October 6, 2023 09:56
@olavea olavea force-pushed the Be-able-to-pass-in-a-custom-cname-into-the-config-#82 branch from 08d9501 to 9f62f92 Compare October 6, 2023 12:04
…reDistribution and privateCdn) plugin options
@olavea olavea changed the title fix: allow to pass a custom cname into config #82 feat: add cname, secureDistribution and privateCdn plugin options #82 Oct 6, 2023
@olavea olavea changed the title feat: add cname, secureDistribution and privateCdn plugin options #82 feat: add secure, cname, secureDistribution and privateCdn plugin options #82 Oct 6, 2023
@colbyfayock

Copy link
Copy Markdown
Contributor

i dont think a breaking change is necessary, we can generate the url and secure_url as the cloudinary resource requests return giving the option dependent on what they want to use.

it looks like the URLs generated when requesting the resource return the secure_distribution value on both the url and secure URL with the http/https as expected

image

one thing however that if ound though is cloudinary.url works slightly differently in that it won't just simply return the URL with the cname/secure distribution since those are configured based on the secure value. as this isn't existing functionality and future iterations may change, im not going to try to mess with that and leave the URL generation based on secure:false + cname and secure:true + secure_distribution

another thing, i dont know what the specifics are of this, but i noticed that we weren't updating these values in cloudinaryData and that object is intended to be the best practice path for accessing the node data, so adding the url and secure url override there as well

image

finally i think theres a bug, i dont think the responsive images are getting the appropriate URL?

image

if not im not sure where else it would grab a res.cloudinary.com URL from. but im digging into this now

@raae raae force-pushed the Be-able-to-pass-in-a-custom-cname-into-the-config-#82 branch from 583f916 to a3091b1 Compare October 14, 2023 12:19
@raae raae force-pushed the Be-able-to-pass-in-a-custom-cname-into-the-config-#82 branch from a3091b1 to 6668d62 Compare October 14, 2023 12:21
@raae

raae commented Oct 14, 2023

Copy link
Copy Markdown
Collaborator

Great catch @colbyfayock, something messed these concepts up in my brain.

@raae raae merged commit b6d2fca into cloudinary-community:main Oct 14, 2023
@raae raae deleted the Be-able-to-pass-in-a-custom-cname-into-the-config-#82 branch October 14, 2023 13:16
github-actions Bot pushed a commit that referenced this pull request Oct 14, 2023
# [0.6.0](v0.5.1...v0.6.0) (2023-10-14)

### Features

* add cname, secureDistribution and privateCdn plugin options [#82](#82) ([#83](#83)) ([b6d2fca](b6d2fca))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@raae raae linked an issue Oct 14, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Be able to pass in a custom cname into the config

3 participants