Don't require credentials in DB client
Mr0grog opened this issue · 0 comments
Mr0grog commented
The web-monitoring-db client in web_monitoring/db.py
currently requires credentials, but the HTTP API no longer requires authentication for some operations (edgi-govdata-archiving/web-monitoring-db#1069). Accordingly, the client here shouldn’t require an e-mail and password in order to use.
- Make
email
andpassword
constructor parameters optional. - Raise if only one of
email
andpassword
has a value. - Don’t set auth credentials if
email
andpassword
are not present. - Don’t require any of the env vars to be present in
.from_env()
. - Consider adding a separate exception for 403 errors (we have one for 401 — not authenticated — but not 403 — forbidden/not authorized). Users without credentials will probably encounter 403 errors more often than 401 now.