예제 #1
0
 public QuorumEnclave(string privateEndPoint, AuthenticationHeaderValue authHeaderValue = null)
 {
     _privateEndPoint = privateEndPoint;
     if (authHeaderValue == null)
     {
         authHeaderValue = BasicAuthenticationHeaderHelper.GetBasicAuthenticationHeaderValueFromUri(new Uri(privateEndPoint));
     }
     _authHeaderValue = authHeaderValue;
 }
예제 #2
0
        public void ShouldDecodeUri()
        {
            var userAuthentication = UserAuthentication.GetBasicAuthenticationUserInfoFromUri(new Uri("https://*****:*****@localhost:8545"));

            Assert.NotNull(userAuthentication);
            Assert.Equal("test", userAuthentication.UserName);
            Assert.Equal("123", userAuthentication.Password);

            var header = BasicAuthenticationHeaderHelper.GetBasicAuthenticationHeaderValueFromUri(new Uri("https://*****:*****@localhost:8545"));

            Assert.Equal("dGVzdDoxMjM=", header.Parameter);
            Assert.Equal("Basic", header.Scheme);
        }