mediacloud / web-search

Code that drives the public web-based tools for the Media Cloud Online News Archive and Directory.
https://search.mediacloud.org
Apache License 2.0
9 stars 13 forks source link

MCWeb Staging Api endpoing is inaccessable from the web (401 unauthorized error) #724

Closed pgulley closed 1 month ago

pgulley commented 1 month ago

This is probably a network thing in UMass's system- is there a way to hit the staging api from within the network? It's probably not super ideal to expose the staging api to the web, but I don't think it would be dangerous. The staging frontend is exposed already anyway.

philbudne commented 1 month ago

Paige wrote:

This is probably a network thing in UMass's system- is there a way to hit the staging api from within the network? It's probably not super ideal to expose the staging api to the web, but I don't think it would be dangerous.

What is the URL that gives the 401 error?

The staging frontend is exposed already anyway.

My understanding is:

Rahul uses "front end" to mean JS code, and "backend" or "mcweb API" means django code, so any use of the web site means accessing the "mcweb API"

I'm able to log in to the mcweb staging server (proxied on tarbell), So you should be able to "manually" use the API via the same URL.

If you're talking about the staging News Search API, I don't think that should be exposed: my understanding is that it has no access control/login, search limits, and can expose full/original page content. Best to use ssh tunneling.

pgulley commented 1 month ago

This was a silly snafu on my part- the issue was just that I was using an api key from the production environment, not the staging environment. Whoops!