-
Notifications
You must be signed in to change notification settings - Fork 234
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
Explorer API - add port check and node description/stats proxy #731
Conversation
This fixes mixed-content responses when using the mix node API from the network explorer. An in-memory cache protects the explorer API from over-querying the http API on the mix node.
…d `/stats` http api resources to allow the network explorer do https requests for the mix node api resource avoid mixed content requests
{ | ||
self.inner | ||
.get(&identity_key) | ||
.filter(|cache_item| cache_item.valid_until > SystemTime::now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, perhaps there should be some way of removing stale entries from the cache? Right now everything will just stay there forever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it is a bit wasteful generally - although I'm hoping the memory requirements for thousands of nodes will still be megabytes. I can add a cleanup background task sometime if it becomes a problem.
… and remove custom CORS handler
This PR adds new features to the Explorer API:
mix_port
,verloc_port
,http_api_port
)/description
and/stats
from mix node http API to allow the Network Explorer UI to make requests for these without mixed content errors (http fetches from an app served on https)The default cache TTL is 30 minutes.