Widening.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4804 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-08-02 21:52:11 +00:00
parent affca34556
commit 87bad12e19
@@ -28,19 +28,17 @@ import com.threerings.util.Name;
import com.threerings.presents.net.UsernamePasswordCreds; import com.threerings.presents.net.UsernamePasswordCreds;
/** /**
* Used by peer servers in a cluster installation to authenticate with one * Used by peer servers in a cluster installation to authenticate with one another.
* another.
*/ */
public class PeerCreds extends UsernamePasswordCreds public class PeerCreds extends UsernamePasswordCreds
{ {
/** A prefix prepended to the node name used as a peer's username to /** A prefix prepended to the node name used as a peer's username to prevent the username from
* prevent the username from colliding with a normal authenticating user's * colliding with a normal authenticating user's username. We assume that colons are not
* username. We assume that colons are not allowed in a normal username. */ * allowed in a normal username. */
public static final String PEER_PREFIX = "peer:"; public static final String PEER_PREFIX = "peer:";
/** /**
* Creates a unique password for the specified node using the supplied * Creates a unique password for the specified node using the supplied shared secret.
* shared secret.
*/ */
public static String createPassword (String nodeName, String sharedSecret) public static String createPassword (String nodeName, String sharedSecret)
{ {
@@ -52,8 +50,7 @@ public class PeerCreds extends UsernamePasswordCreds
*/ */
public PeerCreds (String nodeName, String sharedSecret) public PeerCreds (String nodeName, String sharedSecret)
{ {
super(new Name(PEER_PREFIX + nodeName), super(new Name(PEER_PREFIX + nodeName), createPassword(nodeName, sharedSecret));
createPassword(nodeName, sharedSecret));
} }
/** /**
@@ -64,8 +61,8 @@ public class PeerCreds extends UsernamePasswordCreds
} }
/** /**
* Returns the node name of this authenticating peer (which does not * Returns the node name of this authenticating peer (which does not include the {@link
* include the {@link #PEER_PREFIX}. * #PEER_PREFIX}.
*/ */
public String getNodeName () public String getNodeName ()
{ {