Add DOCRAPTOR_IPS to Django Constance #207
Merged
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
This PR converts the
DOCRAPTOR_IPS
env var to a constance variable that is editable in the admin backend by superusers.We need DocRaptor to be able to access our NOFO pages so that it can request them, load them, and then give us back a PFD document. We use the IPs to identify these incoming requests, and DocRaptor provides a list of IPs that their requests come from.
Sometimes, DocRaptor's IPs change, and then when the NOFO Builder asks for a printout, we end up getting a PDF of our login because the request was not whitelisted. 100% of the time this happens, it's discovered by someone printing a NOFO. Usually, it is also someone who has superuser access.
This PR gives NOFO Builder production staff the ability to solve this problem for themselves by grabbing the latest IP addresses and updating them in the system when they notice a "login" pages getting printed. No more waiting for a code deploy!
Screenshot
Here is what the interface looks like for this:
Only superusers have access to this value, not any user with an account in the NOFO Builder.
Format string
A list of IPs can be passed in in a variety of formats:
18.233.48.178,18.235.199.18,23.20.110.13
18.233.48.178 18.235.199.18 23.20.110.13
You can also combine any of these, eg:
18.233.48.178, \n18.235.199.18, \n23.20.110.13