Beispiel #1
0
 public QuorumEnclave(string privateEndPoint, AuthenticationHeaderValue authHeaderValue = null)
 {
     _privateEndPoint = privateEndPoint;
     if (authHeaderValue == null)
     {
         authHeaderValue = UserAuthentication.FromUrl(privateEndPoint)?.GetBasicAuthenticationHeaderValue();
     }
     _authHeaderValue = authHeaderValue;
 }
        public void ShouldDecodeUri()
        {
            var userAuthentication = UserAuthentication.FromUrl("https://*****:*****@localhost:8545");

            Assert.NotNull(userAuthentication);
            Assert.Equal("test", userAuthentication.UserName);
            Assert.Equal("123", userAuthentication.Password);
            var header = userAuthentication.GetBasicAuthenticationHeaderValue();

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