docs: security requirement of NameResolver.getServiceAuthority() (#2665)

In response to #2662
This commit is contained in:
Kun Zhang 2017-01-27 09:27:47 -08:00 committed by GitHub
parent 65e4d9f47a
commit 9983a7b9e4
1 changed files with 6 additions and 4 deletions

View File

@ -49,11 +49,13 @@ import javax.annotation.concurrent.ThreadSafe;
@ThreadSafe @ThreadSafe
public abstract class NameResolver { public abstract class NameResolver {
/** /**
* Returns the authority, which is also the name of the service. * Returns the authority used to authenticate connections to servers. It <strong>must</strong> be
* from a trusted source, because if the authority is tampered with, RPCs may be sent to the
* attackers which may leak sensitive user data.
* *
* <p>An implementation must generate it locally and <string>must</strong> keep it * <p>An implementation must generate it without blocking, typically in line, and
* unchanged. {@code NameResolver}s created from the same factory with the same argument must * <strong>must</strong> keep it unchanged. {@code NameResolver}s created from the same factory
* return the same authority. * with the same argument must return the same authority.
*/ */
public abstract String getServiceAuthority(); public abstract String getServiceAuthority();