Skip to content

Replace hardcoded Coveo api keys with a call to Netlify function #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jan 4, 2024

Conversation

sean-breen
Copy link
Collaborator

@sean-breen sean-breen commented Dec 6, 2023

Proposed changes

Previously the values of each Coveo API key were hardcoded into the hugo theme code in layouts/partial/scripts.html which would pass the appropriate key value to the js.Build command. This would result in the api key being embedded in the minified javascript code, and observable via the inspection tools in a web browser.

This change removes those hardcoded values and replaces them with an API call to a Netlify function which will return the value of the COVEO_SEARCH_TOKEN variable from the Netlify site's environment variables.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md and CHANGELOG.md)

@sean-breen sean-breen marked this pull request as ready for review December 6, 2023 12:28
Copy link
Contributor

@ADubhlaoich ADubhlaoich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for the intent of the effort and to ensure any minimum amount of approvals for merges is reached, but I defer to @nginx-jack to decide when the PR is ready to actually merge.

Copy link
Collaborator

@nginx-jack nginx-jack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge once it's validated on a dev environment in netlify 👍

@sean-breen sean-breen merged commit 05302d6 into main Jan 4, 2024
@ADubhlaoich ADubhlaoich deleted the DOC-84_HugoAPIKeys branch October 14, 2024 16:19
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.

3 participants