use of org.jgroups.auth.FixedMembershipToken in project JGroups by belaban.
the class AUTHTest method testFixedMembershipTokenIPv6.
public void testFixedMembershipTokenIPv6() throws Exception {
FixedMembershipToken tok = new FixedMembershipToken();
tok.setMemberList("fe80::aa20:66ff:fe11:d346,2a02:120b:2c45:1b70:aa20:66ff:fe11:d346/7500,2a02:120b:2c45:1b70:f474:e6ca:3038:6b5f/7500");
assert tok.isInMembersList(new IpAddress("2a02:120b:2c45:1b70:f474:e6ca:3038:6b5f", 7500));
}
use of org.jgroups.auth.FixedMembershipToken in project JGroups by belaban.
the class SizeTest method testAuthHeader.
public static void testAuthHeader() throws Exception {
_testSize(new AuthHeader(new FixedMembershipToken("192.168.1.5[7800],192.168.1.3[7800]")));
_testSize(new AuthHeader(new RegexMembership()));
X509Token tok = new X509Token().encryptedToken(new byte[] { 'b', 'e', 'l', 'a' });
_testSize(new AuthHeader(tok));
}
use of org.jgroups.auth.FixedMembershipToken in project JGroups by belaban.
the class AUTHTest method testFixedMembershipTokenIPv4.
public void testFixedMembershipTokenIPv4() throws Exception {
FixedMembershipToken tok = new FixedMembershipToken();
tok.setMemberList("192.168.1.6,10.1.1.1/7500,localhost/7800");
assert !tok.isInMembersList(new IpAddress("192.168.1.3", 7500));
assert !tok.isInMembersList(new IpAddress("10.1.1.1", 7000));
assert tok.isInMembersList(new IpAddress("10.1.1.1", 7500));
// port is not matched
assert tok.isInMembersList(new IpAddress("192.168.1.6", 7500));
// port is not matched
assert tok.isInMembersList(new IpAddress("192.168.1.6", 0));
}
Aggregations