Closed symroe closed 2 months ago
I think we do need the allow list for MVP. As well as API endpoints, you also need to be able to disable this on whatever URL the load balancer uses for its health check endpoint.
Otherwise
401
s in a row..and now you're in a reboot loop.
Some other things to consider:
Some older DC apps still have some residual code knocking about from before when we did this with django-basicauth. For example:
I think it is reasonable to implement this as a shared middleware in dc_django_utils to standardise it, but when we roll it out we need to be conscious to do the necessary cleanup as part of that job.
Yeah, good point. Added in a new commit,
Build is failing due to lint errors and I've suggested one more test case. Once you've done those two, I reckon it is good to merge :+1:
Thanks, both done. I'll wait for the build and then merge and publish a new release
Basic auth middleware that's enabled if it thinks it's in the correct DC environment.
This will globally restrict the site. I think we might want an allow list for some paths in future (e.g, an API endpoint that already has authentication on it), but this is a decent MVP I think.