Pluggable Router Trust Filtering
Opened 4 years ago
Last modified 4 years ago
#2039infoneeded_newenhancement
Pluggable Router Trust Filtering
Reported by:ocean1Owned by: Priority: minor Milestone: undecided Component: router/netdb Version: 0.9.31 Keywords:
Cc:
Parent Tickets:
Sensitive: no
Description
PROBLEM:
We would like to ignore some Routers that aren't 'trustworthy'. If a Router is not trust-worthy then it should not be added to the NetworkDatabaseFacade? and no connections should be made to it.
In terms of our specific use-case we would like to ignore any RouterInfo? that does not possess a valid Certificate.
PROPOSED SOLUTION:
- An interface that allows the Router to assign other Routers a trust core eg:
public interface RouterTrustStrategy? {
public int rank(RouterInfo? ri);
}
-
The NetworkDatabaseFacade? should expose a 'setRouterTrustStrategy(RouterTrustStrategy?)' method.
-
Whenever the NDB learns about a new RouterInfo? it should ask the RouterTrustStrategy? to rank the RI. If the RouterTrustStrategy? returns a negative number (strictly less than zero) it should discard that RI and should *not* add it to the NDB.
-
Some sort of pluggable service loading strategy should be provided to allow people to plug in custom RouterTrustStrategy? interfaces that can be instantiated by the I2PAppContext and then passed to the NetworkDatabaseFacade?.
-
A 'DefaultRouterTrustStrategy?' that always returns zero.