-
Notifications
You must be signed in to change notification settings - Fork 3
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
1555 Build endpoint for sending project updates #1616
Merged
dhochbaum-dcp
merged 6 commits into
develop
from
1555/build-endpoint-for-sending-project-updates
Dec 16, 2024
Merged
1555 Build endpoint for sending project updates #1616
dhochbaum-dcp
merged 6 commits into
develop
from
1555/build-endpoint-for-sending-project-updates
Dec 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for labs-zap ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
dhochbaum-dcp
force-pushed
the
1555/build-endpoint-for-sending-project-updates
branch
from
December 9, 2024 14:41
a535f66
to
e4d6bce
Compare
TylerMatteo
requested changes
Dec 9, 2024
dhochbaum-dcp
force-pushed
the
1555/build-endpoint-for-sending-project-updates
branch
3 times, most recently
from
December 11, 2024 18:48
f5f1bf6
to
f877506
Compare
TylerMatteo
requested changes
Dec 11, 2024
dhochbaum-dcp
force-pushed
the
1555/build-endpoint-for-sending-project-updates
branch
from
December 13, 2024 15:28
f877506
to
18b2486
Compare
TylerMatteo
requested changes
Dec 16, 2024
TylerMatteo
approved these changes
Dec 16, 2024
dhochbaum-dcp
deleted the
1555/build-endpoint-for-sending-project-updates
branch
December 16, 2024 20:55
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Build new endpoint to trigger project update emails for given project
POST
endpoint to/projects/<projectid>/send-update
Authorization
header implementingBasic
authorization method. Credentials should beusername:password
base64 encoded. Username can beae-admin
, password should be randomly generated UUID to be stored as environment variable. If given authorization header contains incorrect credentials, return401 Unauthorized
response.200
404
Tasks/Bug Numbers
Technical Explanation
I ended up not needing to add any dependencies for this endpoint. 🎉
We did not need anything to manage users, since we do not have multiple users.
Basic
authorization only requires that we ensure that theusername:password
base64 encoded sent with the request is correct. I added a module/service to handle this portion. Because this is a different authentication than is used elsewhere on the server, and is limited to a single endpoint, I was able to put the authorization in the controller, rather than needing to add it as middleware.We had discussed potentially using Handlebars, but there did not appear to be any packages that provide out-of-the-box support for our use case. There is support for either using Handlebars as your primary means of templating, and support for using Handlebars to precompile your site using a CLI; but they are not suited for importing a Handlebars template, populating it on the fly, and returning an HTML string. Because of this, it would be overkill for us to come up with a complex implementation when the MVP requires only a single email template for this purpose, when instead we could simply use template literals.
Any other info you think would help a reviewer understand this PR?